Also cih hab zwei klassen, und jede braucht die andere für sich selbst:
Klasse 1:
Delphi-Quellcode:
type
TKKPlayer = class
private
FName: string;
FColor: TColor;
FID: integer;
FScore: integer;
FHandleList: array of TIDShape;
FHeartBeat: TTimer;
FAI: boolean;
procedure OnHeartBeat(Sender: TObject);
public
constructor Create(name: string; Color: TColor; ID: integer; AI: boolean);
property PlayerName: string read FName write FName;
property PlayerColor: TColor read FColor write FColor;
Property PlayerID: integer read FID write FID;
property PlayerScore: integer read FScore write FScore;
property Heartbeat: TTimer read FHeartbeat write FHeartbeat;
property AI: boolean read FAI write FAI;
procedure AddToHandle(a:TIDShape);
end;
Klasse 2:
Delphi-Quellcode:
type
TIDShape = class(TShape)
private
FYID: integer;
FXID: integer;
FOwned: boolean;
FOwnedBy: TKKPlayer;
FValue: integer;
public
property YID: integer read FYID write FYID;
property XID: integer read FXID write FXID;
property Owned: boolean read FOwned write FOwned;
property OwnedBy: TKKPlayer read FOwnedby write FOwnedBy;
property Value: integer read FValue write FValue;
end;
Ich hab nur leider keine ahnung wie ich es so arangieren kann, dass ich es nciht zirkulär aufbaue... hat jemand ne ahnung wie ich das machen kann?