blob: d39d1343697864788ea0b47ec984fdcc538ad607 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include "Competitor.h"
bool Competitor::setCompetitor(const QJsonObject &competitor) {
if (!competitor.contains("code")
|| !competitor.contains("name")
|| !competitor.contains("noc")) {
throw invalid_argument("Not a competitor object.");
}
this->code = competitor["code"].toInt();
this->name = competitor["name"].toString();
this->noc = competitor["noc"].toString();
return true;
}
|