Changeset 20 for trunk/UGame.pas
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 3 3 lib 4 4 xtactics.res 5 xtactics.dbg
-
- Property svn:ignore
-
trunk/UGame.pas
r19 r20 112 112 FOnMove: TMoveEvent; 113 113 FOnWin: TWinEvent; 114 FRunning: Boolean; 114 115 procedure MoveAll(Player: TPlayer); 115 116 procedure SetMove(CellFrom, CellTo: TCell); 117 procedure SetRunning(AValue: Boolean); 116 118 public 117 119 Players: TPlayers; … … 121 123 Moves: TObjectList; // TList<TMove> 122 124 TurnCounter: Integer; 123 Running: Boolean; 125 124 126 procedure ComputePlayerStats; 125 127 procedure NextTurn; … … 127 129 destructor Destroy; override; 128 130 procedure New; 131 property Running: Boolean read FRunning write SetRunning; 129 132 published 130 133 property OnMove: TMoveEvent read FOnMove write FOnMove; … … 343 346 end; 344 347 348 procedure TGame.SetRunning(AValue: Boolean); 349 begin 350 if FRunning = AValue then Exit; 351 if AValue then begin 352 if Players.Count < 2 then raise Exception.Create('You need at least two players'); 353 FRunning := AValue; 354 end else FRunning := AValue; 355 end; 356 345 357 procedure TGame.ComputePlayerStats; 346 358 var … … 454 466 end; 455 467 CurrentPlayer := TPlayer(Players[0]); 456 Running := True;457 468 end; 458 469
Note:
See TracChangeset
for help on using the changeset viewer.