|
Eile Mit Weile
|
This class represents a move_figure_request from the client. More...
#include <move_figure_request.hpp>
Public Member Functions | |
| move_figure_request (std::string game_id, std::string player_id, unsigned figure_idx, unsigned space_id) | |
| unsigned | GetFigureId () const |
| unsigned | GetSpaceId () const |
| void | WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override |
Public Member Functions inherited from ClientRequest | |
| RequestType | GetType () const |
| std::string | GetReqId () const |
| std::string | GetGameId () const |
| std::string | GetPlayerId () const |
Public Member Functions inherited from Serializable | |
| virtual rapidjson::Document * | ToJson () const |
Static Public Member Functions | |
| static move_figure_request * | FromJson (const rapidjson::Value &json) |
Private Member Functions | |
| move_figure_request (BaseClassProperties, unsigned figure_idx, unsigned space_id) | |
Private Attributes | |
| unsigned | _figure_idx |
| unsigned | _space_idx |
Additional Inherited Members | |
Static Public Attributes inherited from ClientRequest | |
| static const std::unordered_map< std::string, RequestType > | _string_to_request_type |
| static const std::unordered_map< RequestType, std::string > | _request_type_to_string |
Protected Member Functions inherited from ClientRequest | |
| ClientRequest (const BaseClassProperties &) | |
Static Protected Member Functions inherited from ClientRequest | |
| static BaseClassProperties | CreateBaseClassProperties (RequestType type, std::string req_id, std::string &player_id, std::string &game_id) |
| static BaseClassProperties | ExtractBaseClassProperties (const rapidjson::Value &json) |
Protected Attributes inherited from ClientRequest | |
| RequestType | _type |
| std::string | _req_id |
| std::string | _player_id |
| std::string | _game_id |
This class represents a move_figure_request from the client.
most importatly it contains the figure id and the space id and defines a WriteIntoJson and FromJson method.
| move_figure_request::move_figure_request | ( | std::string | game_id, |
| std::string | player_id, | ||
| unsigned | figure_idx, | ||
| unsigned | space_id | ||
| ) |
public constructor for a move_figure_request with a player id, a figure id and a space id
|
private |
private constructor for serialization.
|
static |
creates a move_figure_request from a json object
| unsigned move_figure_request::GetFigureId | ( | ) | const |
getter for the figure id, see _figure_idx
| unsigned move_figure_request::GetSpaceId | ( | ) | const |
getter for the space id, see _space_idx
|
overridevirtual |
writes the move_figure_request into a json object
Reimplemented from ClientRequest.
|
private |
Value from 0 to 3 denotes which figure of the current player is to be moved. if the id is 4, it communicates that no figure is movable.
|
private |
Denotes the index of the space the figure is to be moved to. See Board for which index represents which space.