EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
StateManager Class Reference

All the possible states included here to make switching easier. More...

#include <StateManager.h>

Public Member Functions

void changeState (std::unique_ptr< State > newState)
 Handles state changes.
 
void applyPendingState ()
 Updates the current state.
 
void pushState (std::unique_ptr< State > newState)
 Push new state on top (use for pause menu, settings)
 
void popState ()
 Add new state on top.
 
StatecurrentState ()
 Remove top state.
 
bool isEmpty () const
 
void update (sf::RenderWindow &window, StateManager &stateManager)
 Handles individual states.
 
void render (sf::RenderWindow &window)
 Render the current state.
 

Detailed Description

All the possible states included here to make switching easier.

Member Function Documentation

◆ applyPendingState()

void StateManager::applyPendingState ( )

Updates the current state.

Remove all states

◆ changeState()

void StateManager::changeState ( std::unique_ptr< State > newState)

Handles state changes.

Queue the next state.

Store the new state

◆ currentState()

State * StateManager::currentState ( )

Remove top state.

Get current state on top of stack.

◆ isEmpty()

bool StateManager::isEmpty ( ) const
inline

◆ popState()

void StateManager::popState ( )

Add new state on top.

Remove top state and resume the previous one.

Remove top state

◆ pushState()

void StateManager::pushState ( std::unique_ptr< State > newState)

Push new state on top (use for pause menu, settings)

◆ render()

void StateManager::render ( sf::RenderWindow & window)

Render the current state.

◆ update()

void StateManager::update ( sf::RenderWindow & window,
StateManager & stateManager )

Handles individual states.

Used for handling input and game updates.


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