|
Login Languish
|
the GameManager class is a class that controls the flow of the game More...
#include <game_manager.h>
Public Member Functions | |
| GameManager () | |
| constructor for GameManager | |
| Stage * | getStage (std::string stage) |
| gets the current stage More... | |
| void | updateField (const rapidjson::Value &req) |
| updates the field More... | |
| void | updateField (const std::string &stage, const std::string &field, const std::string &value) |
| updates the field More... | |
| std::string | getNextStage () |
| progresses to the next stage is current stage is validated More... | |
| std::vector< std::string > | getFieldErrors (const std::string &stage, const std::string &field) |
| gets the field errors More... | |
| rapidjson::Document | getGameState () |
| gets the game state More... | |
| void | progressStage (const rapidjson::Value &req) |
| std::string | getCurrentStageName () |
the GameManager class is a class that controls the flow of the game
contains all concrete stage objects and method for interacting with the vairous stages
| std::vector< std::string > GameManager::getFieldErrors | ( | const std::string & | stage, |
| const std::string & | field | ||
| ) |
gets the field errors
gets the field errors for the requested stage and field
| stage | the name of the stage to get the field errors for |
| field | the name of the field to get the errors for |
| rapidjson::Document GameManager::getGameState | ( | ) |
gets the game state
gets the game state by creating a rapidjson object containing the game state
| std::string GameManager::getNextStage | ( | ) |
progresses to the next stage is current stage is validated
| Stage * GameManager::getStage | ( | std::string | stage | ) |
gets the current stage
| stage | name of stage requested |
| void GameManager::updateField | ( | const rapidjson::Value & | req | ) |
updates the field
updates the field within the requested stage
| req | the request object containing the stage, field to update and the new value Stage::update |
| void GameManager::updateField | ( | const std::string & | stage, |
| const std::string & | field, | ||
| const std::string & | value | ||
| ) |
updates the field
helper method to update the field within the requested stage, using string instead of a rapidjson object, used in testing
| stage | the name of the stage to update |
| field | the name of the field to update |
| value | the new value of the field GameManager::updateField |
1.8.13