Entity.h
T * CreateChild()
Allocates an Entity and Attaches it for you.
Definition: Entity.h:176
T * IdentifyAs() const
Same as Find, but casts it to the type you care about.
Definition: Entity.h:111
void SetName(const std::string &name)
Sets an optional name to further identify the entity. Tools such as the debugger. ...
void RemoveComponent(const std::string &tag)
Removes the first occurrance of a component with the tag given.
virtual void OnPreDraw()
Called when Draw() is called.
Definition: Entity.h:486
bool draw
Whether the engine should call Draw() automatically for this entity. Note that Draw() calls also mana...
Definition: Entity.h:314
T * AddComponent(UpdateClass when=UpdateClass::Before)
Attaches a component to this entity.
Definition: Entity.h:363
std::vector< Entity::ID > GetAllSubEntities() const
Returns all Entities that are within this Entity's hierarchy.
void SetPriorityFirst()
Sends the entity to be drawn and updated as the last in the queue causing it to be on top when drawin...
virtual void OnEnter()
The Entry function is called upon each attachment to a world.
Definition: Entity.h:461
T * QueryComponent()
Returns whether or not there is currently an attached component of the type given.
Definition: Entity.h:555
Before Entity base logic is run.
const std::vector< Entity::ID > & GetChildren() const
Returns the i'th Entity starting at 0.
static T * CreateReference()
Creates a new Entity of the given type.
Definition: Entity.h:199
static Entity::ID Create()
Creates a new Entity of no type and returns its ID.
Definition: Entity.h:192
Definition: AssetID.h:37
T * Query()
Convenience function for .Identify()->QueryComponent()
Definition: Entity.h:98
Variable GetWatched(const std::string &name)
Returns a watched Variable of the given name.
uint64_t Value() const
Returns a value that unique ientifies the Entity.
Definition: Entity.h:84
virtual void OnRemove()
The Destruct function is called just before removal of the object.
Definition: Entity.h:472
bool IsDrawing()
Returns wether or not the Engine is handling calling Draw() automatically, taking into account the En...
double DrawDuration()
Returns the last recorded amount of milliseconds it took the Entity, iedentified by id...
std::vector< Variable > GetWatchedVars()
Returns all watched variables associated with this Entity.
virtual void OnPreStep()
Called when Step() is called.
Definition: Entity.h:477
double StepDuration()
Returns the last recorded amount of milliseconds it took the Entity, iedentified by id...
void SetPriorityLast()
Sends the entity of the ID to be the last of in line for drawing and updates.
static std::vector< Entity::ID > GetAll()
Returns a list of all Entitys. Note that this list is generated every time.
bool IsStepping()
Returns wether or not the Engine is handling calling Step() automatically, taking into account the En...
const std::vector< Component * > & GetComponents() const
Returns all components that belong to the Entity.
void Attach(Entity::ID)
Binds an entity to the World. If bound, an Entity will be updated when the World is updated...
virtual void OnDepart()
The Depart function is called upon each detachment from a world.
Definition: Entity.h:465
std::vector< Entity::ID > FindChildByName(const std::string &)
Returns all bound Entities with the name equivalent to the one given within this Entity's hierarchy...
void Unwatch(const std::string &varName)
Stops watching a variable of the given name.
void Remove()
Detaches and marks this entity for deletion. After this is called, all references to...
Class that extends the functionality of an Entity, but as a removable and addable object...
Definition: Component.h:66
After Entity base logic is run.
bool step
Whether the engine should call Step() automatically for this entity. Note that Step() calls also mana...
Definition: Entity.h:308
static Entity::ID Create()
Creates a new Entity and returns its ID.
Definition: Entity.h:185