Dragonfly  4.3
A text-based game engine
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
df::PathManager Class Reference
Inheritance diagram for df::PathManager:
Inheritance graph
[legend]
Collaboration diagram for df::PathManager:
Collaboration graph
[legend]

Public Member Functions

int startUp ()
 
void shutDown ()
 
int registerPathFind (PathFind *p_path_find)
 
int unregisterPathFind (PathFind *p_path_find)
 
void setMinCycleTime (int new_min_cycle_time)
 
int getMinCycleTime ()
 
void cycle (int max_cycle_time=-1)
 
- Public Member Functions inherited from df::Manager
std::string getType () const
 
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)
 

Static Public Member Functions

static PathManagergetInstance ()
 

Private Member Functions

 PathManager ()
 
 PathManager (PathManager const &)
 
void operator= (PathManager const &)
 

Private Attributes

std::vector< PathFind * > m_finder
 
int m_min_cycle_time
 

Additional Inherited Members

- Protected Member Functions inherited from df::Manager
void setType (std::string new_type)
 

Constructor & Destructor Documentation

df::PathManager::PathManager ( )
private

Private since a singleton.

df::PathManager::PathManager ( PathManager const &  )
private

Don't allow copy.

Member Function Documentation

void df::PathManager::cycle ( int  max_cycle_time = -1)

Cycle through registered PathFinders.

Spend at least min_cycle time, but no more than max_cycle_time.

static PathManager& df::PathManager::getInstance ( )
static

Get the one and only instance of the PathManager.

int df::PathManager::getMinCycleTime ( )

Get minimum cycle time (minimum game loop time spent pathfinding).

void df::PathManager::operator= ( PathManager const &  )
private

Don't allow assignment.

int df::PathManager::registerPathFind ( PathFind p_path_find)

Register PathFind with PathManager.

Return 0 if ok, else -1.

void df::PathManager::setMinCycleTime ( int  new_min_cycle_time)

Set minimum cycle time (minimum game loop time spent pathfinding).

void df::PathManager::shutDown ( )
virtual

Shut down PathManager.

Reimplemented from df::Manager.

int df::PathManager::startUp ( )
virtual

Start up PathManager.

Set min cycle time default to 1/10 frame time.

Reimplemented from df::Manager.

int df::PathManager::unregisterPathFind ( PathFind p_path_find)

Unregister PathFind with PathManager.

Return 0 if ok, else -1.

Member Data Documentation

std::vector<PathFind *> df::PathManager::m_finder
private

PathFind's registered.

int df::PathManager::m_min_cycle_time
private

Min pathfinding time, in millisec.