Changeset 183 for trunk/UGame.pas
- Timestamp:
- Feb 9, 2018, 10:33:18 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r180 r183 415 415 end; 416 416 417 TMoveEvent = procedure(CellFrom, CellTo: TCell; var CountOnce, CountRepeat: Integer; 418 Update: Boolean; var Confirm: Boolean) of object; 419 417 420 { TClient } 418 421 419 422 TClient = class 420 423 private 424 FForm: TForm; 421 425 FGame: TGame; 422 426 FControlPlayer: TPlayer; 423 427 FOnChange: TNotifyEvent; 424 428 FOnReceive: TReceiveEvent; 429 FOnMove: TMoveEvent; 425 430 procedure SetControlPlayer(AValue: TPlayer); 431 procedure SetForm(AValue: TForm); 426 432 procedure SetGame(AValue: TGame); 427 433 procedure DoChange; 428 434 public 429 Form: TForm;430 435 Name: string; 431 436 View: TView; … … 436 441 property ControlPlayer: TPlayer read FControlPlayer write SetControlPlayer; 437 442 property Game: TGame read FGame write SetGame; 443 property Form: TForm read FForm write SetForm; 444 property OnMove: TMoveEvent read FOnMove write FOnMove; 438 445 property OnReceive: TReceiveEvent read FOnReceive write FOnReceive; 439 446 property OnChange: TNotifyEvent read FOnChange write FOnChange; … … 450 457 { TGame } 451 458 452 TMoveEvent = procedure(CellFrom, CellTo: TCell; var CountOnce, CountRepeat: Integer;453 Update: Boolean; var Confirm: Boolean) of object;454 459 TMoveUpdatedEvent = procedure(UnitMove: TUnitMove) of object; 455 460 … … 464 469 private 465 470 FMapType: TMapType; 466 FOnMove: TMoveEvent;467 471 FOnMoveUpdated: TMoveUpdatedEvent; 468 472 FOnNewTurn: TNotifyEvent; … … 519 523 property MapType: TMapType read FMapType write SetMapType; 520 524 published 521 property OnMove: TMoveEvent read FOnMove write FOnMove;522 525 property OnMoveUpdated: TMoveUpdatedEvent read FOnMoveUpdated write FOnMoveUpdated; 523 526 property OnWin: TWinEvent read FOnWin write FOnWin; … … 697 700 if Assigned(FControlPlayer) then 698 701 FControlPlayer.FClient := Self; 702 end; 703 704 procedure TClient.SetForm(AValue: TForm); 705 begin 706 if FForm = AValue then Exit; 707 FForm := AValue; 699 708 end; 700 709 … … 2921 2930 CountRepeat := Result.CountRepeat; 2922 2931 if (Mode = pmHuman) and Confirmation and 2923 Assigned(Game.FOnMove) then Game.FOnMove(CellFrom, CellTo, CountOnce, CountRepeat, True, Confirm); 2932 Assigned(Client) and Assigned(Client.FOnMove) then 2933 Client.FOnMove(CellFrom, CellTo, CountOnce, CountRepeat, True, Confirm); 2924 2934 end else begin 2925 2935 CountOnce := Power; 2926 2936 CountRepeat := 0; 2927 2937 if (Mode = pmHuman) and Confirmation and 2928 Assigned(Game.FOnMove) then Game.FOnMove(CellFrom, CellTo, CountOnce, CountRepeat, False, Confirm); 2938 Assigned(Client) and Assigned(Client.FOnMove) then 2939 Client.FOnMove(CellFrom, CellTo, CountOnce, CountRepeat, False, Confirm); 2929 2940 end; 2930 2941 if Confirm then begin
Note:
See TracChangeset
for help on using the changeset viewer.