EntityManager Class Reference

The Entity Manager is the central interface point to all entity related functions of this program. More...

Inheritance diagram for EntityManager:

Inheritance graph
[legend]
Collaboration diagram for EntityManager:

Collaboration graph
[legend]

List of all members.

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.
EntitycreateEntity (const std::string &name, Entity *parent=NULL, bool grab=true)
 Creates (and adds) an Entity with the given name.
EntitycreateEntityFromXML (const std::string &fileName, Entity *parent=NULL, AssetGroup *assets=NULL, bool grab=true)
 Creates an Entity from the given XML file.
EntitycreateEntityFromXML (IXMLReader *file, Entity *parent=NULL, AssetGroup *assets=NULL, bool grab=true)
 Creates an Entity from a XML file through a IXMLReader object.
EntitygetEntity (const u32 id)
 Gets the Entity with the given ID.
EntitygetEntity (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.


Detailed Description

The Entity Manager is the central interface point to all entity related functions of this program.

Definition at line 31 of file EntityManager.h.


Constructor & Destructor Documentation

EntityManager::EntityManager (  ) 

Constructor.

Definition at line 26 of file EntityManager.cpp.

EntityManager::~EntityManager (  ) 

Deconstructor.

Definition at line 32 of file EntityManager.cpp.


Member Function Documentation

bool EntityManager::addEntity ( Entity entity  ) 

Adds the given Entity to the EntityManager.

Parameters:
entity Pointer to the Entity to add.
Returns:
True if addition was successful, false if addition was a failure.

Definition at line 62 of file EntityManager.cpp.

void EntityManager::clear (  ) 

Clears the EntityManager.

Definition at line 43 of file EntityManager.cpp.

Entity * EntityManager::createEntity ( const std::string &  name,
Entity parent = NULL,
bool  grab = true 
)

Creates (and adds) an Entity with the given name.

Parameters:
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?
Returns:
Pointer to the Entity on success, NULL on failure.

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.

Parameters:
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.

Parameters:
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.

Note:
This is a dummy function.

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.

Returns:
Pointer to the Entity if found, else NULL.

Definition at line 258 of file EntityManager.cpp.

Entity * EntityManager::getEntity ( const u32  id  ) 

Gets the Entity with the given ID.

Returns:
Pointer to the Entity if found, else NULL.

Definition at line 246 of file EntityManager.cpp.

void EntityManager::grab (  )  [virtual]

Increases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 50 of file EntityManager.cpp.

void EntityManager::init (  ) 

Initialises the EntityManager.

Definition at line 38 of file EntityManager.cpp.

void EntityManager::removeEntities (  ) 

Removes all entities from the EntityManager.

Definition at line 270 of file EntityManager.cpp.

bool EntityManager::removeEntity ( const std::string &  name  ) 

Removes the given Entity with the given name.

Parameters:
name Name of the Entity to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 327 of file EntityManager.cpp.

bool EntityManager::removeEntity ( const u32  id  ) 

Removes the given Entity with the given ID.

Parameters:
id ID of the Entity to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 305 of file EntityManager.cpp.

bool EntityManager::removeEntity ( Entity entity  ) 

Removes the given Entity.

Parameters:
entity Pointer to the Entity to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 279 of file EntityManager.cpp.


The documentation for this class was generated from the following files:

Generated on Fri Aug 21 23:55:14 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8