Game of Ur
0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Toggle main menu visibility
Loading...
Searching...
No Matches
serialize.hpp
Go to the documentation of this file.
1
11
12
#ifndef ZOAPPSERIALIZE_H
13
#define ZOAPPSERIALIZE_H
14
15
#include <nlohmann/json.hpp>
16
17
#include "
model.hpp
"
18
20
NLOHMANN_JSON_SERIALIZE_ENUM(
PieceTypeID
, {
21
{PieceTypeID::EAGLE,
"eagle"
},
22
{PieceTypeID::ROOSTER,
"rooster"
},
23
{PieceTypeID::RAVEN,
"raven"
},
24
{PieceTypeID::STORMBIRD,
"storm-bird"
},
25
{PieceTypeID::SWALLOW,
"swallow"
},
26
});
27
29
NLOHMANN_JSON_SERIALIZE_ENUM(
RoleID
, {
30
{RoleID::BLACK,
"black"
},
31
{RoleID::WHITE,
"white"
},
32
});
33
35
NLOHMANN_JSON_SERIALIZE_ENUM(
PlayerID
, {
36
{PlayerID::PLAYER_A,
"player-a"
},
37
{PlayerID::PLAYER_B,
"player-b"
},
38
});
39
41
void
from_json(
const
nlohmann::json& json,
PieceIdentity
& pieceIdentity);
43
void
to_json(nlohmann::json& json,
const
PieceIdentity
& pieceIdentity);
44
46
void
from_json(
const
nlohmann::json& json,
GameScoreData
& gameScoreData);
48
void
to_json(nlohmann::json& json,
const
GameScoreData
& gameScoreData);
49
51
void
from_json(
const
nlohmann::json& json,
PlayerData
& playerData);
53
void
to_json(nlohmann::json& json,
const
PlayerData
& playerData);
54
55
#endif
PieceTypeID
PieceTypeID
Enum listing the different types of pieces present in the game.
Definition
piece_type_id.hpp:22
PlayerID
PlayerID
The two players playing the game, as known to GameOfUrModel.
Definition
model.hpp:40
RoleID
RoleID
A value representing the various roles (or sets, if preferred) possible in this game.
Definition
role_id.hpp:20
model.hpp
The class containing the interface to the data model for the whole game (Game of Ur).
GameScoreData
Data returned by GameOfUrModel when queried for scores.
Definition
model.hpp:151
PieceIdentity
Data uniquely identifying a piece used in the game.
Definition
piece.hpp:29
PlayerData
Data returned by GameOfUrModel when queried about a player.
Definition
model.hpp:229
src
app
game_of_ur_data
serialize.hpp
Generated on
for Game of Ur by
1.17.0