Ignore:
Timestamp:
Jun 21, 2024, 3:20:20 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormUnitMoves.pas

    r317 r318  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   FormEx;
     7  FormEx, Game;
    88
    99type
     
    1616    procedure ListView1Data(Sender: TObject; Item: TListItem);
    1717  public
     18    Game: TGame;
    1819    procedure ReloadList;
    1920  end;
     
    2324
    2425uses
    25   Game, Core, Player;
     26  Player;
    2627
    2728{$R *.lfm}
     
    3132procedure TFormUnitMoves.ListView1Data(Sender: TObject; Item: TListItem);
    3233begin
    33   if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) then
    34   with Core.Core.Game.CurrentPlayer do
     34  if Assigned(Game) and Assigned(Game.CurrentPlayer) then
     35  with Game.CurrentPlayer do
    3536  if (Mode = pmHuman) and (Item.Index < Moves.Count) then
    3637  with TUnitMove(Moves[Item.Index]) do begin
     
    4950procedure TFormUnitMoves.ReloadList;
    5051begin
    51   if Assigned(Core.Core.Game) and Assigned(Core.Core.Game.CurrentPlayer) and
    52   (Core.Core.Game.CurrentPlayer.Mode = pmHuman) then
    53     ListView1.Items.Count := Core.Core.Game.CurrentPlayer.Moves.Count
     52  if Assigned(Game) and Assigned(Game.CurrentPlayer) and
     53  (Game.CurrentPlayer.Mode = pmHuman) then
     54    ListView1.Items.Count := Game.CurrentPlayer.Moves.Count
    5455  else ListView1.Items.Count := 0;
    5556  ListView1.Refresh;
Note: See TracChangeset for help on using the changeset viewer.