Line | |
---|
1 | unit UFormPlayer;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
---|
7 | UGame;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormPlayer }
|
---|
12 |
|
---|
13 | TFormPlayer = class(TForm)
|
---|
14 | ButtonCancel: TButton;
|
---|
15 | ButtonOk: TButton;
|
---|
16 | ColorBox1: TColorBox;
|
---|
17 | ComboBox1: TComboBox;
|
---|
18 | EditName: TEdit;
|
---|
19 | Label1: TLabel;
|
---|
20 | Label2: TLabel;
|
---|
21 | Label3: TLabel;
|
---|
22 | private
|
---|
23 | { private declarations }
|
---|
24 | public
|
---|
25 | procedure Load(Player: TPlayer);
|
---|
26 | procedure Save(Player: TPlayer);
|
---|
27 | end;
|
---|
28 |
|
---|
29 | var
|
---|
30 | FormPlayer: TFormPlayer;
|
---|
31 |
|
---|
32 | implementation
|
---|
33 |
|
---|
34 | {$R *.dfm}
|
---|
35 |
|
---|
36 | { TFormPlayer }
|
---|
37 |
|
---|
38 | procedure TFormPlayer.Load(Player: TPlayer);
|
---|
39 | begin
|
---|
40 | EditName.Text := Player.Name;
|
---|
41 | ComboBox1.ItemIndex := Integer(Player.Mode);
|
---|
42 | ColorBox1.Selected := Player.Color;
|
---|
43 | end;
|
---|
44 |
|
---|
45 | procedure TFormPlayer.Save(Player: TPlayer);
|
---|
46 | begin
|
---|
47 | Player.Name := EditName.Text;
|
---|
48 | Player.Mode := TPlayerMode(ComboBox1.ItemIndex);
|
---|
49 | Player.Color := ColorBox1.Selected;
|
---|
50 | end;
|
---|
51 |
|
---|
52 | end.
|
---|
53 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.