Changeset 202 for trunk/Forms


Ignore:
Timestamp:
May 17, 2018, 5:41:47 PM (7 years ago)
Author:
chronos
Message:
  • Modified: AI player related code moved to UClientAI unit. It is now extension of TClient class to simulate regular human client.
  • Modified: More work on client-server architecture.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r180 r202  
    1313  OnKeyUp = FormKeyUp
    1414  OnShow = FormShow
    15   LCLVersion = '1.8.0.6'
     15  LCLVersion = '1.8.2.0'
    1616  WindowState = wsMaximized
    1717  object StatusBar1: TStatusBar
     
    4848      Left = 1
    4949      Top = 2
    50       Action = Core.AGameEndTurn
     50      Action = AGameEndTurn
    5151    end
    5252    object ToolButton6: TToolButton
     
    128128      OnExecute = AStatusBarVisibleExecute
    129129    end
     130    object AGameEndTurn: TAction
     131      Caption = 'End turn'
     132      ImageIndex = 0
     133      OnExecute = AGameEndTurnExecute
     134    end
    130135  end
    131136  object PopupMenuToolbar: TPopupMenu
  • trunk/Forms/UFormClient.pas

    r185 r202  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM,
    10   UGeometry, UGameClient;
     9  UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, UCommPin,
     10  UGeometry, UGameClient, UGameProtocol;
    1111
    1212const
     
    1919
    2020  TFormClient = class(TForm)
     21    AGameEndTurn: TAction;
    2122    AStatusBarVisible: TAction;
    2223    AToolBarVisible: TAction;
     
    3738    ToolButton8: TToolButton;
    3839    ToolButton9: TToolButton;
     40    procedure AGameEndTurnExecute(Sender: TObject);
    3941    procedure AStatusBarVisibleExecute(Sender: TObject);
    4042    procedure AToolBarBigIconsExecute(Sender: TObject);
     
    196198    Caption := NewCaption;
    197199    Drawing := False;
     200    AGameEndTurn.Enabled := Core.Game.Running;
    198201  end;
    199202end;
     
    299302  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
    300303  ReloadView;
     304end;
     305
     306procedure TFormClient.AGameEndTurnExecute(Sender: TObject);
     307var
     308  P: TGameProtocolClient;
     309  P2: TCommPin;
     310begin
     311  P := Client.Protocol;
     312  P2 := P.Pin;
     313  Client.Protocol.TurnEnd;
    301314end;
    302315
Note: See TracChangeset for help on using the changeset viewer.