Eile Mit Weile
Loading...
Searching...
No Matches
FullStateResponse.hpp
1#ifndef EILE_MIT_WEILE_FULLSTATERESPONSE_HPP
2#define EILE_MIT_WEILE_FULLSTATERESPONSE_HPP
3
4#include "ServerResponse.hpp"
5#include "common/gameState/GameState.hpp"
6
7//own includes:
8#include <string>
9#include "rapidjson/document.h"
10
25private:
26 rapidjson::Value* _state_json{};
31 FullStateResponse(BaseClassProperties props, rapidjson::Value* state_json);
32
33public:
34
38 FullStateResponse(std::string game_id, const GameState& state);
39
44
48 [[nodiscard]] rapidjson::Value* GetStateJson() const;
49
53 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator) const override;
54
58 static FullStateResponse* FromJson(const rapidjson::Value& json);
59
60#ifdef EILE_MIT_WEILE_CLIENT
70 void Process() const override;
71#endif
72
73};
74
75
76#endif //EILE_MIT_WEILE_FULLSTATERESPONSE_HPP
ServerResponse that communicates the full state of the game to all players after any update to the Ga...
Definition FullStateResponse.hpp:24
~FullStateResponse()
Definition FullStateResponse.cpp:38
rapidjson::Value * _state_json
Definition FullStateResponse.hpp:26
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition FullStateResponse.cpp:23
rapidjson::Value * GetStateJson() const
Definition FullStateResponse.cpp:45
FullStateResponse(BaseClassProperties props, rapidjson::Value *state_json)
Definition FullStateResponse.cpp:11
static FullStateResponse * FromJson(const rapidjson::Value &json)
Definition FullStateResponse.cpp:29
Holds the state of one game.
Definition GameState.hpp:22
Base class for all messages sent from the server to the client.
Definition ServerResponse.hpp:33