Thema
:
Delphi
Zirkuläre Referenz von zwei Klassen vermeiden
Einzelnen Beitrag anzeigen
Chaosente
Registriert seit: 20. Aug 2006
80 Beiträge
#
6
Re: Zirkuläre Referenz von zwei Klassen vermeiden
4. Jul 2007, 17:57
Hier:
zusammenfalten
·
markieren
Delphi-Quellcode:
type
TIDShape =
class
;
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
;
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
;
Zitat
Chaosente
Öffentliches Profil ansehen
Mehr Beiträge von Chaosente finden