Gel2D - The free/open source game creation suite

Public Member Functions
gel::GelGameStateManager Class Reference

Game state manager. More...

#include <gelGameState.h>

List of all members.

Public Member Functions

 GelGameStateManager ()
 Constructor.
void addOverlayScene (GelGameState *scn)
 Adds a scene to the manager.
void addUnderlayScene (GelGameState *scn)
 Adds a scene to the manager.
void addScene (GelGameState *scn)
 Adds a scene to the manager.
void removeScene (int index)
 Removes a scene from the manager.
void updateAll ()
 Updates all scenes.
void drawAll ()
 Draws all scenes.
void pauseAll ()
 Pauses all scenes.
void resumeAll ()
 Resumes all scenes.
void restartAll ()
 Restarts all scenes.
void updateScene (int index)
 Updates a scene.
void drawScene (int index)
 Draws a scene.
void pauseScene (int index)
 Pauses a scene.
void resumeScene (int index)
 Resumes a scene.
void restartScene (int index)
 Restarts a scene.

Detailed Description

Game state manager.

GelGameStateManager provides a simple interface for managing GelGameStates.
The manager uses a doubly-linked list to store pointers to the scenes you've added, which can be referenced by their numerical indices in the provided functions.


Constructor & Destructor Documentation

gel::GelGameStateManager::GelGameStateManager ( ) [inline]

Constructor.

This doesn't do anything. Maybe it will...someday.


Member Function Documentation

void gel::GelGameStateManager::addOverlayScene ( GelGameState scn) [inline]

Adds a scene to the manager.

This will append a scene to the end of the list, and will be the last scene called for updating, drawing, etc.

Parameters:
scn: Pointer to a GelScene.
void gel::GelGameStateManager::addUnderlayScene ( GelGameState scn) [inline]

Adds a scene to the manager.

This will append a scene to the beginning of the list, and will be the first scene called for updating, drawing, etc.

Parameters:
scn: Pointer to a GelScene.
void gel::GelGameStateManager::addScene ( GelGameState scn) [inline]

Adds a scene to the manager.

This is a convenience function. It will add an overlay scene (that's what most people are likely to want).

See also:
addOverlayScene().
void gel::GelGameStateManager::removeScene ( int  index) [inline]

Removes a scene from the manager.

Parameters:
index: The index of the scene to be removed.
void gel::GelGameStateManager::updateAll ( )

Updates all scenes.

void gel::GelGameStateManager::drawAll ( )

Draws all scenes.

void gel::GelGameStateManager::pauseAll ( )

Pauses all scenes.

void gel::GelGameStateManager::resumeAll ( )

Resumes all scenes.

void gel::GelGameStateManager::restartAll ( )

Restarts all scenes.

void gel::GelGameStateManager::updateScene ( int  index) [inline]

Updates a scene.

Parameters:
index: The index of the scene to update.
void gel::GelGameStateManager::drawScene ( int  index) [inline]

Draws a scene.

Parameters:
index: The index of the scene to draw.
void gel::GelGameStateManager::pauseScene ( int  index) [inline]

Pauses a scene.

Parameters:
index: The index of the scene to pause.
void gel::GelGameStateManager::resumeScene ( int  index) [inline]

Resumes a scene.

Parameters:
index: The index of the scene to resume.
void gel::GelGameStateManager::restartScene ( int  index) [inline]

Restarts a scene.

Parameters:
index: The index of the scene to restart.

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