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 22:19:42 +0200
commit100e73ec28dbc1f307c540cbd4b5a04dfe5922f8 (patch)
tree20ec2b68ae44f7e0e0cec62b605696301898072e /src/model/SportModel.h
parentb0063e96410ff0c407e2daead4cf53252568b542 (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 5c3bad1..808a1cc 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);
@@ -77,8 +74,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);