unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 =
class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
TReason =
record
Targetx, targety, points: integer;
why:(aways, attacks);
end;
TFigurtyp =(K,D,S,L,T,B,E);
TPlayercolor =(clwhite,clblack);
TFigur =
class(Tobject)
private
Fx: integer;
Fcolor: TPlayercolor;
Falive: boolean;
FAengste: integer;
Fy: integer;
Fvalue: integer;
Fkind: TFigurtyp;
procedure Setx(
const Value: integer);
procedure SetAengste(
const Value: integer);
procedure Setalive(
const Value: boolean);
procedure Setcolor(
const Value: TPlayercolor);
procedure Setkind(
const Value: TFigurtyp);
procedure Setvalue(
const Value: integer);
procedure Sety(
const Value: integer);
private
public
TReasons:
record
Targetx, targety, points: integer;
why:(away, attack);
end;
property color: TPlayercolor
read Fcolor
write Setcolor;
property x: integer
read Fx
write Setx;
property y:integer
read Fy
write Sety;
property kind: TFigurtyp
read Fkind
write Setkind;
property alive:boolean
read Falive
write Setalive;
property Aengste: integer
read FAengste
write SetAengste;
property value: integer
read Fvalue
write Setvalue;
constructor create(aowner: tobject);
//override;
end;
var
Form1: TForm1;
Figuren:
Array[0..64]
of TFigur;
implementation
{$R *.DFM}
{ TFigur }
constructor TFigur.create(Aowner: Tobject);
begin
inherited create
{(Aowner)};
end;
procedure TFigur.SetAengste(
const Value: integer);
begin
FAengste := Value;
end;
procedure TFigur.Setalive(
const Value: boolean);
begin
Falive := Value;
end;
procedure TFigur.Setcolor(
const Value: Tplayercolor);
begin
Fcolor := Value;
end;
procedure TFigur.Setkind(
const Value: TFigurtyp);
begin
Fkind := Value;
end;
procedure TFigur.Setvalue(
const Value: integer);
begin
Fvalue := Value;
end;
procedure TFigur.Setx(
const Value: integer);
begin
Fx := Value;
end;
procedure TFigur.Sety(
const Value: integer);
begin
Fy := Value;
end;
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;
begin
for i:=0
to 31
do figuren[i].create(form1);
showmessage(inttostr(i));
end;
end.