Hummingbird Framework
 All Classes Functions Variables Modules Pages
hb::Game Class Reference

Game class. More...

#include <Game.h>

Classes

class  Scene
 Scene of a Game. More...
 

Static Public Member Functions

static void addScene (Scene &scene)
 Add a Scene to the Game. More...
 
static void addScene (Scene &&scene)
 Add a Scene to the Game. More...
 
static void setScene (const std::string &name)
 Set Scene with name name as the current Scene. More...
 
static void run ()
 Run the Game. More...
 
static void running (bool running)
 Set if the Game is running. More...
 
static bool isRunning ()
 Get if the Game is running. More...
 
template<typename T >
static void addPlugin ()
 Add Plugin to the Game. More...
 

Detailed Description

Game class.

This class handles the gameloop and the change of Scene.

You may add Plugins to add function calls to the gameloop (see Plugin).

Member Function Documentation

template<typename T >
static void hb::Game::addPlugin ( )
inlinestatic

Add Plugin to the Game.

Template Parameters
TType of the Plugin being added.

The plugin is instantiated using T's default constructor and added to the Game.

static void hb::Game::addScene ( Scene scene)
static

Add a Scene to the Game.

Parameters
sceneScene being added to the Game.
static void hb::Game::addScene ( Scene &&  scene)
static

Add a Scene to the Game.

Parameters
sceneScene being added to the Game.
static bool hb::Game::isRunning ( )
static

Get if the Game is running.

Returns
Is Game running.
static void hb::Game::run ( )
static

Run the Game.

Call this method when all Scenes and Plugins are already added to the Game and it is ready to launch.

static void hb::Game::running ( bool  running)
static

Set if the Game is running.

Parameters
runningIs Game running.

If running is false the Game will exit the gameloop after the current iteration and will proceed to exit.

static void hb::Game::setScene ( const std::string &  name)
static

Set Scene with name name as the current Scene.

Parameters
nameName of the Scene the Game will change to.

Actually this method doesn't change immediatly the current scene, but it flags that the scene must be changed and the Game will do it when it fits its loop.

The methods Scene::init() and Scene::exit() are appropriately called.


The documentation for this class was generated from the following file: