forked from DOMjudge/DOMjura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup.cpp
53 lines (43 loc) · 1.07 KB
/
group.cpp
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
48
49
50
51
52
53
#include "group.h"
#include <QJsonObject>
#include "team.h"
namespace DJ
{
namespace Model
{
Group::Group(QJsonObject group, QObject *parent) : QObject(parent)
{
this->id = group.value("id").toString();
this->name = group.value("name").toString("UNKNOWN");
this->color = group.value("color").toString("");
}
QString Group::getName()
{
return this->name;
}
QString Group::getId()
{
return this->id;
}
QString Group::getColor()
{
return this->color;
}
void Group::addTeam(Team *team)
{
this->teams[team->getId()] = team;
}
int Group::numTeams()
{
return this->teams.size();
}
QString Group::toString()
{
QString s;
s += " id = " + this->id + "\n";
s += " color = " + this->color + "\n";
s += " name = " + this->name + "\n";
return s;
}
}
}