GameState Class Reference

This is where the game happens. More...

#include <GameState.h>

Inheritance diagram for GameState:

Inheritance graph
[legend]
Collaboration diagram for GameState:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GameState (StateID state, std::string m)
 ~GameState ()
virtual void paint ()
 Callback for painting, overload in other states.
virtual void doKey (int key, int x, int y, bool special, bool down, unsigned int modifiers)
 Callback for key event, overload in other states.
virtual void keyRelease (int key, int x, int y, bool special, unsigned int modifiers)
virtual void doMouseDown (Interface::MouseButtonType button, int x, int y)
 Callback for mouse down, overload in other states.
virtual void doMouseUp (Interface::MouseButtonType button, int x, int y)
 Callback for mouse up, overload in other states.
virtual void doMouseDragged (int x, int y)
 Callback for mouse dragged, overload in other states.
virtual bool isActive ()
void setupKeyBindings ()
void doKey_InGame (int key, int x, int y, bool special, bool down, unsigned int modifiers)
void doKey_GameOver (int key, int x, int y, bool special, bool down, unsigned int modifiers)

Static Public Attributes

static GameStatecurrentGame
 Holds a pointer to the currentGame, or NULL if no game is in progress.
static KeyBindings kb
 Keybindings set up from preference file etc.

Protected Types

typedef void(GameState::*) DoKeyFunc_t (int, int, int, bool, bool, unsigned int)

Protected Member Functions

void setupProjectionMatrix ()
void setupOrthoMatrix ()
void endTurn ()

Static Protected Member Functions

static void LoadMissionIncremental ()
 This function is called several times during game initialization.
static void Update (int value)
static void GenerateTrees (short nmemb, float minRadius, float maxRadius)
static void GenerateStones (short nmemb, float radius)
static void Start ()
static void StartGameOver ()
static void GameOverPaint ()

Protected Attributes

int buttonsDown
float lastMouseX
float lastMouseY
bool cameraLock
float turnStart
float turnTime_ms
bool turnActive
std::string mission
DoKeyFunc_t doKeyFunc

Static Protected Attributes

static int initState
 Used for keeping track of incremental init.
static long lastUpdate

Friends

class State
 Allow state to access our protected members.

Detailed Description

This is where the game happens.


Member Typedef Documentation

typedef void(GameState::*) GameState::DoKeyFunc_t(int, int, int, bool, bool, unsigned int) [protected]


Constructor & Destructor Documentation

GameState::GameState ( StateID  state,
std::string  m 
)

GameState::~GameState (  ) 


Member Function Documentation

virtual void GameState::doKey ( int  key,
int  x,
int  y,
bool  special,
bool  down,
unsigned int  modifiers 
) [virtual]

Callback for key event, overload in other states.

Reimplemented from State.

void GameState::doKey_GameOver ( int  key,
int  x,
int  y,
bool  special,
bool  down,
unsigned int  modifiers 
)

void GameState::doKey_InGame ( int  key,
int  x,
int  y,
bool  special,
bool  down,
unsigned int  modifiers 
)

virtual void GameState::doMouseDown ( Interface::MouseButtonType  button,
int  x,
int  y 
) [virtual]

Callback for mouse down, overload in other states.

Reimplemented from State.

virtual void GameState::doMouseDragged ( int  x,
int  y 
) [virtual]

Callback for mouse dragged, overload in other states.

Reimplemented from State.

virtual void GameState::doMouseUp ( Interface::MouseButtonType  button,
int  x,
int  y 
) [virtual]

Callback for mouse up, overload in other states.

Reimplemented from State.

void GameState::endTurn (  )  [protected]

static void GameState::GameOverPaint (  )  [static, protected]

static void GameState::GenerateStones ( short  nmemb,
float  radius 
) [static, protected]

static void GameState::GenerateTrees ( short  nmemb,
float  minRadius,
float  maxRadius 
) [static, protected]

virtual bool GameState::isActive (  )  [virtual]

virtual void GameState::keyRelease ( int  key,
int  x,
int  y,
bool  special,
unsigned int  modifiers 
) [virtual]

static void GameState::LoadMissionIncremental (  )  [static, protected]

This function is called several times during game initialization.

Each time a small fraction of setup is completed this is to avoid locking the main thread during setup.

virtual void GameState::paint (  )  [virtual]

Callback for painting, overload in other states.

Reimplemented from State.

void GameState::setupKeyBindings (  ) 

void GameState::setupOrthoMatrix (  )  [protected]

void GameState::setupProjectionMatrix (  )  [protected]

static void GameState::Start (  )  [static, protected]

static void GameState::StartGameOver (  )  [static, protected]

static void GameState::Update ( int  value  )  [static, protected]


Friends And Related Function Documentation

friend class State [friend]

Allow state to access our protected members.


Member Data Documentation

int GameState::buttonsDown [protected]

bool GameState::cameraLock [protected]

GameState* GameState::currentGame [static]

Holds a pointer to the currentGame, or NULL if no game is in progress.

DoKeyFunc_t GameState::doKeyFunc [protected]

int GameState::initState [static, protected]

Used for keeping track of incremental init.

KeyBindings GameState::kb [static]

Keybindings set up from preference file etc.

float GameState::lastMouseX [protected]

float GameState::lastMouseY [protected]

long GameState::lastUpdate [static, protected]

std::string GameState::mission [protected]

bool GameState::turnActive [protected]

float GameState::turnStart [protected]

float GameState::turnTime_ms [protected]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7