|
Thrive
|
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 |
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.
| Engine & GameState::engine | ( | ) |
Returns the engine this game state belongs to.
| const Engine & GameState::engine | ( | ) | const |
Returns the engine this game state belongs to.
| EntityManager & GameState::entityManager | ( | ) |
Returns the game state's entity manager.
| const EntityManager& thrive::GameState::entityManager | ( | ) | const |
Returns the game state's entity manager.
|
static |
Lua bindings.
Exposes:
| std::string GameState::name | ( | ) | const |
The game state's name.
1.8.10