// part of uber 3
object(TBaseEntity)
private
FEng: TEngine;
FId: LongInt; // for safe ptr (see TEntityPtr)
FParent: PEntity; // parent entity
FSubFirst, FSubLast: PEntity; // first and last sub-entity
FPrev, FNext: PEntity; // prev and next entity on the same level
FNextFree: PEntity; // for fast allocations
public
constructor Init;
destructor Done; virtual;
// events
procedure Update;
procedure Kill;
// hierarchy
procedure SetParent(NewParent: PEntity);
procedure AddSub(Entity: PEntity);
// order
procedure BringToTop;
procedure SendToBack;
//procedure MoveBefore(Entity: PEntity);
//procedure MoveAfter(Entity: PEntity);
// Iterating
procedure RenderSubObjects; virtual;
procedure ForEach(Action: TForEachProc); overload;
procedure ForEach(Action: TForEachProcObj); overload;
function ForEach(Action: TForEachFunc): Boolean; overload;
function ForEach(Action: TForEachFuncObj): Boolean; overload;
procedure ForEachInverted(Action: TForEachProc); overload;
procedure ForEachInverted(Action: TForEachProcObj); overload;
function ForEachInverted(Action: TForEachFunc): Boolean; overload;
function ForEachInverted(Action: TForEachFuncObj): Boolean; overload;
// Base properties
property Eng: TEngine read FEng;
property Id: LongInt read FId;
property Parent: PEntity read FParent;
property SubFirst: PEntity read FSubFirst;
property SubLast: PEntity read FSubLast;
property Next: PEntity read FNext {needed for dpool} write FNext;
property Prev: PEntity read FPrev;
public
