You've already forked lazarus-ccr
fpchess: Improves the mode description
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1880 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -17,7 +17,8 @@ type
|
|||||||
TChessModule = class
|
TChessModule = class
|
||||||
public
|
public
|
||||||
Kind: TChessModuleKind;
|
Kind: TChessModuleKind;
|
||||||
Description: string;
|
Name, SelectionDescription, PlayingDescription: string;
|
||||||
|
constructor Create; virtual;
|
||||||
procedure CreateUserInterface(); virtual; abstract;
|
procedure CreateUserInterface(); virtual; abstract;
|
||||||
procedure ShowUserInterface(AParent: TWinControl); virtual; abstract;
|
procedure ShowUserInterface(AParent: TWinControl); virtual; abstract;
|
||||||
procedure HideUserInterface(); virtual; abstract;
|
procedure HideUserInterface(); virtual; abstract;
|
||||||
@ -71,7 +72,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
lModule := TChessModule(gChessModules.Items[i]);
|
lModule := TChessModule(gChessModules.Items[i]);
|
||||||
if lModule <> nil then
|
if lModule <> nil then
|
||||||
AList.Add(lModule.Description);
|
AList.Add(lModule.SelectionDescription);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -94,6 +95,11 @@ end;
|
|||||||
|
|
||||||
{ TChessModule }
|
{ TChessModule }
|
||||||
|
|
||||||
|
constructor TChessModule.Create;
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TChessModule.IsMovingAllowedNow: Boolean;
|
function TChessModule.IsMovingAllowedNow: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := not (vChessGame.IsWhitePlayerTurn xor vChessGame.FirstPlayerIsWhite);
|
Result := not (vChessGame.IsWhitePlayerTurn xor vChessGame.FirstPlayerIsWhite);
|
||||||
|
@ -140,7 +140,7 @@ type
|
|||||||
function FPChessPieceToKCChessImage(APos: TPoint): PieceImageType;
|
function FPChessPieceToKCChessImage(APos: TPoint): PieceImageType;
|
||||||
function FPChessPieceToKCChessColor(APos: TPoint): PieceColorType;
|
function FPChessPieceToKCChessColor(APos: TPoint): PieceColorType;
|
||||||
public
|
public
|
||||||
constructor Create();
|
constructor Create(); override;
|
||||||
procedure CreateUserInterface(); override;
|
procedure CreateUserInterface(); override;
|
||||||
procedure ShowUserInterface(AParent: TWinControl); override;
|
procedure ShowUserInterface(AParent: TWinControl); override;
|
||||||
procedure HideUserInterface(); override;
|
procedure HideUserInterface(); override;
|
||||||
@ -217,7 +217,9 @@ constructor TKCChessModule.Create;
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
Description := 'Play against the computer - KCChess Engine';
|
Name := 'mod_kcchess.pas';
|
||||||
|
SelectionDescription := 'Play against the computer - KCChess Engine';
|
||||||
|
PlayingDescription := 'Playing against the computer - KCChess Engine';
|
||||||
Kind := cmkAgainstComputer;
|
Kind := cmkAgainstComputer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ object formChess: TformChess
|
|||||||
Top = 123
|
Top = 123
|
||||||
Width = 360
|
Width = 360
|
||||||
ActiveControl = notebookMain
|
ActiveControl = notebookMain
|
||||||
Caption = 'FP Chess 0.1'
|
Caption = 'FP Chess 1.0'
|
||||||
ClientHeight = 500
|
ClientHeight = 500
|
||||||
ClientWidth = 360
|
ClientWidth = 360
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
@ -28,7 +28,7 @@ object formChess: TformChess
|
|||||||
Width = 360
|
Width = 360
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
Caption = 'Welcome to FP Chess 0.1'
|
Caption = 'Welcome to FP Chess 1.0'
|
||||||
Font.Height = -19
|
Font.Height = -19
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
@ -174,7 +174,7 @@ object formChess: TformChess
|
|||||||
object labelPos: TLabel
|
object labelPos: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 18
|
Height = 18
|
||||||
Top = 392
|
Top = 376
|
||||||
Width = 54
|
Width = 54
|
||||||
Caption = 'labelPos'
|
Caption = 'labelPos'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
@ -206,7 +206,7 @@ object formChess: TformChess
|
|||||||
Left = 176
|
Left = 176
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 75
|
Width = 88
|
||||||
Caption = 'Resign'
|
Caption = 'Resign'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
@ -223,15 +223,23 @@ object formChess: TformChess
|
|||||||
Left = 80
|
Left = 80
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 75
|
Width = 88
|
||||||
Caption = 'New Game'
|
Caption = 'New Game'
|
||||||
OnClick = btnGameNewGameClick
|
OnClick = btnGameNewGameClick
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
|
object labelMode: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 18
|
||||||
|
Top = 392
|
||||||
|
Width = 66
|
||||||
|
Caption = 'labelMode'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object pageWebservice: TPage
|
object pageWebservice: TPage
|
||||||
ClientWidth = 2880
|
ClientWidth = 5760
|
||||||
ClientHeight = 3464
|
ClientHeight = 6928
|
||||||
object Label8: TLabel
|
object Label8: TLabel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 32
|
Height = 32
|
||||||
|
@ -39,6 +39,7 @@ type
|
|||||||
editLocalIP: TLabeledEdit;
|
editLocalIP: TLabeledEdit;
|
||||||
editWebserviceURL: TLabeledEdit;
|
editWebserviceURL: TLabeledEdit;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
|
labelMode: TLabel;
|
||||||
labelTime: TLabel;
|
labelTime: TLabel;
|
||||||
Label2: TLabel;
|
Label2: TLabel;
|
||||||
Label6: TLabel;
|
Label6: TLabel;
|
||||||
@ -158,6 +159,10 @@ begin
|
|||||||
[FormatTime(vChessGame.WhitePlayerTime), FormatTime(vChessGame.BlackPlayerTime)]);
|
[FormatTime(vChessGame.WhitePlayerTime), FormatTime(vChessGame.BlackPlayerTime)]);
|
||||||
|
|
||||||
formChess.labelTime.Caption := lStr;
|
formChess.labelTime.Caption := lStr;
|
||||||
|
|
||||||
|
lStr := GetChessModule(gSelectedModuleIndex).PlayingDescription;
|
||||||
|
|
||||||
|
formChess.labelMode.Caption := lStr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TformChess.InitializeGameModel;
|
procedure TformChess.InitializeGameModel;
|
||||||
|
@ -33,7 +33,7 @@ type
|
|||||||
FICS_PASSWORD: string;
|
FICS_PASSWORD: string;
|
||||||
// Frequency to issue commands to avoid disconnection, in miliseconds
|
// Frequency to issue commands to avoid disconnection, in miliseconds
|
||||||
PROTECT_LOGOUT_FREQ: Integer;
|
PROTECT_LOGOUT_FREQ: Integer;
|
||||||
constructor Create();
|
constructor Create(); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure CreateUserInterface(); override;
|
procedure CreateUserInterface(); override;
|
||||||
procedure ShowUserInterface(AParent: TWinControl); override;
|
procedure ShowUserInterface(AParent: TWinControl); override;
|
||||||
@ -59,7 +59,9 @@ begin
|
|||||||
Errmode => 'die',
|
Errmode => 'die',
|
||||||
);*)
|
);*)
|
||||||
|
|
||||||
Description := 'Play online via the Free Internet Chess Server';
|
Name := 'mod_fics.pas';
|
||||||
|
SelectionDescription := 'Play online - Free Internet Chess Server';
|
||||||
|
PlayingDescription := 'Playing online - Free Internet Chess Server';
|
||||||
Kind := cmkInternet;
|
Kind := cmkInternet;
|
||||||
|
|
||||||
FICS_HOST := 'freechess.org';
|
FICS_HOST := 'freechess.org';
|
||||||
|
@ -19,7 +19,7 @@ type
|
|||||||
editSecondPlayerName: TEdit;
|
editSecondPlayerName: TEdit;
|
||||||
public
|
public
|
||||||
SecondPlayerName: string;
|
SecondPlayerName: string;
|
||||||
constructor Create();
|
constructor Create(); override;
|
||||||
procedure CreateUserInterface(); override;
|
procedure CreateUserInterface(); override;
|
||||||
procedure ShowUserInterface(AParent: TWinControl); override;
|
procedure ShowUserInterface(AParent: TWinControl); override;
|
||||||
procedure HideUserInterface(); override;
|
procedure HideUserInterface(); override;
|
||||||
@ -38,7 +38,9 @@ constructor TSameComputerChessModule.Create;
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
Description := 'Play against a friend in the same computer';
|
Name := 'mod_samecomputer.pas';
|
||||||
|
SelectionDescription := 'Play against a friend in the same computer';
|
||||||
|
PlayingDescription := 'Playing against a friend in the same computer';
|
||||||
Kind := cmkSameComputer;
|
Kind := cmkSameComputer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user