source: tags/1.0.0/Forms/UFormNew.pas

Last change on this file was 20, checked in by chronos, 5 years ago
  • Added: Player can undo last move.
  • Modified: Optimized code of TGame.CanMove method.
File size: 862 bytes
Line 
1unit UFormNew;
2
3{$mode delphi}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9 UGame;
10
11type
12
13 { TFormNew }
14
15 TFormNew = class(TForm)
16 ButtonCancel: TButton;
17 ButtonOk: TButton;
18 ComboBoxSize: TComboBox;
19 Label1: TLabel;
20 procedure FormCreate(Sender: TObject);
21 private
22
23 public
24 procedure Load(Game: TGame);
25 procedure Save(Game: TGame);
26 end;
27
28var
29 FormNew: TFormNew;
30
31implementation
32
33{$R *.lfm}
34
35uses
36 UCore;
37
38{ TFormNew }
39
40procedure TFormNew.FormCreate(Sender: TObject);
41begin
42 Core.Translator1.TranslateComponentRecursive(Self);
43end;
44
45procedure TFormNew.Load(Game: TGame);
46begin
47 ComboBoxSize.ItemIndex := Game.Board.Size.X - 2;
48end;
49
50procedure TFormNew.Save(Game: TGame);
51begin
52 Game.Board.Size := Point(2 + ComboBoxSize.ItemIndex, 2 + ComboBoxSize.ItemIndex);
53end;
54
55end.
56
Note: See TracBrowser for help on using the repository browser.