summaryrefslogtreecommitdiff
path: root/src/model/SportModel.h
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-16 22:19:42 +0200
committerSteru <jerrydream111@gmail.com>2024-08-16 23:58:46 +0200
commit88b1b119dfa35f36b64d81dbe6c84f46d86455c5 (patch)
tree864ba9c747ef86d61b6aeb01e8985676f906bd3e /src/model/SportModel.h
parentf24b4dcbd11336dabfd146c656e2437e4393b225 (diff)
Compacted competitors into one object, deleted API class (now in sportmodel).
Diffstat (limited to 'src/model/SportModel.h')
-rw-r--r--src/model/SportModel.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/model/SportModel.h b/src/model/SportModel.h
index 5ad289c..a971b50 100644
--- a/src/model/SportModel.h
+++ b/src/model/SportModel.h
@@ -1,7 +1,5 @@
#pragma once
-#include "MedalWinner.h"
-#include "CompetitorWithResults.h"
#include <QAbstractListModel>
#include <QNetworkAccessManager>
#include <qcontainerfwd.h>
@@ -40,23 +38,22 @@ public:
virtual QHash<int, QByteArray> roleNames() const override;
set<QString> getCategories();
- QList<CompetitorWithResults*> getCompetitorsByCategory(QString category); // TODO ref instead of obj
- QList<MedalWinner*> getCompetitorsWithMedal(); // TODO ref instead of obj
+ map<QString, map<QString, int>> getMedalsOfCompetitors();
// filter to change the current competitor list
- void lastName(QList<Competitor*> &competitors); // TODO ref instead of obj
- void filterByName(QList<Competitor*> &competitors, QString name); // TODO ref instead of obj
- void filterByCountry(QList<Competitor*> &competitors, QString nocShort); // TODO ref instead of obj
+ void lastName(QList<Competitor*> &competitors);
+ void filterByName(QList<Competitor*> &competitors, QString name);
+ void filterByCountry(QList<Competitor*> &competitors, QString nocShort);
// sort functions to change the order of the current competitor list
- void sortByName(QList<Competitor*> &competitors); // TODO ref instead of obj
- void sortByCountry(QList<Competitor*> &competitors); // TODO ref instead of obj
- void sortByResult(QList<CompetitorWithResults*> &competitors); // TODO ref instead of obj
- void sortByMedals(QList<MedalWinner*> &competitors); // TODO ref instead of obj
- void reverseOrder(QList<Competitor*> &competitors); // TODO ref instead of obj
+// void sortByName(QList<Competitor*> &competitors);
+// void sortByCountry(QList<Competitor*> &competitors);
+// void sortByResult(QList<Competitor*> &competitors);
+// void sortByMedals(QList<Competitor*> &competitors);
+ void reverseOrder(QList<Competitor*> &competitors);
// statistic function
- void addRelativeToFirst(QList<CompetitorWithResults*> &competitors); // TODO ref instead of obj
+ void addRelativeToFirst(QList<Competitor*> &competitors);
QString discipline() const;
void setDiscipline(const QString &discipline);
@@ -80,8 +77,6 @@ private:
void filterCompetitors(QList<Competitor*> &competitors, QString filter); // TODO ref instead of obj
- QJsonObject createCompetitorWithMedals(QJsonObject medalComp);
-
// function for statistic calculation
float calcRelativeStat(QString ref, QString val);