Dragonfly 4.20
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

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

◆ getType()

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

Get type identifier of Manager.

◆ isStarted()

bool df::Manager::isStarted ( ) const

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

◆ isValid()

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::GameManager, df::InputManager, df::NetworkManager, and df::WorldManager.

◆ onEvent()

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

Send event to all interested Objects.

Return count of number of events sent.

◆ registerInterest()

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.)

◆ setType()

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

Set type identifier of Manager.

◆ shutDown()

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

◆ startUp()

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

◆ unregisterInterest()

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

◆ m_event_count

int df::Manager::m_event_count
private

Number of events.

◆ m_event_name

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

List of events.

◆ m_is_started

bool df::Manager::m_is_started
private

True if startUp() succeeded.

◆ m_obj_list

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

Objects interested in event.

◆ m_type

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

Manager type identifier.