10 #include "../game_manager.h" 24 void update(
const rapidjson::Value &req);
25 rapidjson::Value
getFieldStates(rapidjson::Document::AllocatorType &allocator);
28 std::string lengthError =
"Username must be between 8 and 26 characters in length.";
29 std::string invalidCharError =
"Invalid characters in username.";
30 std::string takenError =
"Username is already taken.";
32 std::string tooShortError =
"Password must be 8 or more characters.";
33 std::string missingDigitError =
"Password must include atleast one digit (0-9).";
34 std::string missingUppercaseError =
"Password must include atleast one uppercase character (A-Z).";
35 std::string missingLowercaseError =
"Password must include atleast one lowercase character (a-z).";
36 std::string missingSpecialError =
"Password must include atleast one special character.";
37 std::string missingPrimeError =
"Password must include atleast one prime number.";
38 std::string missingInitialsError =
"Password must include your initials.";
39 std::string missingColourError =
"Password must include a colour.";
40 std::string missingRomanNumError =
"Pasword must include atleast one Roman numeral.";
41 std::string notPalindromeError =
"Password must be a palindrome.";
42 std::string tooLongError =
"Password must be 20 or less characters.";
45 std::string digits =
"0123456789";
46 std::string lowercaseChars =
"abcdefghijklmnopqrstuvwxyz";
47 std::string uppercaseChars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
48 std::string specialChars =
"!@#$%^&*()-_=+[]{}\\|;:'\",.<>/?`~";
49 std::string romanNumerals =
"IVXLCDM";
52 bool metTooShort =
false;
53 bool metMissingDigit =
false;
54 bool metMissingUppercase =
false;
55 bool metMissingLowercase =
false;
56 bool metMissingSpecialChar =
false;
57 bool metMissingPrime =
false;
58 bool metMissingInitials =
false;
59 bool metMissingColour =
false;
60 bool metMissingRomanNumeral =
false;
61 bool metNotPalindrome =
false;
62 bool metTooLong =
false;
66 void updateErrors(
const std::string &field);
67 std::string username =
"";
68 std::string password =
"";
CredentialsStage(GameManager *gameManager)
constructor for CredentialsStage
Definition: credentials_stage.cpp:23
void update(const rapidjson::Value &req)
updates the stage
Definition: credentials_stage.cpp:238
the Stage class is an abstract class that represents a stage in the game
Definition: stage.h:20
rapidjson::Value getFieldStates(rapidjson::Document::AllocatorType &allocator)
creates the JSON object for the field states
Definition: credentials_stage.cpp:256
bool validateStage()
validates the stage
Definition: credentials_stage.cpp:37
the Stage class is an abstract class that represents a stage of the game
the ExtrasStage class is the class that represents the DOB and T&Cs stage of the game ...
the GameManager class is a class that controls the flow of the game
Definition: game_manager.h:22
the CredetialsStage class is a class that represents the credentials stage in the game ...
Definition: credentials_stage.h:19