SuperTuxKart
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
StateManager Class Reference

A concrete scene manager, derived from GUIEngine's AbastractSceneManager. More...

#include <state_manager.hpp>

Inheritance diagram for StateManager:
Inheritance graph
[legend]

Classes

class  ActivePlayer
 Represents a player that is currently playing. More...
 

Public Member Functions

const PtrVector< ActivePlayer, HOLD > & getActivePlayers ()
 
ActivePlayergetActivePlayer (const int id)
 
const PlayerProfilegetActivePlayerProfile (const int id)
 
int createActivePlayer (PlayerProfile *profile, InputDevice *device)
 
void removeActivePlayer (int id)
 
unsigned int activePlayerCount ()
 
void resetActivePlayers ()
 
void escapePressed ()
 implementing callback from base class AbstractStateManager
 
virtual void onGameStateChange (GUIEngine::GameState new_state)
 implementing callback from base class AbstractStateManager
 
virtual void onStackEmptied ()
 implementing callback from base class AbstractStateManager
 
virtual void onTopMostScreenChanged ()
 implementing callback from base class AbstractStateManager
 
void clearMenuStack ()
 
- Public Member Functions inherited from GUIEngine::AbstractStateManager
 AbstractStateManager ()
 inits an AbstractStateManager is MENU state
 
void pushScreen (Screen *screen)
 adds a menu at the top of the screens stack
 
void replaceTopMostScreen (Screen *screen, GUIEngine::GameState gameState=GUIEngine::CURRENT)
 replaces the menu at the top of the screens stack (i.e.
 
void popMenu ()
 removes the menu at the top of the screens stack If the stack becomes empty after performing the pop (i.e.
 
void resetAndGoToScreen (Screen *screen)
 clears the menu stack and starts afresh with a new stack containing only the given screen
 
void resetAndSetStack (Screen *screens[])
 Sets the whole menu stack.
 
void onResize ()
 Called when resizing of stk window.
 
void enterMenuState ()
 Used in no graphics STK to enter menu screen (when server is idle state)
 
void enterGameState ()
 call to make the state manager enter game mode.
 
GameState getGameState ()
 
void reshowTopMostMenu ()
 to be called after e.g.
 
template<typename T >
void hardResetAndGoToScreen ()
 
virtual void escapePressed ()=0
 callback invoked whenever escape was pressed (or any similar cancel operation)
 
virtual void onGameStateChange (GameState new_state)=0
 callback invoked when game mode changes (e.g.
 
virtual void onStackEmptied ()=0
 callback invoked when the stack is emptied (all menus are popped out).
 
virtual void onTopMostScreenChanged ()=0
 
unsigned int getMenuStackSize () const
 Returns the number of screens on the stack.
 

Static Public Member Functions

static StateManagerget ()
 
static void deallocate ()
 
static void clear ()
 

Private Member Functions

void updateActivePlayerIDs ()
 

Private Attributes

PtrVector< ActivePlayer, HOLD > m_active_players
 A list of all currently playing players.
 

Additional Inherited Members

- Protected Member Functions inherited from GUIEngine::AbstractStateManager
void pushMenu (Screen *screen)
 
void setGameState (GameState state)
 
- Protected Attributes inherited from GUIEngine::AbstractStateManager
std::atomic< GameStatem_game_mode
 Whether we are in game mode.
 
std::vector< std::pair< std::string, Screen * > > m_menu_stack
 This stack will contain menu names (e.g.
 

Detailed Description

A concrete scene manager, derived from GUIEngine's AbastractSceneManager.

Member Function Documentation

◆ escapePressed()

void StateManager::escapePressed ( )
virtual

implementing callback from base class AbstractStateManager

Implements GUIEngine::AbstractStateManager.

◆ getActivePlayerProfile()

const PlayerProfile * StateManager::getActivePlayerProfile ( const int  id)
Returns
the PlayerProfile of a given ActivePlayer.
Parameters
idthe ID of the active player for whichyou want the profile

◆ onGameStateChange()

void StateManager::onGameStateChange ( GUIEngine::GameState  new_state)
virtual

implementing callback from base class AbstractStateManager

Implements GUIEngine::AbstractStateManager.

◆ onStackEmptied()

void StateManager::onStackEmptied ( )
virtual

implementing callback from base class AbstractStateManager

Implements GUIEngine::AbstractStateManager.

◆ onTopMostScreenChanged()

void StateManager::onTopMostScreenChanged ( )
virtual

implementing callback from base class AbstractStateManager

Implements GUIEngine::AbstractStateManager.


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