GameContext Class Reference

concrete game algorithm. More...

#include <GameContext.h>

Inherits Game.

Collaboration diagram for GameContext:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LANGUAGE { DE, ENG, NL, FR }

Public Member Functions

 GameContext (int const minWordSize=4)
 ~GameContext ()
void setState (State *state)
void setWords (LANGUAGE lan)
void generateNextWord ()
std::string getWord () const
int getListCount () const

Protected Member Functions

virtual bool doInit ()
virtual void doLoop ()

Detailed Description

concrete game algorithm.

Context of state pattern and concrete game algorithm. Load and hold game data for concrete states.

See also:
State.h
Game.h

Definition at line 15 of file GameContext.h.


Member Enumeration Documentation

Enumerator:
DE 
ENG 
NL 
FR 

Definition at line 33 of file GameContext.h.


Constructor & Destructor Documentation

GameContext::GameContext ( int const   minWordSize = 4  )  [inline]

Constructor.

Parameters:
minWordSize the minimal word length, default is 4.

Definition at line 21 of file GameContext.h.

GameContext::~GameContext (  )  [inline]

Definition at line 24 of file GameContext.h.

Here is the call graph for this function:


Member Function Documentation

bool GameContext::doInit (  )  [protected, virtual]

A implementation of the primitive operation inherit from Game. Set the default state start and the game context to all other states. Initialized the PRNG.

Implements Game.

Definition at line 17 of file GameContext.cpp.

Here is the call graph for this function:

void GameContext::doLoop (  )  [protected, virtual]

A implementation of the primitive operation inherit from Game. A template method to call current state object methods in a loop.

Implements Game.

Definition at line 24 of file GameContext.cpp.

Here is the call graph for this function:

void GameContext::generateNextWord (  ) 

Generate the next word to get it with getWord(). Access for concrete state loop

Definition at line 8 of file GameContext.cpp.

Here is the caller graph for this function:

int GameContext::getListCount (  )  const [inline]

Get the current word count stored in this object. Access for concrete state start

Definition at line 60 of file GameContext.h.

Here is the caller graph for this function:

std::string GameContext::getWord (  )  const [inline]

Get the current word. Access for concrete state loop

Definition at line 56 of file GameContext.h.

Here is the caller graph for this function:

void GameContext::setState ( State state  )  [inline]

Sets the state that will be used in this context. Access for concrete states.

Parameters:
state represents the current concrete state.

Definition at line 30 of file GameContext.h.

Here is the caller graph for this function:

void GameContext::setWords ( LANGUAGE  lan  )  [inline]

Sets the state object that will be used in this context. Access for concrete state settings (stateSettings.h).

Parameters:
lan represents the language that will be used and load with readWords(const std::string path).

Definition at line 37 of file GameContext.h.

Here is the caller graph for this function:


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

Generated on Sat Oct 10 03:29:20 2009 for Hangman by  doxygen 1.6.1