Changeset 231 for trunk/UClientAI.pas


Ignore:
Timestamp:
Sep 19, 2018, 2:05:52 PM (6 years ago)
Author:
chronos
Message:
  • Modified: UGame unit was split to UPlayer, UMap and UClientGUI units to have better logical separation of game classes.
  • Modified: Drawing methods moved from TMap and TPlayerMap to TClientGUI. Generic TClient class and TComputer classes don't need have any drawing support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UClientAI.pas

    r223 r231  
    66
    77uses
    8   Classes, SysUtils, UGameClient, UGame, Math;
     8  Classes, SysUtils, UGameClient, UGame, Math, UPlayer, UMap;
    99
    1010type
     
    232232              if (TargetCells[C].GetAvialPower + TargetCells[C].GetAttackPower + MovedPower) > Game.Map.MaxPower then
    233233                MovedPower := Game.Map.MaxPower - TargetCells[C].GetAvialPower - TargetCells[C].GetAttackPower;
    234               MapCell.Player.SetMove(Neighbors[I], TargetCells[C], MovedPower, False);
     234              TPlayer(MapCell.Player).SetMove(Neighbors[I], TargetCells[C], MovedPower, False);
    235235            end;
    236236          end;
     
    311311      // Fallback
    312312      for I := MovesTo.Count - 1 downto 0 do
    313         MapCell.Player.Moves.Remove(MovesTo[I]);
     313        TPlayer(MapCell.Player).Moves.Remove(MovesTo[I]);
    314314      for I := 0 to Neighbors.Count - 1 do
    315315      if (Neighbors[I].MapCell.Player = MapCell.Player) and (AttackersCount(Neighbors[I]) = 0) then begin
    316         MapCell.Player.SetMove(BorderCells[C], Neighbors[I], GetAvialPower, False);
     316        TPlayer(MapCell.Player).SetMove(BorderCells[C], Neighbors[I], GetAvialPower, False);
    317317        Break;
    318318      end;
Note: See TracChangeset for help on using the changeset viewer.