#include "MedalWinner.h" bool MedalWinner::setMedals(const QJsonObject &medals) { if (!medals.contains("ME_GOLD") || !medals.contains("ME_SILVER") || !medals.contains("ME_BRONZE")) { throw invalid_argument("Medal object of competitor is incomplete."); } this->wonMedals = { {QString("ME_GOLD"), medals["ME_GOLD"].toString()}, {QString("ME_SILVER"), medals["ME_SILVER"].toString()}, {QString("ME_BRONZE"), medals["ME_BRONZE"].toString()} }; return true; }