11 #include "../game_manager.h" 16 const char CELEB_CAPTCHAS = 0;
17 const char MUFFIN_DOG_CAPTCHAS = 1;
18 const char FREEDOM_CAPTCHAS = 2;
20 namespace fs = std::filesystem;
31 void update(
const rapidjson::Value &req);
32 rapidjson::Value
getFieldStates(rapidjson::Document::AllocatorType &allocator);
33 virtual void progressStage();
36 void initialiseDatasetImages(fs::path dataset_path,
size_t MAX_NUM_IMAGES,
size_t MAX_NUM_CORRECT,
size_t MIN_NUM_CORRECT);
37 void initialiseCountryImages(
size_t num_correct,
size_t total_num);
39 char current_challenge = 0;
40 void initialiseChallenge();
41 bool setNewChallenge();
42 std::set<char> challenges_remaining = {CELEB_CAPTCHAS, MUFFIN_DOG_CAPTCHAS, FREEDOM_CAPTCHAS};
43 std::vector<std::string> image_urls;
44 std::vector<std::string> image_labels;
45 std::vector<std::string> correct_images;
46 std::string challenge_text =
"";
47 std::vector<std::string> selected;
48 std::string last_round_error =
"";
49 std::vector<fs::path> challenge_sets;
bool validateStage()
validates the stage
Definition: image_captcha_stage.cpp:39
the Stage class is an abstract class that represents a stage in the game
Definition: stage.h:20
the ImageCaptchaStage class is a class that represents a image captcha stage in the game ...
Definition: image_captcha_stage.h:26
the Stage class is an abstract class that represents a stage of the game
void update(const rapidjson::Value &req)
updates the stage
Definition: image_captcha_stage.cpp:49
the GameManager class is a class that controls the flow of the game
Definition: game_manager.h:22
rapidjson::Value getFieldStates(rapidjson::Document::AllocatorType &allocator)
gets the field states
Definition: image_captcha_stage.cpp:127
ImageCaptchaStage(GameManager *gameManager)
constructor for ImageCaptchaStage
Definition: image_captcha_stage.cpp:27