concrete game algorithm. More...
#include <GameContext.h>
Inherits Game.

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 () |
concrete game algorithm.
Context of state pattern and concrete game algorithm. Load and hold game data for concrete states.
Definition at line 15 of file GameContext.h.
Definition at line 33 of file GameContext.h.
| GameContext::GameContext | ( | int const | minWordSize = 4 |
) | [inline] |
Constructor.
| minWordSize | the minimal word length, default is 4. |
Definition at line 21 of file GameContext.h.
| GameContext::~GameContext | ( | ) | [inline] |
| 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.

| 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.

| 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.

| 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.

| std::string GameContext::getWord | ( | ) | const [inline] |
Get the current word. Access for concrete state loop
Definition at line 56 of file GameContext.h.

| void GameContext::setState | ( | State * | state | ) | [inline] |
Sets the state that will be used in this context. Access for concrete states.
| state | represents the current concrete state. |
Definition at line 30 of file GameContext.h.

| void GameContext::setWords | ( | LANGUAGE | lan | ) | [inline] |
Sets the state object that will be used in this context. Access for concrete state settings (stateSettings.h).
| lan | represents the language that will be used and load with readWords(const std::string path). |
Definition at line 37 of file GameContext.h.

1.6.1