Changeset 364 for trunk/NoTerm.pas
- Timestamp:
- Apr 12, 2021, 11:55:20 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NoTerm.pas
r352 r364 9 9 10 10 type 11 TRunMode = (rmStop, rmStopped, rmRunning, rmQuit); 12 11 13 TNoTermDlg = class(TDrawDlg) 12 14 QuitBtn: TButtonB; … … 20 22 procedure Client(Command, Player: integer; var Data); 21 23 private 22 me, Active, ToldAlive, Round: integer; 23 LastShowYearTime, LastShowTurnChange, LastNewTurn: TDateTime; 24 TurnTime, TotalStatTime: extended; 24 Me: Integer; 25 Active: Integer; 26 ToldAlive: Integer; 27 Round: Integer; 28 LastShowYearTime: TDateTime; 29 LastShowTurnChange: TDateTime; 30 LastNewTurn: TDateTime; 31 TurnTime: Extended; 32 TotalStatTime: Extended; 25 33 G: TNewGameData; 26 34 Server: TServerCall; 27 35 Shade: TBitmap; 28 36 State: TBitmap; 29 WinStat, ExtStat, AloneStat: array [0 .. nPl - 1] of integer; 30 DisallowShowActive: array [0 .. nPl - 1] of boolean; 31 TimeStat: array [0 .. nPl - 1] of extended; 32 Mode: (Stop, Stopped, Running, Quit); 37 WinStat: array [0 .. nPl - 1] of Integer; 38 ExtStat: array [0 .. nPl - 1] of Integer; 39 AloneStat: array [0 .. nPl - 1] of Integer; 40 DisallowShowActive: array [0 .. nPl - 1] of Boolean; 41 TimeStat: array [0 .. nPl - 1] of Extended; 42 Mode: TRunMode; 33 43 procedure NewStat; 34 44 procedure EndPlaying; … … 92 102 FillChar(TimeStat, SizeOf(TimeStat), 0); 93 103 TotalStatTime := 0; 94 Mode := Stop;104 Mode := rmStop; 95 105 end; 96 106 … … 109 119 EndCommand := sResign 110 120 else 111 EndCommand := sBreak 121 EndCommand := sBreak; 112 122 end 113 123 else … … 171 181 begin 172 182 inc(Round); 173 if Mode = Running then183 if Mode = rmRunning then 174 184 begin 175 185 Invalidate; 176 Update 186 Update; 177 187 end 178 188 else … … 192 202 begin 193 203 LogDlg.List.Clear; 194 if Mode <> Running then204 if Mode <> rmRunning then 195 205 begin 196 206 if LogDlg.Visible then 197 207 LogDlg.Close; 198 208 Close; 199 end 209 end; 200 210 end; 201 211 … … 206 216 begin 207 217 ShowActive(Active, false); 208 Active := -1 218 Active := -1; 209 219 end; // should not happen 210 220 … … 229 239 end; 230 240 Application.ProcessMessages; 231 if Mode = Quit then241 if Mode = rmQuit then 232 242 EndPlaying 233 243 else if G.RO[me].Happened and phGameEnd <> 0 then … … 248 258 inc(WinStat[p]); 249 259 end; 250 if Mode = Running then251 Server(sNextRound, me, 0, nil^) 260 if Mode = rmRunning then 261 Server(sNextRound, me, 0, nil^); 252 262 end 253 else if Mode = Running then263 else if Mode = rmRunning then 254 264 Server(sTurn, me, 0, nil^); 255 if Mode = Stop then265 if Mode = rmStop then 256 266 begin 257 267 GoBtn.ButtonIndex := 22; 258 Mode := Stopped;268 Mode := rmStopped; 259 269 end; 260 270 end; … … 284 294 procedure TNoTermDlg.GoBtnClick(Sender: TObject); 285 295 begin 286 if Mode = Running then287 Mode := Stop288 else if Mode = Stopped then296 if Mode = rmRunning then 297 Mode := rmStop 298 else if Mode = rmStopped then 289 299 begin 290 Mode := Running;300 Mode := rmRunning; 291 301 GoBtn.ButtonIndex := 23; 292 302 GoBtn.Update; … … 297 307 procedure TNoTermDlg.QuitBtnClick(Sender: TObject); 298 308 begin 299 if Mode = Stopped then 300 EndPlaying 301 else 302 Mode := Quit; 309 if Mode = rmStopped then EndPlaying 310 else Mode := rmQuit; 303 311 end; 304 312 … … 362 370 end; 363 371 364 procedure Client ;372 procedure Client(Command, Player: integer; var Data); 365 373 begin 366 374 if not FormsCreated then … … 384 392 initialization 385 393 386 FormsCreated := false;394 FormsCreated := False; 387 395 388 396 end.
Note:
See TracChangeset
for help on using the changeset viewer.