LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
StateManager Class Reference

Handles picking a state to run and loading/saveing them. More...

#include <statemanager.h>

Static Public Member Functions

static void InitIntro ()
 
static void RunState (std::string name)
 
static std::shared_ptr< StateGetActiveState ()
 
static void LoadState (std::string name)
 
static void SaveState (std::string name)
 
static void ChangeScene (std::string scene)
 

Detailed Description

Handles picking a state to run and loading/saveing them.

Handles loading a state, running it and then based on on the value returned from the state loading the next state desired

Member Function Documentation

void StateManager::ChangeScene ( std::string  scene)
static

Change the active scene to the scene passed, exiting the current active scene

Parameters
sceneThe scene to change to
std::shared_ptr< State > StateManager::GetActiveState ( )
static

Get the active State

Returns
A shared_ptr to the active state
void StateManager::InitIntro ( )
static

Start the first state, mIntro

void StateManager::LoadState ( std::string  name)
static

Load a state from file by its name

Parameters
nameThe state name to load for the state, state and file names are same
void StateManager::RunState ( std::string  name)
static

Set a state active based on its name

Parameters
nameThe name of the state to set active
void StateManager::SaveState ( std::string  name)
static

Save a state to a data file corresponding to its name

Parameters
nameThe state name to save, state and file names are the same

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