Dragonfly  4.3
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
[legend]
Collaboration diagram for df::Manager:
Collaboration graph
[legend]

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
privatevirtual

Check if event is handled by this Manager.

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

Reimplemented in df::WorldManager, 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)
protected

Set type identifier of Manager.

virtual void df::Manager::shutDown ( )
virtual
virtual int df::Manager::startUp ( )
virtual

Startup Manager.

Return 0 if ok, else negative number.

Reimplemented in df::DisplayManager, df::ResourceManager, df::LogManager, df::WorldManager, df::PathManager, df::GameManager, and df::InputManager.

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
private

Number of events.

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

List of events.

bool df::Manager::m_is_started
private

True if startUp() succeeded.

ObjectList df::Manager::m_obj_list[MAX_EVENTS]
private

Objects interested in event.

std::string df::Manager::m_type
private

Manager type identifier.