TriEngine
v0.0.16
General-purpose engine in C#/OpenGL
|
Game state manager that keeps track of the active game states and provides methods to control the states. More...
Public Member Functions | |
GameStateManager () | |
Creates a new GameStateManager with an empty state stack. More... | |
GameStateManager (IGameState state) | |
Creates a new GameStateManager and pushes an initial state onto the stack. More... | |
void | Update () |
Updates the object. More... | |
void | Draw () |
Draw the object to screen. More... | |
IGameState | Push (IGameState state) |
Pushes a new game state onto the stack, pausing the current one. More... | |
IGameState | Pop () |
Pops the currently active state from the stack, unpausing the previous one. More... | |
IGameState | Peek () |
Returns the game state at the top of the stack, without popping it. More... | |
IGameState | Switch (IGameState state) |
Switches to a new game state, discarding all previous ones in the stack. More... | |
Properties | |
int | StateCount [get] |
IGameState | ActiveState [get, set] |
Properties inherited from TriDevs.TriEngine.StateManagement.IGameStateManager | |
int | StateCount [get] |
Gets the number of game states currently in the stack. More... | |
IGameState | ActiveState [get] |
Gets the currently active game state. More... | |
Game state manager that keeps track of the active game states and provides methods to control the states.
TriDevs.TriEngine.StateManagement.GameStateManager.GameStateManager | ( | ) |
Creates a new GameStateManager with an empty state stack.
TriDevs.TriEngine.StateManagement.GameStateManager.GameStateManager | ( | IGameState | state | ) |
Creates a new GameStateManager and pushes an initial state onto the stack.
state | The state to initialize with. |
void TriDevs.TriEngine.StateManagement.GameStateManager.Draw | ( | ) |
Draw the object to screen.
Implements TriDevs.TriEngine.Interfaces.IDrawable.
IGameState TriDevs.TriEngine.StateManagement.GameStateManager.Peek | ( | ) |
Returns the game state at the top of the stack, without popping it.
Implements TriDevs.TriEngine.StateManagement.IGameStateManager.
IGameState TriDevs.TriEngine.StateManagement.GameStateManager.Pop | ( | ) |
Pops the currently active state from the stack, unpausing the previous one.
Implements TriDevs.TriEngine.StateManagement.IGameStateManager.
IGameState TriDevs.TriEngine.StateManagement.GameStateManager.Push | ( | IGameState | state | ) |
Pushes a new game state onto the stack, pausing the current one.
state | The new game state to push onto the stack. |
Implements TriDevs.TriEngine.StateManagement.IGameStateManager.
IGameState TriDevs.TriEngine.StateManagement.GameStateManager.Switch | ( | IGameState | state | ) |
Switches to a new game state, discarding all previous ones in the stack.
state | The new state to switch to. |
Implements TriDevs.TriEngine.StateManagement.IGameStateManager.
void TriDevs.TriEngine.StateManagement.GameStateManager.Update | ( | ) |
Updates the object.
Implements TriDevs.TriEngine.Interfaces.IUpdatable.
|
getset |
|
get |