Public Member Functions | |
Game () | |
ctor | |
virtual | ~Game () |
dtor | |
void | run () |
Main game loop. | |
void | init (int argc, char **argv) |
Initialize TFK:GE. | |
virtual bool | OnEvent (const irr::SEvent &e) |
Primary even handler. | |
World * | getWorld () const |
State * | getState () const |
void | setState (State *s) |
set the active state | |
irr::IrrlichtDevice * | getDevice () const |
cAudio::IAudioManager * | getAudioManager () const |
Static Public Member Functions | |
static Game * | instance () |
Classes | |
class | State |
The main entry point to TFK:GE. More... |
The Game class is in charge of initializing the various subsystems (graphics, physics, sound, scripting) and the game components (level manager, weapons).
TFK:GE uses a very common state pattern. The Game object has a current State object to which all events are forwarded and which is also responsible for rendering.
Game * Game::instance | ( | ) | [static] |
Referenced by Game::State::changeState(), and Player::update().
void Game::run | ( | ) |
Main game loop.
This function periodically updates the game by caling the update() method of the active state (if any)
References Game::State::update().
void Game::init | ( | int | argc, | |
char ** | argv | |||
) |
Initialize TFK:GE.
argc | number of arguments, as passed to main() | |
argv | argument data, as passed to main() |
bool Game::OnEvent | ( | const irr::SEvent & | event | ) | [virtual] |
Primary even handler.
event | Event to handle |
References Game::State::event().
World * Game::getWorld | ( | ) | const |
Game::State * Game::getState | ( | ) | const |
void Game::setState | ( | Game::State * | s | ) |
set the active state
s | state to activate |
References Game::State::enter(), and Game::State::leave().
Referenced by Game::State::changeState().
irr::IrrlichtDevice * Game::getDevice | ( | ) | const |
cAudio::IAudioManager * Game::getAudioManager | ( | ) | const |