Public Member Functions | |
EntityManager () | |
Constructor. | |
~EntityManager () | |
Deconstructor. | |
void | init () |
Initialises the EntityManager. | |
void | clear () |
Clears the EntityManager. | |
void | grab () |
Increases the reference counter. | |
void | drop () |
Decreases the reference counter. | |
bool | addEntity (Entity *entity) |
Adds the given Entity to the EntityManager. | |
Entity * | createEntity (const std::string &name, Entity *parent=NULL, bool grab=true) |
Creates (and adds) an Entity with the given name. | |
Entity * | createEntityFromXML (const std::string &fileName, Entity *parent=NULL, AssetGroup *assets=NULL, bool grab=true) |
Creates an Entity from the given XML file. | |
Entity * | createEntityFromXML (IXMLReader *file, Entity *parent=NULL, AssetGroup *assets=NULL, bool grab=true) |
Creates an Entity from a XML file through a IXMLReader object. | |
Entity * | getEntity (const u32 id) |
Gets the Entity with the given ID. | |
Entity * | getEntity (const std::string &name) |
Gets the Entity with the given name. | |
void | removeEntities () |
Removes all entities from the EntityManager. | |
bool | removeEntity (Entity *entity) |
Removes the given Entity. | |
bool | removeEntity (const u32 id) |
Removes the given Entity with the given ID. | |
bool | removeEntity (const std::string &name) |
Removes the given Entity with the given name. |
Definition at line 31 of file EntityManager.h.
EntityManager::EntityManager | ( | ) |
EntityManager::~EntityManager | ( | ) |
bool EntityManager::addEntity | ( | Entity * | entity | ) |
Adds the given Entity to the EntityManager.
entity | Pointer to the Entity to add. |
Definition at line 62 of file EntityManager.cpp.
void EntityManager::clear | ( | ) |
Entity * EntityManager::createEntity | ( | const std::string & | name, | |
Entity * | parent = NULL , |
|||
bool | grab = true | |||
) |
Creates (and adds) an Entity with the given name.
name | Name of the Entity. | |
parent | Parent of the entity that is going to be created. | |
grab | Should the EntityManager add the loaded entity to the internal list? |
Definition at line 80 of file EntityManager.cpp.
Entity * EntityManager::createEntityFromXML | ( | IXMLReader * | file, | |
Entity * | parent = NULL , |
|||
AssetGroup * | assets = NULL , |
|||
bool | grab = true | |||
) |
Creates an Entity from a XML file through a IXMLReader object.
file | Pointer to the IXMLReader object that will be used. | |
parent | Parent of the entity that is going to be created. Will override parent mentioned in the XML file. | |
assets | Pointer to the AssetGroup that will be used as an alternative source for loading assets instead of the global unmanaged pool. | |
grab | Should the EntityManager add the loaded entity to the internal list? |
Definition at line 115 of file EntityManager.cpp.
Entity * EntityManager::createEntityFromXML | ( | const std::string & | fileName, | |
Entity * | parent = NULL , |
|||
AssetGroup * | assets = NULL , |
|||
bool | grab = true | |||
) |
Creates an Entity from the given XML file.
fileName | Filename of the entity. | |
parent | Parent of the entity that is going to be created. Will override parent mentioned in the XML file. | |
assets | Pointer to the AssetGroup that will be used as an alternative source for loading assets instead of the global unmanaged pool. | |
grab | Should the EntityManager add the loaded entity to the internal list? |
Definition at line 99 of file EntityManager.cpp.
void EntityManager::drop | ( | ) | [virtual] |
Decreases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 56 of file EntityManager.cpp.
Entity * EntityManager::getEntity | ( | const std::string & | name | ) |
Gets the Entity with the given name.
Definition at line 258 of file EntityManager.cpp.
Entity * EntityManager::getEntity | ( | const u32 | id | ) |
Gets the Entity with the given ID.
Definition at line 246 of file EntityManager.cpp.
void EntityManager::grab | ( | ) | [virtual] |
Increases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 50 of file EntityManager.cpp.
void EntityManager::init | ( | ) |
void EntityManager::removeEntities | ( | ) |
bool EntityManager::removeEntity | ( | const std::string & | name | ) |
Removes the given Entity with the given name.
name | Name of the Entity to remove. |
Definition at line 327 of file EntityManager.cpp.
bool EntityManager::removeEntity | ( | const u32 | id | ) |
Removes the given Entity with the given ID.
id | ID of the Entity to remove. |
Definition at line 305 of file EntityManager.cpp.
bool EntityManager::removeEntity | ( | Entity * | entity | ) |
Removes the given Entity.
entity | Pointer to the Entity to remove. |
Definition at line 279 of file EntityManager.cpp.