summaryrefslogtreecommitdiff
path: root/src/model/CompetitorWithResults.cpp
blob: d29441d43e59b4dbdc8325dc5c92353773719c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#include "CompetitorWithResults.h"

bool CompetitorWithResults::setResults(const QJsonObject &results) {
    if (!results.contains("mark")
        || !results.contains("medalType")) {
        throw invalid_argument("Results object of competitor is incomplete.");
    }

    this->results = {
            {QString("mark"), results["mark"].toString()},
            {QString("medalType"), results["medalType"].toString()}
    };
    return true;
}