1#include "validationresult.h"
3ValidationResult::ValidationResult() =
default;
4ValidationResult::ValidationResult(
bool _success, QString _message)
5 : success(_success), message(std::move(_message)) {
8void ValidationResult::read(
const QJsonObject &json) {
9 if (json.contains(SUCCESS) && json[SUCCESS].isBool()) {
10 success = json[SUCCESS].toBool();
13 message =
"Now you can start the game!";
15 if (!success && json.contains(MESSAGE) && json[MESSAGE].isString()) {
16 message = json[MESSAGE].toString();
20void ValidationResult::write(QJsonObject &json)
const {
21 json[SUCCESS] = success;
23 json[MESSAGE] = message;