Nimbus
0.2
A game... with arrows... which should be clouds
|
#include <EntityManager.h>
Classes | |
class | CatchEntityListener |
class | CreateEntityListener |
class | DestroyEntityListener |
class | PositionResponseListener |
class | TickListener |
Public Member Functions | |
EntityManager (World *world) | |
virtual void | initialize (void) |
virtual bool | update (void) |
virtual void | pause (void) |
virtual void | stop (void) |
void | configureEntityTypes (std::string entityTypesFile, World *world) |
Protected Attributes | |
Nimbus::EntityManager::CreateEntityListener * | mCreateEntityListener |
Nimbus::EntityManager::CatchEntityListener * | mCatchEntityListener |
Nimbus::EntityManager::DestroyEntityListener * | mDestroyEventListener |
Nimbus::EntityManager::TickListener * | mTickListener |
Nimbus::EntityManager::PositionResponseListener * | mPositionResponseListener |
Manages all the entities in the game world.
Entities are all the game world elements. Particularly elements that can be seen as elements that exist in the environment. We often stretch this definition for convenience sake, particularly because entity provides a generic framework from which we can build any game object we'd like.
This manager merely updates various entities as appropriate. Though it may handle some aggregate updates that would be impossible for individual entities to execute.
void EntityManager::configureEntityTypes | ( | std::string | entityTypesFile, |
World * | world | ||
) |
Configures the entity factory.
I'm trying something a bit different in order to take weight off the constructor. Theoretically this could lead to switching/updating the entity types midgame... might be cool.
entityTypesFile | The file location of the entity types definition file. This file contains a list of entity type names mapped to entity type definition files. These files are loaded by the EntityFactory to construct the prototypal entity types. |
world | A reference to the world because sometimes, just sometimes, you need a reference to the world. |
|
virtual |
The initial initialization function.
Implements Nimbus::Manager.
|
virtual |
The super complex update function.
Example of how to access entities std::list<GameEntity*> dragons = entities->getEntitiesOfType("Dragon"); for (std::list<GameEntity*>::iterator it = dragons.begin(); it != dragons.end(); it++) { Ogre::LogManager::getSingleton().logMessage("I found a dragon"); } Ogre::LogManager::getSingleton().logMessage(entities->getEntity(4)->getEntityType());
Implements Nimbus::Manager.