Changeset 18 for trunk/UGame.pas
- Timestamp:
- Feb 26, 2014, 9:45:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r17 r18 7 7 uses 8 8 Classes, SysUtils, ExtCtrls, Graphics, Contnrs; 9 10 const 11 DefaultPlayerStartUnits = 5; 9 12 10 13 type … … 80 83 TotalUnits: Integer; 81 84 TotalCells: Integer; 85 StartUnits: Integer; 82 86 procedure ComputerTurn; 83 87 procedure SelectCell(Pos: TPoint); 84 88 procedure Paint(PaintBox: TPaintBox); 85 89 constructor Create; 90 procedure Assign(Source: TPlayer); 91 end; 92 93 TPlayers = class(TObjectList) 94 86 95 end; 87 96 … … 105 114 procedure SetMove(CellFrom, CellTo: TCell); 106 115 public 107 Players: T ObjectList; // TList<TPlayer>116 Players: TPlayers; 108 117 Map: THexMap; 109 118 VoidEnabled: Boolean; … … 171 180 not ((DX = -1) and (DY = -1)) and 172 181 not ((DX = 1) and (DY = 1)))); 182 Result := Result and not (Cell1 = Cell2); 173 183 end; 174 184 … … 240 250 ViewZoom := 1; 241 251 SelectedCell := nil; 252 StartUnits := DefaultPlayerStartUnits; 253 end; 254 255 procedure TPlayer.Assign(Source: TPlayer); 256 begin 257 Name := Source.Name; 258 Color := Source.Color; 259 Mode := Source.Mode; 260 Game := Source.Game; 261 TotalCells := Source.TotalCells; 262 TotalUnits := Source.TotalUnits; 263 StartUnits := Source.StartUnits; 264 SelectedCell := Source.SelectedCell; 265 ViewZoom := Source.ViewZoom; 242 266 end; 243 267 … … 365 389 Randomize; 366 390 367 Players := T ObjectList.Create;391 Players := TPlayers.Create; 368 392 Player := TPlayer.Create; 369 393 Player.Name := 'Player 1'; … … 419 443 StartCell.Terrain := ttNormal; 420 444 StartCell.Player := TPlayer(Players[I]); 445 StartCell.Power := TPlayer(Players[I]).StartUnits; 421 446 end; 422 447 end;
Note:
See TracChangeset
for help on using the changeset viewer.