dtDAL::GameEventManager Class Reference

a simple class that manages a list of game events. More...

#include <gameeventmanager.h>

Inheritance diagram for dtDAL::GameEventManager:

dtDAL::Map::MapGameEvents

List of all members.

Public Member Functions

 GameEventManager ()
 Constructs the shader manager.
 GameEventManager (const GameEventManager &rhs)
GameEventManageroperator= (const GameEventManager &rhs)
virtual void AddEvent (GameEvent &event)
 Adds a new event to the game event manager.
virtual void RemoveEvent (GameEvent &event)
 Removes an existing event from the game event manager.
virtual void RemoveEvent (const dtCore::UniqueId &id)
 Removes the game event with the specified unique id from the manager.
virtual void ClearAllEvents ()
 Clears all the currently registered events from the manager.
void GetAllEvents (std::vector< GameEvent * > &toFill)
 Fills the specified vector with the current list of game events in the manager.
GameEventFindEvent (const dtCore::UniqueId &id)
 Gets the event specified by the unique id.
GameEventFindEvent (const std::string &name)
 Gets the event with the specified name.
unsigned int GetNumEvents () const
 Gets the number of events currently registered with the event manager.

Static Public Member Functions

static GameEventManagerGetInstance ()
 Gets the single global instance of this class.

Protected Member Functions

virtual ~GameEventManager ()
 Destroys the event manager.


Detailed Description

a simple class that manages a list of game events.

This class is a singleton, but instances can also be created to store lists of game events. The version to use at runtime is the singleton version.


Constructor & Destructor Documentation

dtDAL::GameEventManager::GameEventManager (  ) 

Constructs the shader manager.

Since this is a singleton class, this is private.

dtDAL::GameEventManager::GameEventManager ( const GameEventManager rhs  ) 

dtDAL::GameEventManager::~GameEventManager (  )  [protected, virtual]

Destroys the event manager.


Member Function Documentation

GameEventManager & dtDAL::GameEventManager::operator= ( const GameEventManager rhs  ) 

static GameEventManager& dtDAL::GameEventManager::GetInstance ( void   )  [inline, static]

Gets the single global instance of this class.

Returns:
The singleton instance.

void dtDAL::GameEventManager::AddEvent ( GameEvent event  )  [virtual]

Adds a new event to the game event manager.

Parameters:
event The new event to register with the manager.

Reimplemented in dtDAL::Map::MapGameEvents.

void dtDAL::GameEventManager::RemoveEvent ( GameEvent event  )  [virtual]

Removes an existing event from the game event manager.

Parameters:
event The event to remove. If it is not currently in the manager, this method is a no-op.

Reimplemented in dtDAL::Map::MapGameEvents.

void dtDAL::GameEventManager::RemoveEvent ( const dtCore::UniqueId id  )  [virtual]

Removes the game event with the specified unique id from the manager.

Parameters:
id The unique id of the game event to remove. If the event is not currently in the manager, this method is a no-op.

Reimplemented in dtDAL::Map::MapGameEvents.

void dtDAL::GameEventManager::ClearAllEvents (  )  [virtual]

Clears all the currently registered events from the manager.

Reimplemented in dtDAL::Map::MapGameEvents.

void dtDAL::GameEventManager::GetAllEvents ( std::vector< GameEvent * > &  toFill  ) 

Fills the specified vector with the current list of game events in the manager.

Parameters:
toFill The vector to fill with game events. This is cleared before it is filled.

GameEvent * dtDAL::GameEventManager::FindEvent ( const dtCore::UniqueId id  ) 

Gets the event specified by the unique id.

Parameters:
id The id of the event to retreive.
Returns:
The event in question or NULL if an event with the specified unique id could not be found.

GameEvent * dtDAL::GameEventManager::FindEvent ( const std::string &  name  ) 

Gets the event with the specified name.

Parameters:
name Name of the event to search fo.
Returns:
The event with the specified name, or NULL if an event could not be found.
Note:
Since events may have the same name, this method will return the FIRST event matching the specified name.

unsigned int dtDAL::GameEventManager::GetNumEvents (  )  const [inline]

Gets the number of events currently registered with the event manager.

Returns:
The number of events.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008