Changeset 220 for trunk/UGameProtocol.pas
- Timestamp:
- Jun 10, 2018, 12:18:28 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGameProtocol.pas
r215 r220 10 10 type 11 11 TCommand = (cmdTextMessage, cmdTurnStart, cmdTurnEnd, cmdGameStart, cmdGameEnd, 12 cmdSurrender, cmdNextPlayer );12 cmdSurrender, cmdNextPlayer, cmdParametersChanged); 13 13 TCommandEvent = procedure (Command: TCommand; DataIn, DataOut: TStream); 14 14 … … 24 24 FOnGameStart: TNotifyEvent; 25 25 FOnNextPlayer: TNotifyEvent; 26 FOnParametersChanged: TNotifyEvent; 26 27 FOnTurnStart: TNotifyEvent; 27 28 procedure Receive(Sender: TCommPin; Stream: TListByte); … … 38 39 property OnTurnStart: TNotifyEvent read FOnTurnStart write FOnTurnStart; 39 40 property OnNextPlayer: TNotifyEvent read FOnNextPlayer write FOnNextPlayer; 41 property OnParametersChanged: TNotifyEvent read FOnParametersChanged 42 write FOnParametersChanged; 40 43 end; 41 44 … … 58 61 procedure GameEnd; 59 62 procedure TurnStart; 63 procedure ParametersChanged; 60 64 procedure NextPlayer; 61 65 property OnSendMessage: TSendMessageEvent read FOnSendMessage … … 139 143 end; 140 144 145 procedure TGameProtocolServer.ParametersChanged; 146 begin 147 SendCmd(cmdParametersChanged); 148 end; 149 141 150 procedure TGameProtocolServer.NextPlayer; 142 151 begin … … 167 176 if Command = Integer(cmdNextPlayer) then begin 168 177 if Assigned(FOnNextPlayer) then FOnNextPlayer(Self); 178 end else 179 if Command = Integer(cmdParametersChanged) then begin 180 if Assigned(FOnParametersChanged) then FOnParametersChanged(Self); 169 181 end; 170 182 finally
Note:
See TracChangeset
for help on using the changeset viewer.