From 100e73ec28dbc1f307c540cbd4b5a04dfe5922f8 Mon Sep 17 00:00:00 2001 From: Steru Date: Fri, 16 Aug 2024 22:19:42 +0200 Subject: Compacted competitors into one object, deleted API class (now in sportmodel). --- src/model/SportModel.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/model/SportModel.h') 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 #include #include @@ -40,23 +38,22 @@ public: virtual QHash roleNames() const override; set getCategories(); - QList getCompetitorsByCategory(QString category); // TODO ref instead of obj - QList getCompetitorsWithMedal(); // TODO ref instead of obj + map> getMedalsOfCompetitors(); // filter to change the current competitor list - void lastName(QList &competitors); // TODO ref instead of obj - void filterByName(QList &competitors, QString name); // TODO ref instead of obj - void filterByCountry(QList &competitors, QString nocShort); // TODO ref instead of obj + void lastName(QList &competitors); + void filterByName(QList &competitors, QString name); + void filterByCountry(QList &competitors, QString nocShort); // sort functions to change the order of the current competitor list - void sortByName(QList &competitors); // TODO ref instead of obj - void sortByCountry(QList &competitors); // TODO ref instead of obj - void sortByResult(QList &competitors); // TODO ref instead of obj - void sortByMedals(QList &competitors); // TODO ref instead of obj - void reverseOrder(QList &competitors); // TODO ref instead of obj +// void sortByName(QList &competitors); +// void sortByCountry(QList &competitors); +// void sortByResult(QList &competitors); +// void sortByMedals(QList &competitors); + void reverseOrder(QList &competitors); // statistic function - void addRelativeToFirst(QList &competitors); // TODO ref instead of obj + void addRelativeToFirst(QList &competitors); QString discipline() const; void setDiscipline(const QString &discipline); @@ -77,8 +74,6 @@ private: void filterCompetitors(QList &competitors, QString filter); // TODO ref instead of obj - QJsonObject createCompetitorWithMedals(QJsonObject medalComp); - // function for statistic calculation float calcRelativeStat(QString ref, QString val); -- cgit v1.2.3