summaryrefslogtreecommitdiff
path: root/src/model/Competitor.h
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-15 20:41:08 +0200
committerOrangerot <purple@orangerot.dev>2024-08-26 11:19:38 +0200
commitdf2cd325395886868e64c4d96ba7a959ef7d204e (patch)
tree0917ed288870d4fcba4e8876682aafc4837058d9 /src/model/Competitor.h
parent87e9d4aa8b64e4a8262115f678febb241f2ac3d0 (diff)
Reworked Sport class to work with QObjects instead of JSON objects.
Diffstat (limited to 'src/model/Competitor.h')
-rw-r--r--src/model/Competitor.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/model/Competitor.h b/src/model/Competitor.h
index 1121a5b..e5b0251 100644
--- a/src/model/Competitor.h
+++ b/src/model/Competitor.h
@@ -39,8 +39,19 @@ public:
QString getName() { return this->name; }
QString getNOC() { return this->noc; }
+ void setCode(int code) { this->code = code; }
+ void setName(QString name) { this->name = name; }
+ void setNOC(QString noc) { this->noc = noc; }
+
bool setCompetitor(const QJsonObject &competitor);
+ static bool compareName(const Competitor &left, const Competitor &right) {
+ return left.name.compare(right.name) < 0;
+ }
+ static bool compareNOC(const Competitor &left, const Competitor &right) {
+ return left.noc.compare(right.noc) < 0;
+ }
+
private:
int code;
QString name;