Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
user.cpp
1#include "user.h"
2
3User::User() = default;
4
5User::User(QString _display_name, QString _user_id)
6 : display_name(std::move(_display_name)), user_id(std::move(_user_id)) {
7}
8
9void User::read(const QJsonObject &json) {
10 if (json.contains(DISPLAY_NAME) && json[DISPLAY_NAME].isString()) {
11 display_name = json[DISPLAY_NAME].toString();
12 }
13 if (json.contains(USER_ID) && json[USER_ID].isString()) {
14 user_id = json[USER_ID].toString();
15 }
16}
17
18void User::write(QJsonObject &json) {
19 assert(false); // Should not be used
20}