Changeset 213 for trunk/UGame.pas


Ignore:
Timestamp:
May 24, 2018, 9:25:17 PM (6 years ago)
Author:
chronos
Message:
  • Added: Button with action to surrender the game.
  • Fixed: Added framing comm component for correct separation of network messages.
  • Added: New game protocol command NextPlayer. GUI client will redraw map on this event to see how other players/AI fight each other.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r211 r213  
    331331    function SetMove(CellFrom, CellTo: TCell; Power: Integer; Confirmation: Boolean = True): TUnitMove;
    332332    procedure Reset;
     333    procedure Surrender;
    333334    function IsAlive: Boolean;
    334335    procedure Clear;
     
    25262527end;
    25272528
     2529procedure TPlayer.Surrender;
     2530var
     2531  I: Integer;
     2532begin
     2533  Moves.Clear;
     2534  for I := 0 to PlayerMap.Cells.Count - 1 do
     2535    if PlayerMap.Cells[I].MapCell.Player = Self then
     2536      PlayerMap.Cells[I].MapCell.Player := nil;
     2537end;
     2538
    25282539function TPlayer.IsAlive: Boolean;
    25292540begin
Note: See TracChangeset for help on using the changeset viewer.