Changeset 197 for trunk/UCore.pas
- Timestamp:
- May 16, 2018, 11:03:48 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r196 r197 116 116 resourcestring 117 117 SPlayerWins = 'Player %s wins'; 118 SPlayersWins = 'Players %s win'; 118 119 SEndGame = 'End game?'; 119 120 SEndGameQuestion = 'Do you want to end current game?'; … … 127 128 128 129 procedure TCore.DoOnWin(Player: TPlayer); 130 var 131 PlayerNames: string; 132 AlivePlayers: TPlayerArray; 133 I: Integer; 129 134 begin 130 135 RedrawClients; 131 ShowMessage(Format(SPlayerWins, [Player.Name])); 136 if Assigned(Player) then 137 ShowMessage(Format(SPlayerWins, [Player.Name])) 138 else begin 139 AlivePlayers := Game.Players.GetAlivePlayers; 140 PlayerNames := ''; 141 for I := 0 to Length(AlivePlayers) - 1 do begin 142 if I > 0 then PlayerNames := PlayerNames + ', '; 143 PlayerNames := PlayerNames + AlivePlayers[I].Name; 144 end; 145 ShowMessage(Format(SPlayersWins, [PlayerNames])) 146 end; 132 147 end; 133 148 … … 407 422 FreeAndNil(StoredDimension); 408 423 FreeAndNil(Server); 424 FreeAndNil(Clients); 409 425 FreeAndNil(Game); 410 FreeAndNil(Clients);411 426 end; 412 427
Note:
See TracChangeset
for help on using the changeset viewer.