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