summaryrefslogtreecommitdiff
path: root/src/discipline/Sport.h
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-04 22:56:15 +0200
committerSteru <jerrydream111@gmail.com>2024-08-04 22:56:15 +0200
commit77f8836508a4c28c7c6c1352ff891c5d36d00237 (patch)
treec32cacf93e74ae546fe225e8f8cb351768ed4b90 /src/discipline/Sport.h
parent0445396ffa371cdc546d7198efc0677ad42b7aa5 (diff)
Added method to get medal winners. Adjusted sort result method to also work with the medal winners.
Diffstat (limited to 'src/discipline/Sport.h')
-rw-r--r--src/discipline/Sport.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/discipline/Sport.h b/src/discipline/Sport.h
index 78968fe..9156b82 100644
--- a/src/discipline/Sport.h
+++ b/src/discipline/Sport.h
@@ -22,11 +22,12 @@ public:
set<QString> getCategories();
QJsonArray getCompetitorsByCategory(QString category);
+ QJsonArray getCompetitorsWithMedal();
// filter to change the current competitor array
- void lastName(QJsonArray& competitors);
- void filterByName(QJsonArray& competitors, QString name);
- void filterByCountry(QJsonArray& competitors, QString nocShort);
+ void lastName(QJsonArray &competitors);
+ void filterByName(QJsonArray &competitors, QString name);
+ void filterByCountry(QJsonArray &competitors, QString nocShort);
// sort functions to change the order of the current competitor array
void sortByName(QJsonArray &competitors);
@@ -58,11 +59,24 @@ private:
* - medalType
* - irk
* [- winnerLoserTie] (only if provided in the discipline?)
+ *
+ * Analysis of where to find the medal winners:
+ *
+ * Search for ... in category name.
+ * - "Bronze"
+ * - "Gold"
+ * - "Final"
+ *
+ * ! ATTENTION !
+ * When searching for "Final" there might be "Final A", "Final B", etc.
+ * The results will only be in ONE of these categories!
+ * -> which is good... cause then we can count occurences.
*/
QJsonObject discipline;
- void filterCompetitors(QJsonArray& competitors, QString attribute, QString filter);
+ void filterCompetitors(QJsonArray &competitors, QString attribute, QString filter);
void sortCompetitors(QJsonArray &competitors, function<bool (const QJsonValue &left, const QJsonValue &right)> compare);
+ QJsonObject createCompetitorWithMedals(QJsonObject medalComp);
};