summaryrefslogtreecommitdiff
path: root/src/model/CompetitorWithResults.h
blob: a98a1e8544f461802be11343f214f8cf2f1fb792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

#pragma once

#include "Competitor.h"
#include <QString>
#include <QMap>
#include <QJsonObject>
#include <QObject>

class CompetitorWithResults : public Competitor {

     Q_OBJECT

     Q_PROPERTY(QString mark READ mark NOTIFY nMark)
     Q_PROPERTY(QString medalType READ medalType NOTIFY nMedalType)
     Q_PROPERTY(QString statistic READ statistic NOTIFY nStatistic)

public:
    explicit CompetitorWithResults(Competitor *parent) : Competitor(parent) {}

    bool setResults(const QJsonObject &results);
    void setMark(QString mark) { this->m_mark = mark; }
    void setMedalType(QString medalType) { this->m_medalType = medalType; }
    void setStatistic(QString stat) { this->m_statistic = stat; }

    bool setCompetitorWithResults(const QJsonObject &competitor);
    void setCompetitorWithResults(const CompetitorWithResults &competitor);

    QString getMark() { return this->m_mark; }
    QString getMedalType() { return this->m_medalType; }
    QString getStatistic() { return this->m_statistic; }

    static bool compare(CompetitorWithResults lComp, CompetitorWithResults rComp);

private:
    QString m_mark;
    QString m_medalType;
    QString m_statistic;

};