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

the ExtrasStage class is a class that represents a extras stage in the game More...

#include <extras_stage.h>

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

Public Member Functions

 ExtrasStage (GameManager *gameManager)
 constructor for ExtrasStage More...
 
bool validateStage ()
 validates the stage More...
 
void update (const rapidjson::Value &req)
 updates the stage More...
 
rapidjson::Value getFieldStates (rapidjson::Document::AllocatorType &allocator)
 gets 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 missingDobError = "Please enter your date of birth before continuing."
 
std::string tooYoungError = "You are too young to sign up. Please review our terms & conditions before continuing."
 
std::string tooOldError = "You are too old to sign up. Please review our terms & conditions before continuing."
 
std::string uncheckedTCsError = "Please review and accept our terms & conditions before continuing."
 

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 ExtrasStage class is a class that represents a extras stage in the game

contains concrete stage implementions for the extras stage in the game

Constructor & Destructor Documentation

◆ ExtrasStage()

ExtrasStage::ExtrasStage ( GameManager gameManager)

constructor for ExtrasStage

Parameters
gameManagerthe game manager object owning this stage

Member Function Documentation

◆ getFieldStates()

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

gets the field states

gets the field states by creating a rapidjson object containing the field states

Parameters
allocatorthe rapidjson allocator
Returns
the rapidjson object containing the field states Stage::createFieldState

Implements Stage.

◆ update()

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

updates the stage

updates the stage by updating the field values

Parameters
reqthe request object containing the field to update and the new value

Implements Stage.

◆ validateStage()

bool ExtrasStage::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: