Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
gameinfo.h
1#ifndef CAVOKE_CLIENT_GAMEINFO_H
2#define CAVOKE_CLIENT_GAMEINFO_H
3
4#include <QtCore/QJsonArray>
5#include <QtCore/QJsonObject>
6#include <QtCore/QString>
7struct GameInfo {
8public:
9 GameInfo();
10 GameInfo(QString _id,
11 QString _display_name,
12 QString _description,
13 int _players_num,
14 QVector<QString> _role_names);
15
16 void read(const QJsonObject &json);
17 void write(QJsonObject &json) const;
18
19 QString id;
20 QString display_name;
21 QString description;
22 int players_num = 0;
23 QVector<QString> role_names;
24
25private:
26 static inline const QString ID = "id";
27 static inline const QString DISPLAY_NAME = "display_name";
28 static inline const QString DESCRIPTION = "description";
29 static inline const QString PLAYERS_NUM = "players_num";
30 static inline const QString ROLE_NAMES = "role_names";
31};
32
33#endif // CAVOKE_CLIENT_GAMEINFO_H