Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
roominfo.h
1#ifndef CAVOKE_ROOMINFO_H
2#define CAVOKE_ROOMINFO_H
3
4#include <QtCore/QJsonArray>
5#include <QtCore/QJsonObject>
6#include <QtCore/QString>
7#include <QtCore/QVector>
8#include "sessioninfo.h"
9#include "user.h"
10struct RoomInfo {
11public:
12 RoomInfo();
13 RoomInfo(QString _room_id,
14 QString _display_name,
15 QString _invite_code,
16 QString _session_id,
17 QString _host_id,
18 QVector<User> _members,
19 SessionInfo _session);
20
21 void read(const QJsonObject &json);
22 void write(QJsonObject &json) const;
23
24 QString room_id;
25 QString display_name;
26 QString invite_code;
27 QString session_id;
28 QString host_id;
29 QVector<User> members;
30 SessionInfo session{};
31 bool isSessionAlive = false;
32 bool isHost = false;
33
34private:
35 static inline const QString ROOM_ID = "room_id";
36 static inline const QString DISPLAY_NAME = "display_name";
37 static inline const QString INVITE_CODE = "invite_code";
38 static inline const QString SESSION_ID = "session_id";
39 static inline const QString HOST_ID = "host_id";
40 static inline const QString MEMBERS = "members";
41 static inline const QString SESSION = "session";
42};
43
44#endif // CAVOKE_ROOMINFO_H