Changeset 211 for trunk/UGameClient.pas


Ignore:
Timestamp:
May 23, 2018, 8:53:58 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Each client form is redrawn by itself, not by Core.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGameClient.pas

    r205 r211  
    2121    FOnChange: TNotifyEvent;
    2222    FOnDestroy: TNotifyEvent;
     23    FOnGameEnd: TNotifyEvent;
    2324    FOnReceive: TCommandEvent;
    2425    FOnMove: TMoveEvent;
     
    3536    procedure ReceiveCmd(Command: TCommand; DataOut, DataIn: TStream); virtual;
    3637    procedure DoTurnStart(Sender: TObject); virtual;
     38    procedure DoGameEnd(Sender: TObject);
    3739  public
    3840    Name: string;
     
    5456    property OnChange: TNotifyEvent read FOnChange write FOnChange;
    5557    property OnTurnStart: TNotifyEvent read FOnTurnStart write FOnTurnStart;
     58    property OnGameEnd: TNotifyEvent read FOnGameEnd write FOnGameEnd;
    5659    property Active: Boolean read FActive write SetActive;
    5760  end;
     
    134137  if Assigned(FOnTurnStart) then
    135138    FOnTurnStart(Self);
     139end;
     140
     141procedure TClient.DoGameEnd(Sender: TObject);
     142begin
     143  if Assigned(FOnGameEnd) then
     144    FOnGameEnd(Self);
    136145end;
    137146
     
    191200  Protocol := TGameProtocolClient.Create;
    192201  Protocol.OnTurnStart := DoTurnStart;
     202  Protocol.OnGameEnd := DoGameEnd;
    193203end;
    194204
Note: See TracChangeset for help on using the changeset viewer.