Nimbus  0.2
A game... with arrows... which should be clouds
 All Classes Functions Variables Enumerations Enumerator
Nimbus::EntityManager Class Reference

#include <EntityManager.h>

Inheritance diagram for Nimbus::EntityManager:
Collaboration diagram for Nimbus::EntityManager:

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::CreateEntityListenermCreateEntityListener
 
Nimbus::EntityManager::CatchEntityListenermCatchEntityListener
 
Nimbus::EntityManager::DestroyEntityListenermDestroyEventListener
 
Nimbus::EntityManager::TickListenermTickListener
 
Nimbus::EntityManager::PositionResponseListenermPositionResponseListener
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
entityTypesFileThe 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.
worldA reference to the world because sometimes, just sometimes, you need a reference to the world.
void EntityManager::initialize ( void  )
virtual

The initial initialization function.

Implements Nimbus::Manager.

Here is the call graph for this function:

bool EntityManager::update ( void  )
virtual

The super complex update function.

Returns
A boolean indicating the success of the update function. If this returns false... stop the program.

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.


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