1#ifndef EILE_MIT_WEILE_SERVERRESPONSE_HPP
2#define EILE_MIT_WEILE_SERVERRESPONSE_HPP
5#include <unordered_map>
7#include "common/serialization/serializable.hpp"
59 [[nodiscard]] std::string
GetGameId()
const;
69 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator)
const override;
71 virtual void Process()
const {};
ResponseType
Identifier for the different server responses.
Definition ServerResponse.hpp:17
Abstract Base Class for a serializable object.
Definition serializable.hpp:17
Base class for all messages sent from the server to the client.
Definition ServerResponse.hpp:33
static const std::unordered_map< ResponseType, std::string > _response_type_to_string
Definition ServerResponse.hpp:14
std::string _game_id
Definition ServerResponse.hpp:42
ResponseType _type
Definition ServerResponse.hpp:43
static BaseClassProperties ExtractBaseClassProperties(const rapidjson::Value &json)
Definition ServerResponse.cpp:42
static BaseClassProperties CreateBaseClassProperties(ResponseType type, const std::string &game_id)
Definition ServerResponse.cpp:35
ServerResponse(const BaseClassProperties &)
Definition ServerResponse.cpp:20
std::string GetGameId() const
Definition ServerResponse.cpp:29
ResponseType GetType() const
Definition ServerResponse.cpp:25
static ServerResponse * FromJson(const rapidjson::Value &json)
Definition ServerResponse.cpp:57
static const std::unordered_map< std::string, ResponseType > _string_to_response_type
Definition ServerResponse.hpp:8
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition ServerResponse.cpp:75
Contains the properties that are common to all ServerResponses.
Definition ServerResponse.hpp:48