Gib dem Pfeil einen Parent mit:
Delphi-Quellcode:
type TPfeil = class
private
FParent: TOberesObjekt;
public
constructor Create(Parent: TOberesObjekt);
procedure doAnything;
end;
type TTextur = class
procedure getSomething;
end;
type TOberesObjekt = class
public
constructor Create;
Textur: TTextur;
Pfeil: TPfeil;
end;
implementation
constructor TOberesObjekt.Create;
begin
Pfeil := TPfeil.Create(Self);
Textur := TTextur.Create;
end;
procedure TPfeil.doAnything;
begin
FParent.Textur.getSomething;
end;