Caseus Tower
 All Classes Namespaces Files Functions Variables
StateManager Class Reference

Creates a StateManager object. Creates a StateManager object to be inherited. DISCLAMER - This is a modified version of the state handling system that I used in my PGG SDL assignment. This version is different however it is similar so I thought that I should mention it. More...

#include <stateManager.h>

Public Member Functions

 StateManager ()
 
 ~StateManager ()
 
void addState (State *)
 
void changeState (State *)
 
void removeLastState ()
 
void update (float, float, float)
 
void drawSprites ()
 
void drawSpritesWithAlpha ()
 
std::string getName ()
 
bool runProgram ()
 

Private Attributes

std::vector< State * > currentStates
 

Detailed Description

Creates a StateManager object. Creates a StateManager object to be inherited. DISCLAMER - This is a modified version of the state handling system that I used in my PGG SDL assignment. This version is different however it is similar so I thought that I should mention it.

Definition at line 11 of file stateManager.h.

Constructor & Destructor Documentation

StateManager::StateManager ( )

Constructs a StateManager object

StateManager::~StateManager ( )

Destructs a StateManager object

Member Function Documentation

void StateManager::addState ( State )

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

Parameters
State* a pointer to the State in use
void StateManager::changeState ( State )

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

Parameters
State* a pointer to the State in use
void StateManager::drawSprites ( )

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

void StateManager::drawSpritesWithAlpha ( )

Draws the current State Sprites with alpha 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

Returns
std::string the name of the state
void StateManager::removeLastState ( )

Removes the last State from the vector

bool StateManager::runProgram ( )

Getter # runCheck

Returns
bool if the program should run.
void StateManager::update ( float  ,
float  ,
float   
)

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
floatthe x touch location
floatthe y touch location

Member Data Documentation

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

the current states that are in use

Definition at line 15 of file stateManager.h.


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