dxf::StateManager Class Reference

#include <dxf_statemanager.h>

Inheritance diagram for dxf::StateManager:

dxf::Model List of all members.

Public Member Functions

void Load ()
void Unload ()
void RegisterState (const std::wstring &name, GameState *pState)
void ChangeState (const std::wstring &name)
bool JustChangedState ()
void Resize (const D3DSURFACE_DESC *pBackBufferSurfaceDesc)
GameStateGetCurrentGameState ()

Protected Member Functions

 StateManager ()
virtual void Update ()

Protected Attributes

GameStatepCurrentState

Private Attributes

std::wstring newState
StateMap states

Detailed Description

A state manager is a state that handles sub-states, or states below it. Model is the top-level required state manager, but states within model can also be state managers themselves.

Definition at line 192 of file dxf_statemanager.h.


Constructor & Destructor Documentation

dxf::StateManager::StateManager (  )  [protected]

Definition at line 86 of file dxf_statemanager.cpp.

References pCurrentState.


Member Function Documentation

void dxf::StateManager::ChangeState ( const std::wstring &  name  ) 

Change to the state identified by the name

Definition at line 111 of file dxf_statemanager.cpp.

References newState.

Referenced by dxf::DXFChangeState().

GameState * dxf::StateManager::GetCurrentGameState (  ) 

Returns a pointer to the current game state

Definition at line 141 of file dxf_statemanager.cpp.

References pCurrentState.

Referenced by dxf::GetCurrentGameState(), dxf::Game::MsgProc(), dxf::View::OnCreateDevice(), dxf::View::OnDestroyDevice(), dxf::View::OnFrameRender(), dxf::OnGameStateGUIEvent(), dxf::View::OnLostDevice(), and dxf::View::OnResetDevice().

bool dxf::StateManager::JustChangedState (  ) 

Returns true if ChangeState was called in this frame

Definition at line 115 of file dxf_statemanager.cpp.

References newState.

void dxf::StateManager::Load (  ) 

Reimplemented in dxf::Model.

Definition at line 90 of file dxf_statemanager.cpp.

References pCurrentState.

Referenced by dxf::Model::Load().

void dxf::StateManager::RegisterState ( const std::wstring &  name,
GameState pState 
)

Add a state to the state manager using the string as an identifier.

Definition at line 103 of file dxf_statemanager.cpp.

References newState, dxf::Console::output, and states.

Referenced by dxf::DXFRegisterState().

void dxf::StateManager::Resize ( const D3DSURFACE_DESC *  pBackBufferSurfaceDesc  ) 

Called when the back buffer changes, the call is passed on to the current state

Definition at line 137 of file dxf_statemanager.cpp.

References pCurrentState, and dxf::GameState::Resize().

Referenced by dxf::View::OnResetDevice().

void dxf::StateManager::Unload (  ) 

Reimplemented in dxf::Model.

Definition at line 94 of file dxf_statemanager.cpp.

References pCurrentState, states, and dxf::GameState::Unload().

Referenced by dxf::Model::Unload().

void dxf::StateManager::Update (  )  [protected, virtual]

Update call, needs to be called each frame by the super-class to process state changes

Definition at line 119 of file dxf_statemanager.cpp.

References newState, pCurrentState, and states.

Referenced by dxf::Model::OnFrameMove().


Member Data Documentation

std::wstring dxf::StateManager::newState [private]

Definition at line 219 of file dxf_statemanager.h.

Referenced by ChangeState(), JustChangedState(), RegisterState(), and Update().

GameState* dxf::StateManager::pCurrentState [protected]

Definition at line 217 of file dxf_statemanager.h.

Referenced by GetCurrentGameState(), Load(), dxf::Model::OnFrameMove(), dxf::Model::Render2D(), dxf::Model::Render3D(), dxf::Model::RenderPre2D(), Resize(), StateManager(), Unload(), and Update().

StateMap dxf::StateManager::states [private]

Definition at line 220 of file dxf_statemanager.h.

Referenced by RegisterState(), Unload(), and Update().


The documentation for this class was generated from the following files:
Generated on Fri Aug 18 12:01:29 2006 for DXFramework by  doxygen 1.4.7