13 #include "rapidjson/document.h" 14 #include "../game_manager.h" 27 virtual bool validateStage() = 0;
29 virtual void update(
const rapidjson::Value &req) = 0;
31 rapidjson::Value
getStageState(rapidjson::Document::AllocatorType &allocator);
32 virtual rapidjson::Value getFieldStates(rapidjson::Document::AllocatorType &allocator) = 0;
33 virtual void progressStage() {};
34 bool isFieldDisabled(
const std::string &field);
36 rapidjson::Value
createFieldState(
const std::string &field, rapidjson::Value &fieldValue, rapidjson::Document::AllocatorType &allocator);
37 std::string name =
"";
38 std::map<std::string, std::vector<std::string>> field_errors;
39 const int REQ_FIELD_INDEX = 1;
40 const int REQ_VALUE_INDEX = 2;
std::vector< std::string > getFieldErrors(std::string field)
gets the field errors for a given field
Definition: stage.cpp:77
rapidjson::Value createFieldState(const std::string &field, rapidjson::Value &fieldValue, rapidjson::Document::AllocatorType &allocator)
creates the JSON representation of the field states
Definition: stage.cpp:48
rapidjson::Value getStageState(rapidjson::Document::AllocatorType &allocator)
creates the JSON representation of the stage state
Definition: stage.cpp:23
the Stage class is an abstract class that represents a stage in the game
Definition: stage.h:20
std::string getStageName()
gets the stage name
Definition: stage.cpp:87
the GameManager class is a class that controls the flow of the game
Definition: game_manager.h:22