2024-08-12 22:09:50 +02:00
|
|
|
|
|
|
|
#ifndef ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
|
|
|
|
#define ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QJsonObject>
|
2024-08-15 19:21:02 +02:00
|
|
|
#include <QAbstractListModel>
|
2024-08-12 22:09:50 +02:00
|
|
|
#include <stdexcept>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class Competitor {
|
|
|
|
|
2024-08-15 19:21:02 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(int code READ code)
|
|
|
|
Q_PROPERTY(QString name READ name)
|
|
|
|
Q_PROPERTY(QString noc READ noc)
|
|
|
|
|
2024-08-12 22:09:50 +02:00
|
|
|
public:
|
2024-08-15 19:21:02 +02:00
|
|
|
Competitor() {
|
|
|
|
this->code = 0;
|
|
|
|
this->name = "na";
|
|
|
|
this->noc = "---";
|
|
|
|
}
|
|
|
|
|
2024-08-12 22:09:50 +02:00
|
|
|
Competitor(const Competitor &competitor) {
|
|
|
|
this->code = competitor.code;
|
|
|
|
this->name = competitor.name;
|
|
|
|
this->noc = competitor.noc;
|
|
|
|
}
|
|
|
|
|
|
|
|
Competitor(const QJsonObject &competitor) {
|
|
|
|
setCompetitor(competitor);
|
|
|
|
}
|
|
|
|
|
2024-08-15 19:21:02 +02:00
|
|
|
int getCode() { return this->code; }
|
2024-08-12 22:09:50 +02:00
|
|
|
QString getName() { return this->name; }
|
|
|
|
QString getNOC() { return this->noc; }
|
|
|
|
|
|
|
|
bool setCompetitor(const QJsonObject &competitor);
|
|
|
|
|
|
|
|
private:
|
2024-08-15 19:21:02 +02:00
|
|
|
int code;
|
2024-08-12 22:09:50 +02:00
|
|
|
QString name;
|
|
|
|
QString noc;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //ITAT_CHALLANGE_OLYMPICS_COMPETITOR_H
|