-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtournament.h
47 lines (40 loc) · 1.16 KB
/
tournament.h
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
41
42
43
44
45
46
47
#ifndef TOURNAMENT_H
#define TOURNAMENT_H
#include <QString>
#include <QVariant>
#include "round.h"
#include "tournamentsitem.h"
class Tournament: public TournamentsItem
{
public:
Tournament(TournamentsItem *parent,QString name = "Unnamed Tournament",int originalOrder = -1);
bool subscribed = false;
enum class TournamentRoles{
NameRole = Qt::UserRole+1,
OriginalOrderRole,
StatusRole,
EventTypeRole,
CurrentShownRoundRole
};
QString name;
// TournamentsItem interface
int columnCount() const override;
QVariant data(int role) const override;
QVariant data(Tournament::TournamentRoles role) const;
TournamentsItem *child(int position) const override;
int childCount() const override;
bool addChild(TournamentsItem *) override;
int position(TournamentsItem *) override;
int position(int id);
QHash<int,QString> players;
private:
QVector<Round*> rounds;
int originalOrder;
QString status;
QString eventType;
int currentShownRound = -1;
// TournamentsItem interface
public:
bool setData(int role, const QVariant &value) override;
};
#endif // TOURNAMENT_H