Wizard
Software Engineering Project - Wizard
Loading...
Searching...
No Matches
join_game_request.h
1//
2// Created by Manuel on 29.01.2021.
3//
4
5#ifndef WIZARD_JOIN_GAME_REQUEST_H
6#define WIZARD_JOIN_GAME_REQUEST_H
7
8
9#include <string>
10#include "client_request.h"
11#include "../../../../rapidjson/include/rapidjson/document.h"
12
14
15private:
16 std::string _player_name;
17
18 static std::string undefined_game_id;
19 /*
20 * Private constructor for deserialization
21 */
23
24public:
25
26 [[nodiscard]] std::string get_player_name() const { return this->_player_name; }
27 /*
28 * Constructor to join any game
29 */
30 join_game_request(std::string player_id, std::string name);
31
32 /*
33 * Constructor to join a specific game
34 */
35 join_game_request(std::string game_id, std::string player_id, std::string name);
36
37 virtual void write_into_json(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator) const override;
38 static join_game_request* from_json(const rapidjson::Value& json);
39};
40
41
42#endif //WIZARD_JOIN_GAME_REQUEST_H
Definition client_request.h:30
Definition join_game_request.h:13
Definition client_request.h:33