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 | |
---|
1 | unit UFormNew;
|
---|
2 |
|
---|
3 | {$mode delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
9 | UGame;
|
---|
10 |
|
---|
11 | type
|
---|
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 |
|
---|
28 | var
|
---|
29 | FormNew: TFormNew;
|
---|
30 |
|
---|
31 | implementation
|
---|
32 |
|
---|
33 | {$R *.lfm}
|
---|
34 |
|
---|
35 | uses
|
---|
36 | UCore;
|
---|
37 |
|
---|
38 | { TFormNew }
|
---|
39 |
|
---|
40 | procedure TFormNew.FormCreate(Sender: TObject);
|
---|
41 | begin
|
---|
42 | Core.Translator1.TranslateComponentRecursive(Self);
|
---|
43 | end;
|
---|
44 |
|
---|
45 | procedure TFormNew.Load(Game: TGame);
|
---|
46 | begin
|
---|
47 | ComboBoxSize.ItemIndex := Game.Board.Size.X - 2;
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TFormNew.Save(Game: TGame);
|
---|
51 | begin
|
---|
52 | Game.Board.Size := Point(2 + ComboBoxSize.ItemIndex, 2 + ComboBoxSize.ItemIndex);
|
---|
53 | end;
|
---|
54 |
|
---|
55 | end.
|
---|
56 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.