Thrive
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
thrive::GameState Class Reference

Represents a distinct set of active systems and entities. More...

#include <game_state.h>

Classes

struct  Implementation
 

Public Types

using Initializer = std::function< void()>
 Typedef for the game state's initializer function.
 

Public Member Functions

 GameState (const GameState &)=delete
 Not copyable.
 
 ~GameState ()
 Destructor.
 
GameState & operator= (const GameState &)=delete
 Not copyable.
 
Engine & engine ()
 Returns the engine this game state belongs to. More...
 
const Engine & engine () const
 Returns the engine this game state belongs to. More...
 
EntityManager & entityManager ()
 Returns the game state's entity manager. More...
 
const EntityManager & entityManager () const
 Returns the game state's entity manager. More...
 
std::string name () const
 The game state's name. More...
 
btDiscreteDynamicsWorld * physicsWorld () const
 The physics world.
 
CEGUIWindow rootGUIWindow ()
 The root CEGUIWindow.
 
Ogre::SceneManager * sceneManager () const
 The Ogre scene manager.
 
template<typename S >
S * findSystem ()
 

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 

Friends

class Engine
 

Detailed Description

Represents a distinct set of active systems and entities.

The game has to switch between different states. Examples of a state are "main menu", "microbe gameplay" or "microbe editor". These states usually share very few entities and even fewer systems, so it is sensible to separate them completely (and, if necessary, share data over other channels).

Each GameState has its own EntityManager and its own set of systems. Game states are identified by their name, a unique string.

GameStates cannot be created directly. Use Engine::createGameState to create new GameStates.

Member Function Documentation

Engine & GameState::engine ( )

Returns the engine this game state belongs to.

Returns
const Engine & GameState::engine ( ) const

Returns the engine this game state belongs to.

Returns
EntityManager & GameState::entityManager ( )

Returns the game state's entity manager.

Returns
const EntityManager& thrive::GameState::entityManager ( ) const

Returns the game state's entity manager.

Returns
luabind::scope GameState::luaBindings ( )
static

Lua bindings.

Exposes:

Returns
std::string GameState::name ( ) const

The game state's name.

Returns

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