Eile Mit Weile
Loading...
Searching...
No Matches
join_game_request.hpp
1#ifndef EILE_MIT_WEILE_JOIN_GAME_REQUEST_HPP
2#define EILE_MIT_WEILE_JOIN_GAME_REQUEST_HPP
4#include <string>
5#include <string>
6#include <utility>
7#include "server/PlayerManager.hpp"
8#include "ClientRequest.hpp"
9#include "rapidjson/document.h"
10
19
20 public:
21 join_game_request(std::string player_id, std::string name);
22 [[nodiscard]] std::string GetPlayerName() const;
23 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator) const override;
24 static join_game_request* FromJson(const rapidjson::Value& json);
26 private:
27 std::string _player_name;
28 static std::string undefined_game_id;
32 join_game_request(BaseClassProperties, std::string name);
33};
34
35
36
37
38#endif //EILE_MIT_WEILE_JOIN_GAME_REQUEST_HPP
Base class for all requests that are being sent from the client to the server.
Definition ClientRequest.hpp:38
This class represents a join_game_request from the client.
Definition join_game_request.hpp:18
std::string _player_name
Definition join_game_request.hpp:27
join_game_request(std::string player_id, std::string name)
Definition join_game_request.cpp:6
static join_game_request * FromJson(const rapidjson::Value &json)
Definition join_game_request.cpp:22
std::string GetPlayerName() const
Definition join_game_request.cpp:11
static std::string undefined_game_id
Definition join_game_request.hpp:3
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition join_game_request.cpp:15
Holds the properties that are common to all ClientRequest subclasses.
Definition ClientRequest.hpp:63