Level H Engine
Public Member Functions | Private Attributes | List of all members
StateManager Class Reference

Creates a StateManager object. More...

#include <StateManager.h>

Collaboration diagram for StateManager:
Collaboration graph

Public Member Functions

 StateManager ()
 Constructs a StateManager object. More...
 
 ~StateManager ()
 Destructs a StateManager object. More...
 
void addState (State *state)
 Adds a new state to the current stack of states. More...
 
void changeState (State *state)
 Changes the current State to a new State. More...
 
void removeLastState ()
 Removes the last State from the vector. More...
 
void destructPreviousState ()
 A function to destruct the first state on the array. More...
 
bool input ()
 Handles the user input in the current State. More...
 
void update ()
 Updates the current State. More...
 
void draw ()
 

Private Attributes

std::vector< State * > currentStates
 The current states that are in use. More...
 

Detailed Description

Creates a StateManager object.

Constructor & Destructor Documentation

◆ StateManager()

StateManager::StateManager ( )

Constructs a StateManager object.

◆ ~StateManager()

StateManager::~StateManager ( )

Destructs a StateManager object.

Member Function Documentation

◆ addState()

void StateManager::addState ( State state)

Adds a new state to the current stack of states.

Parameters
stateA pointer to the State in use.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeState()

void StateManager::changeState ( State state)

Changes the current State to a new State.

Parameters
stateA pointer to the State in use.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destructPreviousState()

void StateManager::destructPreviousState ( )

A function to destruct the first state on the array.

Here is the caller graph for this function:

◆ draw()

void StateManager::draw ( )
Parameters
Drawsthe current State.
Here is the caller graph for this function:

◆ input()

bool StateManager::input ( )

Handles the user input in the current State.

Returns
If false then quit the application.
Here is the caller graph for this function:

◆ removeLastState()

void StateManager::removeLastState ( )

Removes the last State from the vector.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void StateManager::update ( )

Updates the current State.

Here is the caller graph for this function:

Member Data Documentation

◆ currentStates

std::vector<State*> StateManager::currentStates
private

The current states that are in use.


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