summaryrefslogtreecommitdiff
path: root/src/model/Competitor.h
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-12 22:09:50 +0200
committerSteru <jerrydream111@gmail.com>2024-08-12 22:09:50 +0200
commit94fb05a764c1d0d1f275f29ecd21686d835f9768 (patch)
tree283d60ee309ca35132c3cd64b55d018cc2cbfc87 /src/model/Competitor.h
parentc539242efa11538e5e3f91bf3ff2f0de1c526bed (diff)
Created Model for competitors.
Diffstat (limited to 'src/model/Competitor.h')
-rw-r--r--src/model/Competitor.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/model/Competitor.h b/src/model/Competitor.h
new file mode 100644
index 0000000..919c2fa
--- /dev/null
+++ b/src/model/Competitor.h
@@ -0,0 +1,39 @@
+
+#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
+#define ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
+
+#include <QString>
+#include <QMap>
+#include <QJsonObject>
+#include <stdexcept>
+
+using namespace std;
+
+class Competitor {
+
+public:
+ Competitor(const Competitor &competitor) {
+ this->code = competitor.code;
+ this->name = competitor.name;
+ this->noc = competitor.noc;
+ }
+
+ Competitor(const QJsonObject &competitor) {
+ setCompetitor(competitor);
+ }
+
+ QString getCode() { return this->code; }
+ QString getName() { return this->name; }
+ QString getNOC() { return this->noc; }
+
+ bool setCompetitor(const QJsonObject &competitor);
+
+private:
+ QString code;
+ QString name;
+ QString noc;
+
+};
+
+
+#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H