1 #ifndef __GAMESTATE_HPP 2 #define __GAMESTATE_HPP 31 GameState(std::string state,
Object *parent =
nullptr, std::string name =
"GameState");
60 T *temp =
new T(
this);
61 GameState *state = dynamic_cast<GameState *>(temp);
void SetActive(bool active)
Sets active status of the object Triggers OnActivate or OnDeactivate appropriately.
GameStateManager(Object *parent=nullptr, std::string name="GameStateManager")
Constructor Derived classes should call this in their constructors' initialization list.
Object(Object *parent=nullptr, std::string name="Object")
Constructor Derived classes should call this in their constructors' initialization list.
GameState base class Inherit this to create your own states.
Definition: GameState.hpp:14
General base class Allows for parent/child relationship trees.
Definition: Object.hpp:33
void AddChild(Object *child)
Adds child to this Object's list of children This will also set child's _parent to this This will do ...
void UnloadAllStates()
Unloads all child states.
GameState(Object *parent=nullptr, std::string name="GameState")
Constructor.
bool ActivateState(unsigned i)
Activates the current state to the one at the given index.
GameStateManager class.
Definition: GameState.hpp:42
const std::string StateName()
Gets the state's name.
GameState * GetState(unsigned i)
Gets the state at the given index.
std::string _state
State name.
Definition: GameState.hpp:17
GameState * LoadState(bool active=false)
Loads the given GameState derived class as a new state.
Definition: GameState.hpp:58
Aspen engine namespace.
Definition: Audio.hpp:8
bool SetCurrentState(unsigned i)
Sets the current state to the one at the given index Deactivates all other states.
bool DeactivateState(unsigned i)
Deactivates the current state to the one at the given index.
void UnloadState(unsigned i)
Unloads the state with the given index.