summaryrefslogtreecommitdiff
path: root/src/model/CompetitorWithResults.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/CompetitorWithResults.h')
-rw-r--r--src/model/CompetitorWithResults.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/model/CompetitorWithResults.h b/src/model/CompetitorWithResults.h
index 2203064..a98a1e8 100644
--- a/src/model/CompetitorWithResults.h
+++ b/src/model/CompetitorWithResults.h
@@ -6,7 +6,6 @@
#include <QMap>
#include <QJsonObject>
#include <QObject>
-#include <stdexcept>
class CompetitorWithResults : public Competitor {
@@ -17,19 +16,16 @@ class CompetitorWithResults : public Competitor {
Q_PROPERTY(QString statistic READ statistic NOTIFY nStatistic)
public:
- CompetitorWithResults() : Competitor(), m_mark(""), m_medalType("") {}
- CompetitorWithResults(const CompetitorWithResults &competitor) : Competitor(competitor),
- m_mark(competitor.m_mark), m_medalType(competitor.m_medalType) {}
-
- CompetitorWithResults(const QJsonObject &competitor) : Competitor(competitor) {
- if (!competitor.contains("results")) throw invalid_argument("Competitor does not contain results.");
- QJsonObject results = competitor["results"].toObject();
- setResults(results);
- }
+ explicit CompetitorWithResults(Competitor *parent) : Competitor(parent) {}
bool setResults(const QJsonObject &results);
+ void setMark(QString mark) { this->m_mark = mark; }
+ void setMedalType(QString medalType) { this->m_medalType = medalType; }
void setStatistic(QString stat) { this->m_statistic = stat; }
+ bool setCompetitorWithResults(const QJsonObject &competitor);
+ void setCompetitorWithResults(const CompetitorWithResults &competitor);
+
QString getMark() { return this->m_mark; }
QString getMedalType() { return this->m_medalType; }
QString getStatistic() { return this->m_statistic; }