unit mTlocation;
interface
uses
extctrls;
type
TFeldInhalt = (Boden, Mauer, TrOnEnter, TrOnUse, TrOnCollision, TrChangeLoc,_);
TFigurenImage =
class(TImage)
private
FX: integer;
FY: integer;
public
{funktionen *********************************}
function GetXWert: integer;
function GetYWert: integer;
{prozeduren *********************************}
procedure SetXWert(value: integer);
procedure SetYWert(value: integer);
end;
TFeld =
class(Tobject)
FigurenImage: TFigurenimage;
private
FFigurenIndex: integer;
FInhalt: TFeldInhalt;
FID:
string;
public
{funktionen *********************************}
function GetFigurenIndex: integer;
function GetInhalt: TFeldInhalt;
function GetID:
string;
{prozeduren *********************************}
procedure SetFigurenIndex(value: integer);
procedure SetInhalt(value: TFeldInhalt);
procedure SetID(value:
string);
end;
TLocation =
class(Tobject)
private
public
Felder:
array[1..20,1..20]
of TFeld;
end;
implementation
function InhaltToStr(I: TFeldInhalt):
string;
begin
case I
of
Boden: result := '
StGrd';
Mauer: result := '
StWal';
TrOnEnter: result := '
TrOnE';
TrOnUse: result := '
TrOnU';
TrOnCollision: result := '
TrOnC';
else
result := '
'
end
end;
{************************************************}
{*************** TFigurenImage ******************}
{************************************************}
procedure TFigurenImage.SetXWert(value: integer);
begin
FX := value;
end;
procedure TFigurenImage.SetYWert(value: integer);
begin
FY := value;
end;
function TFigurenImage.GetXWert: integer;
begin
result := FX;
end;
function TFigurenImage.GetYWert: integer;
begin
result := FY;
end;
{************************************************}
{******************** TFeld *********************}
{************************************************}
procedure TFeld.SetID(value:
string);
begin
FID := value;
end;
procedure TFeld.SetInhalt(value: TFeldInhalt);
begin
FInhalt := value;
end;
procedure TFeld.SetFigurenIndex(value: integer);
begin
FFigurenindex := value;
end;
function TFeld.GetFigurenIndex: integer;
begin
result := FFigurenIndex
end;
function TFeld.GetInhalt: TfeldInhalt;
begin
result := FInhalt;
end;
function TFeld.GetID:
string;
begin
result := FID;
end;
{************************************************}
{****************** TLocation *******************}
{************************************************}
end.