Eile Mit Weile
Loading...
Searching...
No Matches
join_game_request Class Reference

This class represents a join_game_request from the client. More...

#include <join_game_request.hpp>

Inheritance diagram for join_game_request:
ClientRequest Serializable

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::DocumentToJson () const
 

Static Public Member Functions

static join_game_requestFromJson (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ join_game_request() [1/2]

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

◆ join_game_request() [2/2]

join_game_request::join_game_request ( ClientRequest::BaseClassProperties  props,
std::string  name 
)
private

private constructor for serialization

Member Function Documentation

◆ FromJson()

join_game_request * join_game_request::FromJson ( const rapidjson::Value json)
static

creates a join_game_request from a json object

◆ GetPlayerName()

std::string join_game_request::GetPlayerName ( ) const

getter for the player name

◆ WriteIntoJson()

void join_game_request::WriteIntoJson ( rapidjson::Value json,
rapidjson::Document::AllocatorType &  allocator 
) const
overridevirtual

writes the join_game_request into a json object

Reimplemented from ClientRequest.

Member Data Documentation

◆ _player_name

std::string join_game_request::_player_name
private

the player name (input by player)

◆ undefined_game_id

std::string join_game_request::undefined_game_id {""}
staticprivate

the undefined game id that serves as an empty placeholder for the call of ClientRequest::CreateBaseClassProperties in the public constructor


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