2024-08-12 22:09:50 +02:00
|
|
|
|
|
|
|
#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.");
|
|
|
|
}
|
|
|
|
|
2024-08-15 19:21:02 +02:00
|
|
|
this->code = competitor["code"].toInt();
|
2024-08-12 22:09:50 +02:00
|
|
|
this->name = competitor["name"].toString();
|
|
|
|
this->noc = competitor["noc"].toString();
|
|
|
|
return true;
|
|
|
|
}
|