|
Login Languish
|
the Stage class is an abstract class that represents a stage in the game More...
#include <stage.h>


Public Member Functions | |
| virtual bool | validateStage ()=0 |
| std::vector< std::string > | getFieldErrors (std::string field) |
| gets the field errors for a given field More... | |
| virtual void | update (const rapidjson::Value &req)=0 |
| std::string | getStageName () |
| gets the stage name More... | |
| rapidjson::Value | getStageState (rapidjson::Document::AllocatorType &allocator) |
| creates the JSON representation of the stage state More... | |
| virtual rapidjson::Value | getFieldStates (rapidjson::Document::AllocatorType &allocator)=0 |
| virtual void | progressStage () |
| bool | isFieldDisabled (const std::string &field) |
Protected Member Functions | |
| Stage (GameManager *gameManager) | |
| rapidjson::Value | createFieldState (const std::string &field, rapidjson::Value &fieldValue, rapidjson::Document::AllocatorType &allocator) |
| creates the JSON representation of the field states More... | |
Protected Attributes | |
| GameManager * | gm |
| std::string | name = "" |
| std::map< std::string, std::vector< std::string > > | field_errors |
| const int | REQ_FIELD_INDEX = 1 |
| const int | REQ_VALUE_INDEX = 2 |
the Stage class is an abstract class that represents a stage in the game
contains functions that are implemented by all stages in the game
|
protected |
creates the JSON representation of the field states
this function creates rapidjson::Value object containing the field states, this functions is used for standard fields that have a value, errors and disabled property
| field | the name of the field to create the field state for |
| fieldValue | the rapidjson::Value object containing the field value (this may be any native type and is created by Stage::getFieldStates) |
| allocator | the rapidjson::Document::AllocatorType object used to allocate memory for the JSON objects |
| std::vector< std::string > Stage::getFieldErrors | ( | std::string | field | ) |
gets the field errors for a given field
this function returns the field errors for a given field
| field | the field to get the errors for |
| std::string Stage::getStageName | ( | ) |
gets the stage name
returns the stage name as a string
| rapidjson::Value Stage::getStageState | ( | rapidjson::Document::AllocatorType & | allocator | ) |
creates the JSON representation of the stage state
this function creates rapidjson::Value object containing the stage state including the stage name and the JSON representation of the field states
| allocator | the rapidjson::Document::AllocatorType object used to allocate memory for the JSON objects |
1.8.13