Login Languish
name_stage.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include "stage.h"
11 #include "../game_manager.h"
12 
17 class NameStage : public Stage {
18 public:
19  NameStage(GameManager *gameManager);
20 
21  bool validateStage();
22  void update(const rapidjson::Value &req);
23  rapidjson::Value getFieldStates(rapidjson::Document::AllocatorType &allocator);
24 
25  // name error messages
26  std::string fNameLengthError = "First name must be less than 13 characters.";
27  std::string fNameInvalidCharError = "Invalid characters in first name.";
28  std::string lNameLengthError = "Last name must be less than 13 characters.";
29  std::string lNameInvalidCharError = "Invalid characters in last name.";
30 
31 private:
32  void updateErrors(const std::string &field);
33 
34  std::string first_name = "";
35  std::string last_name = "";
36 };
the Stage class is an abstract class that represents a stage in the game
Definition: stage.h:20
the NameStage class is a class that represents a name stage in the game
Definition: name_stage.h:17
the Stage class is an abstract class that represents a stage of the game
bool validateStage()
validates the stage
Definition: name_stage.cpp:28
void update(const rapidjson::Value &req)
updates the stage
Definition: name_stage.cpp:76
rapidjson::Value getFieldStates(rapidjson::Document::AllocatorType &allocator)
gets the field states
Definition: name_stage.cpp:93
NameStage(GameManager *gameManager)
constructor for NameStage
Definition: name_stage.cpp:14
the GameManager class is a class that controls the flow of the game
Definition: game_manager.h:22