GameState Class Reference

#include <GameState.h>

Collaboration diagram for GameState:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 27 of file GameState.h.

Public Member Functions

 GameState (void)
 default constructor
 ~GameState (void)
 destructor
void UpdateMaxLevel (void)
 find the maximum level by searching the level files on disk

Public Attributes

int iGreenHandicap
 the amount of health taken from player at game start
int iBrownHandicap
 the amount of health taken from player at game start
int iMaxLevel
 highest level map name found in level directory
int iCurrentLevel
 current level playing / to be played
bool bFullScreen
bool bAutoAdvanceLevel
 will the level increment after each game
int iSFXLevel
 sound effect volume level
int iBGMLevel
 background music volume level
int iTotalJoysticks
 total number of joysticks detected (clamped to MAX_JOYSTICKS)
char * cJoystickNames [MAX_JOYSTICKS]
 array of pointers to joystick names
SDL_Joystick * Joysticks [MAX_JOYSTICKS]
 array of SDL joystick structures for getting event data
int iGreenPlayerJoystick
 red player's joystick ID number
int iBrownPlayerJoystick
 blue player's joystick ID number
CWorldWorld
 pointer to the game's current world


Constructor & Destructor Documentation

GameState::GameState ( void   ) 

Creates a game state object with default parameters. This constructor will determine the number of joysticks in the system and save that data in the new object. Also, the level file directory is searched and the level files are counted to determine the maximum level playable.

Definition at line 30 of file GameState.cpp.

References bAutoAdvanceLevel, bFullScreen, cJoystickNames, DEFAULT_BGM_VOLUME, DEFAULT_SFX_VOLUME, iBGMLevel, iBrownHandicap, iBrownPlayerJoystick, iCurrentLevel, iGreenHandicap, iGreenPlayerJoystick, iMaxLevel, iSFXLevel, iTotalJoysticks, Joysticks, MAX_JOYSTICKS, RUN_FULLSCREEN, UpdateMaxLevel(), and World.

Here is the call graph for this function:

GameState::~GameState ( void   ) 


Member Function Documentation

void GameState::UpdateMaxLevel ( void   ) 

This function inspects the game's level directory for level files, and stores a count of the number of files found in the object's iMaxLevel variable.

Definition at line 87 of file GameState.cpp.

References iMaxLevel, and MAX_LEVELS.

Referenced by GameState().

Here is the caller graph for this function:


Member Data Documentation

int GameState::iGreenHandicap

Definition at line 30 of file GameState.h.

Referenced by GameState(), InitGame(), and OptionsMenu().

int GameState::iBrownHandicap

Definition at line 31 of file GameState.h.

Referenced by GameState(), InitGame(), and OptionsMenu().

int GameState::iMaxLevel

Definition at line 32 of file GameState.h.

Referenced by GameState(), main(), OptionsMenu(), and UpdateMaxLevel().

int GameState::iCurrentLevel

Definition at line 33 of file GameState.h.

Referenced by GameState(), main(), and OptionsMenu().

bool GameState::bFullScreen

Definition at line 34 of file GameState.h.

Referenced by GameState(), OptionsMenu(), and ToggleFullScreen().

bool GameState::bAutoAdvanceLevel

Definition at line 35 of file GameState.h.

Referenced by GameState(), main(), and OptionsMenu().

int GameState::iSFXLevel

Definition at line 36 of file GameState.h.

Referenced by GameState(), and OptionsMenu().

int GameState::iBGMLevel

Definition at line 37 of file GameState.h.

Referenced by GameState(), and OptionsMenu().

int GameState::iTotalJoysticks

Definition at line 38 of file GameState.h.

Referenced by GameState(), and OptionsMenu().

char* GameState::cJoystickNames[MAX_JOYSTICKS]

Definition at line 39 of file GameState.h.

Referenced by GameState(), and OptionsMenu().

SDL_Joystick* GameState::Joysticks[MAX_JOYSTICKS]

Definition at line 40 of file GameState.h.

Referenced by GameState().

int GameState::iGreenPlayerJoystick

Definition at line 41 of file GameState.h.

Referenced by GameState(), OptionsMenu(), and PlayGame().

int GameState::iBrownPlayerJoystick

Definition at line 42 of file GameState.h.

Referenced by GameState(), OptionsMenu(), and PlayGame().

CWorld* GameState::World

Definition at line 44 of file GameState.h.

Referenced by GameState(), and main().

 

Copyright Windsor Schmidt 2006 - All rights reserved.