Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
Public Member Functions | List of all members
StateManager Class Reference

Creates a State manager object. Creates a State manager object to be inherited. Made using information from http://blog.nuclex-games.com/tutorials/cxx/game-state-management/ and Peter Allen. More...

#include <stateManager.h>

Collaboration diagram for StateManager:
Collaboration graph

Public Member Functions

 StateManager ()
 
 ~StateManager ()
 
void AddState (State *)
 
void ChangeState (State *)
 
void RemoveLastState ()
 
bool HandleSDLEvents ()
 
void Update (float deltaTime)
 
void Draw ()
 
std::string getName ()
 

Detailed Description

Creates a State manager object. Creates a State manager object to be inherited. Made using information from http://blog.nuclex-games.com/tutorials/cxx/game-state-management/ and Peter Allen.

Constructor & Destructor Documentation

StateManager::StateManager ( )

Constructs a StateManager object Constructs a StateManager object

StateManager::~StateManager ( )

De-constructs a StateManager object De-constructs the StateManager object

Member Function Documentation

void StateManager::AddState ( State state)

Adds a new state Adds a new state to the current stack of states

Parameters
State* a pointer to the State in use

Here is the caller graph for this function:

void StateManager::ChangeState ( State state)

Changes to a new State Changes the current State to a new State

Parameters
State* a pointer to the State in use

Here is the call graph for this function:

Here is the caller graph for this function:

void StateManager::Draw ( )

Draws the current State The draw function that will allow the equivalent draw function to run in the current State

std::string StateManager::getName ( )

getter # the name of the current State gets the name of the current State

Returns
std::string the name of the state
bool StateManager::HandleSDLEvents ( )

Handles the SDL events The SDL event handler function that will allow the equivalent SDL event handler function to run in the current State

Returns
bool if false then quit the application
void StateManager::RemoveLastState ( )

Removes the last State from the vector Removes the last State from the vector

Here is the caller graph for this function:

void StateManager::Update ( float  deltaTime)

Updates the current State The update function that will allow the equivalent update function to run in the current State

Parameters
floatthe delta time for use within the update function

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