Public Member Functions | |
Entity (const std::string &name, Entity *parent=NULL) | |
Constructor. | |
~Entity () | |
Deconstructor. | |
void | refAdd () |
Increases the reference counter. | |
void | refRelease () |
Decreases the reference counter. | |
u32 | getID () const |
Gets the ID of this entity. | |
const std::string & | getName () const |
Gets the name of this entity. | |
bool | addComponent (EntityComponent *component) |
Adds a component to the entity. | |
Entity * | getChild (const u32 id) |
Gets the child with the given ID from this entity. | |
Entity * | getChild (const std::string &name) |
Gets the child with the given name from this entity. | |
EntityComponent * | getComponent (const u32 id) |
Gets the component with the given ID from this entity. | |
EntityComponent * | getComponent (const std::string &name) |
Gets the component with the given name from this entity. | |
Entity * | getParent () const |
Gets the parent of this entity. | |
const vector3df & | getPosition () const |
Gets the position of the entity. | |
void | removeAllChildren () |
Removes all children. | |
void | removeAllComponents () |
Removes all components. | |
bool | removeChild (Entity *entity) |
Removes the given child. | |
bool | removeChild (const u32 id) |
Removes the child with the given ID. | |
bool | removeChild (const std::string &name) |
Removes the child with the given name. | |
bool | removeComponent (EntityComponent *component) |
Removes the given component. | |
bool | removeComponent (const u32 id) |
Removes the component with the given ID. | |
bool | removeComponent (const std::string &name) |
Removes the component with the given name. | |
void | setPosition (const vector3df &position) |
Sets the position of the entity. | |
void | onPositionChange (void *p) |
Updates the position of the entity after its parent has been updated. | |
void | onUpdate (void *p) |
Updates the entity if the parent is updated. | |
void | onRender (void *p) |
Renders the entity if the parent is rendered. | |
void | onPause (void *p) |
Pauses the entity if the parent is paused. | |
void | onUnPause (void *p) |
Updates the entity if the parent is unpaused. | |
Static Public Member Functions | |
static Entity * | refFactory (const std::string &name) |
Will be used to instanciate objects of this class. |
Definition at line 29 of file Entity.h.
Entity::Entity | ( | const std::string & | name, | |
Entity * | parent = NULL | |||
) |
Constructor.
name | Name of the entity. | |
parent | Parent of the entity. |
Definition at line 26 of file Entity.cpp.
Entity::~Entity | ( | ) |
bool Entity::addComponent | ( | EntityComponent * | component | ) |
Adds a component to the entity.
component | Pointer to the component to add. |
Definition at line 138 of file Entity.cpp.
Entity * Entity::getChild | ( | const std::string & | name | ) |
Gets the child with the given name from this entity.
Definition at line 167 of file Entity.cpp.
Entity * Entity::getChild | ( | const u32 | id | ) |
Gets the child with the given ID from this entity.
Definition at line 155 of file Entity.cpp.
EntityComponent * Entity::getComponent | ( | const std::string & | name | ) |
Gets the component with the given name from this entity.
Definition at line 191 of file Entity.cpp.
EntityComponent * Entity::getComponent | ( | const u32 | id | ) |
Gets the component with the given ID from this entity.
Definition at line 179 of file Entity.cpp.
u32 Entity::getID | ( | ) | const |
const std::string & Entity::getName | ( | ) | const |
Entity * Entity::getParent | ( | ) | const |
Gets the parent of this entity.
Definition at line 203 of file Entity.cpp.
const vector3df & Entity::getPosition | ( | ) | const |
void Entity::onPause | ( | void * | p | ) |
Pauses the entity if the parent is paused.
Definition at line 417 of file Entity.cpp.
void Entity::onPositionChange | ( | void * | p | ) |
Updates the position of the entity after its parent has been updated.
Definition at line 396 of file Entity.cpp.
void Entity::onRender | ( | void * | p | ) |
Renders the entity if the parent is rendered.
Definition at line 410 of file Entity.cpp.
void Entity::onUnPause | ( | void * | p | ) |
Updates the entity if the parent is unpaused.
Definition at line 424 of file Entity.cpp.
void Entity::onUpdate | ( | void * | p | ) |
Updates the entity if the parent is updated.
Definition at line 403 of file Entity.cpp.
void Entity::refAdd | ( | ) |
Increases the reference counter.
Definition at line 84 of file Entity.cpp.
Entity * Entity::refFactory | ( | const std::string & | name | ) | [static] |
Will be used to instanciate objects of this class.
Definition at line 78 of file Entity.cpp.
void Entity::refRelease | ( | ) |
Decreases the reference counter.
Definition at line 90 of file Entity.cpp.
void Entity::removeAllChildren | ( | ) |
void Entity::removeAllComponents | ( | ) |
bool Entity::removeChild | ( | const std::string & | name | ) |
Removes the child with the given name.
name | Name of the child to remove. |
Definition at line 288 of file Entity.cpp.
bool Entity::removeChild | ( | const u32 | id | ) |
Removes the child with the given ID.
id | ID of the child to remove. |
Definition at line 264 of file Entity.cpp.
bool Entity::removeChild | ( | Entity * | entity | ) |
Removes the given child.
entity | Pointer to the child to remove. |
Definition at line 236 of file Entity.cpp.
bool Entity::removeComponent | ( | const std::string & | name | ) |
Removes the component with the given name.
name | Name of the component to remove. |
Definition at line 360 of file Entity.cpp.
bool Entity::removeComponent | ( | const u32 | id | ) |
Removes the component with the given ID.
id | ID of the component to remove. |
Definition at line 338 of file Entity.cpp.
bool Entity::removeComponent | ( | EntityComponent * | component | ) |
Removes the given component.
component | Pointer to the component to remove. |
Definition at line 312 of file Entity.cpp.
void Entity::setPosition | ( | const vector3df & | position | ) |
Sets the position of the entity.
position | New position of the entity. |
Definition at line 382 of file Entity.cpp.