|
Eile Mit Weile
|
This class represents a join_game_request from the client. More...
#include <join_game_request.hpp>
Public Member Functions | |
| join_game_request (std::string player_id, std::string name) | |
| std::string | GetPlayerName () const |
| void | WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override |
Public Member Functions inherited from ClientRequest | |
| RequestType | GetType () const |
| std::string | GetReqId () const |
| std::string | GetGameId () const |
| std::string | GetPlayerId () const |
Public Member Functions inherited from Serializable | |
| virtual rapidjson::Document * | ToJson () const |
Static Public Member Functions | |
| static join_game_request * | FromJson (const rapidjson::Value &json) |
Private Member Functions | |
| join_game_request (BaseClassProperties, std::string name) | |
Private Attributes | |
| std::string | _player_name |
Static Private Attributes | |
| static std::string | undefined_game_id {""} |
Additional Inherited Members | |
Static Public Attributes inherited from ClientRequest | |
| static const std::unordered_map< std::string, RequestType > | _string_to_request_type |
| static const std::unordered_map< RequestType, std::string > | _request_type_to_string |
Protected Member Functions inherited from ClientRequest | |
| ClientRequest (const BaseClassProperties &) | |
Static Protected Member Functions inherited from ClientRequest | |
| static BaseClassProperties | CreateBaseClassProperties (RequestType type, std::string req_id, std::string &player_id, std::string &game_id) |
| static BaseClassProperties | ExtractBaseClassProperties (const rapidjson::Value &json) |
Protected Attributes inherited from ClientRequest | |
| RequestType | _type |
| std::string | _req_id |
| std::string | _player_id |
| std::string | _game_id |
This class represents a join_game_request from the client.
most importatly it contains the player name and the game id and defines a WriteIntoJson and FromJson method.
| join_game_request::join_game_request | ( | std::string | player_id, |
| std::string | name | ||
| ) |
public constructor for a join_game_request with a player name and a game id
|
private |
private constructor for serialization
|
static |
creates a join_game_request from a json object
| std::string join_game_request::GetPlayerName | ( | ) | const |
getter for the player name
|
overridevirtual |
writes the join_game_request into a json object
Reimplemented from ClientRequest.
|
private |
the player name (input by player)
|
staticprivate |
the undefined game id that serves as an empty placeholder for the call of ClientRequest::CreateBaseClassProperties in the public constructor