procedure TFeld.set_koo(x,y : integer);
begin
fx_koo :=x;
fy_koo :=y;
end;
procedure TFeld.set_wand(o,u,r,l : boolean);
begin
o_wand := o;
u_wand := u;
r_wand := r;
l_wand := l;
end;
procedure TMensch.set_koo(x,y : integer);
begin
fx_koo :=x;
fy_koo :=y;
end;
procedure TMensch.set_IP(
IP : integer);
begin
IP_private :=
IP;
end;
function generiere_karte(x_Laenge,y_Laenge : integer):TMap;
var i,k,i2,k2 : integer;
begin
i2:=0;
k2:=0;
SetLength(Result,x_Laenge,y_Laenge);
for i:=0
to x_laenge-1
do
begin
for k:=0
to y_Laenge-1
do
begin
Result[i,k]:=TFeld.Create;
with Result[i,k]
do
begin
fx_koo:=i2;
fy_koo:=k2;
set_wand(False,False,False,False);
schatz:=False;
(* if i=0 then o_wand:=true;
if i=x_laenge-1 then u_wand:=true;
if k=0 then l_wand := true;
if k=y_laenge-1 then r_wand:= true; *)
end;
inc(k2);
end;
inc(i2);
end;
end;
function generiere_mensch(
IP,x,y: integer):TMensch;
begin
Result.Create;
Result.IP_private :=
IP;
Result.set_koo(x,y);
Result.anzahl_bewegen := 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
x:=20;
y:=20;
Map:=generiere_karte(10,10);
Mensch1:=generiere_mensch(1,1,1);
PaintBox1.Color:=clWhite;
Paintbox1.Canvas.Rectangle(x,y,x+20,y+20);
end;