Dragonfly 4.20
A text-based game engine
|
Public Member Functions | |
int | startUp () override |
bool | isValid (std::string event_name) const override |
void | shutDown () override |
void | run () |
void | setGameOver (bool game_over=true) |
bool | getGameOver () const |
int | getFrameTime () const |
int | getStepCount () const |
Public Member Functions inherited from df::Manager | |
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) |
Static Public Member Functions | |
static GameManager & | getInstance () |
Private Member Functions | |
GameManager () | |
GameManager (GameManager const &) | |
void | operator= (GameManager const &) |
Private Attributes | |
bool | m_game_over |
int | m_frame_time |
int | m_step_count |
Additional Inherited Members | |
Protected Member Functions inherited from df::Manager | |
void | setType (std::string new_type) |
|
private |
Private since a singleton.
|
private |
Don't allow copy.
int df::GameManager::getFrameTime | ( | ) | const |
Return frame time.
Frame time is target time for each game loop, in milliseconds.
bool df::GameManager::getGameOver | ( | ) | const |
Get game over status.
|
static |
Get the singleton instance of the GameManager.
int df::GameManager::getStepCount | ( | ) | const |
Return game loop step count.
|
overridevirtual |
|
private |
Don't allow assignment.
void df::GameManager::run | ( | ) |
Run game loop.
void df::GameManager::setGameOver | ( | bool | game_over = true | ) |
Set game over status to indicated value.
If true (default), will stop game loop.
|
overridevirtual |
Shut down GameManager services.
Reimplemented from df::Manager.
|
overridevirtual |
Startup all GameManager services.
Reimplemented from df::Manager.
|
private |
Target time per game loop, in millisec.
|
private |
True -> game loop should stop.
|
private |
Count of game loop iterations.