Login Languish
Public Member Functions | Public Attributes | List of all members
CredentialsStage Class Reference

the CredetialsStage class is a class that represents the credentials stage in the game More...

#include <credentials_stage.h>

Inheritance diagram for CredentialsStage:
Inheritance graph
[legend]
Collaboration diagram for CredentialsStage:
Collaboration graph
[legend]

Public Member Functions

 CredentialsStage (GameManager *gameManager)
 constructor for CredentialsStage More...
 
bool validateStage ()
 validates the stage More...
 
void update (const rapidjson::Value &req)
 updates the stage More...
 
rapidjson::Value getFieldStates (rapidjson::Document::AllocatorType &allocator)
 creates the JSON object for the field states More...
 
- Public Member Functions inherited from Stage
std::vector< std::string > getFieldErrors (std::string field)
 gets the field errors for a given field More...
 
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 void progressStage ()
 
bool isFieldDisabled (const std::string &field)
 

Public Attributes

std::string lengthError = "Username must be between 8 and 26 characters in length."
 
std::string invalidCharError = "Invalid characters in username."
 
std::string takenError = "Username is already taken."
 
std::string tooShortError = "Password must be 8 or more characters."
 
std::string missingDigitError = "Password must include atleast one digit (0-9)."
 
std::string missingUppercaseError = "Password must include atleast one uppercase character (A-Z)."
 
std::string missingLowercaseError = "Password must include atleast one lowercase character (a-z)."
 
std::string missingSpecialError = "Password must include atleast one special character."
 
std::string missingPrimeError = "Password must include atleast one prime number."
 
std::string missingInitialsError = "Password must include your initials."
 
std::string missingColourError = "Password must include a colour."
 
std::string missingRomanNumError = "Pasword must include atleast one Roman numeral."
 
std::string notPalindromeError = "Password must be a palindrome."
 
std::string tooLongError = "Password must be 20 or less characters."
 
std::string digits = "0123456789"
 
std::string lowercaseChars = "abcdefghijklmnopqrstuvwxyz"
 
std::string uppercaseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
std::string specialChars = "!@#$%^&*()-_=+[]{}\\|;:'\",.<>/?`~"
 
std::string romanNumerals = "IVXLCDM"
 
bool metTooShort = false
 
bool metMissingDigit = false
 
bool metMissingUppercase = false
 
bool metMissingLowercase = false
 
bool metMissingSpecialChar = false
 
bool metMissingPrime = false
 
bool metMissingInitials = false
 
bool metMissingColour = false
 
bool metMissingRomanNumeral = false
 
bool metNotPalindrome = false
 
bool metTooLong = false
 

Additional Inherited Members

- Protected Member Functions inherited from Stage
 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 inherited from Stage
GameManagergm
 
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
 

Detailed Description

the CredetialsStage class is a class that represents the credentials stage in the game

contains concrete stage implementions for the credentials stage in the game

Constructor & Destructor Documentation

◆ CredentialsStage()

CredentialsStage::CredentialsStage ( GameManager gameManager)

constructor for CredentialsStage

Parameters
gameManagerthe game manager object owning this stage

Member Function Documentation

◆ getFieldStates()

rapidjson::Value CredentialsStage::getFieldStates ( rapidjson::Document::AllocatorType &  allocator)
virtual

creates the JSON object for the field states

creates the rapidjson::Value for the aggregated field states

Parameters
allocatorThe rapidjson::Document::AllocatorType object used to allocate memory for the JSON objects.
Returns
the field states Stage::createFieldState

Implements Stage.

◆ update()

void CredentialsStage::update ( const rapidjson::Value &  req)
virtual

updates the stage

updates the stage using the given request parameters

Parameters
reqthe request to update the stage with

Implements Stage.

◆ validateStage()

bool CredentialsStage::validateStage ( )
virtual

validates the stage

validates the stage by checking if the requirements are met

Returns
true if the stage is valid, false otherwise

Implements Stage.


The documentation for this class was generated from the following files: