Dragonfly  4.4
A text-based game engine
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
df::Manager Class Reference
Inheritance diagram for df::Manager:
Inheritance graph
Collaboration diagram for df::Manager:
Collaboration graph

Public Member Functions

std::string getType () const
virtual int startUp ()
virtual void shutDown ()
bool isStarted () const
int onEvent (const Event *p_event) const
int registerInterest (Object *p_o, std::string event_type)
int unregisterInterest (Object *p_o, std::string event_type)

Protected Member Functions

void setType (std::string new_type)

Private Member Functions

virtual bool isValid (std::string event_type) const

Private Attributes

std::string m_type
int m_event_count
std::string m_event_name [MAX_EVENTS]
ObjectList m_obj_list [MAX_EVENTS]
bool m_is_started

Member Function Documentation

std::string df::Manager::getType ( ) const

Get type identifier of Manager.

bool df::Manager::isStarted ( ) const

Return status of is_started (true when startUp() was successful).

virtual bool df::Manager::isValid ( std::string  event_type) const

Check if event is handled by this Manager.

If handled, return true else false. (Base Manager always returns false.)

Reimplemented in df::WorldManager, df::NetworkManager, df::GameManager, and df::InputManager.

int df::Manager::onEvent ( const Event p_event) const

Send event to all interested Objects.

Return count of number of events sent.

int df::Manager::registerInterest ( Object p_o,
std::string  event_type 

Indicate interest in event.

Return 0 if ok, else -1. (Note, doesn't check to see if Object is already registered.)

void df::Manager::setType ( std::string  new_type)

Set type identifier of Manager.

virtual void df::Manager::shutDown ( )
virtual int df::Manager::startUp ( )
int df::Manager::unregisterInterest ( Object p_o,
std::string  event_type 

Indicate no more interest in event.

Return 0 if ok, else -1.

Member Data Documentation

int df::Manager::m_event_count

Number of events.

std::string df::Manager::m_event_name[MAX_EVENTS]

List of events.

bool df::Manager::m_is_started

True if startUp() succeeded.

ObjectList df::Manager::m_obj_list[MAX_EVENTS]

Objects interested in event.

std::string df::Manager::m_type

Manager type identifier.