-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteam.cpp
More file actions
41 lines (35 loc) · 816 Bytes
/
team.cpp
File metadata and controls
41 lines (35 loc) · 816 Bytes
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
#include "team.h"
Team::Team()
{
}
Team::Team(QVariantMap map)
{
cR = map["cR"].toInt();
cG = map["cG"].toInt();
cB = map["cB"].toInt();
name = map["name"].toString();;
num = map["num"].toInt();
pts = map["pts"].toInt();
}
void Team::update(QVariantMap map)
{
//Colors
if (map.contains("cR"))
cR = map["cR"].toInt();
if (map.contains("cG"))
cG = map["cG"].toInt();
if (map.contains("cB"))
cB = map["cB"].toInt();
if (map.contains("name"))
name = map["name"].toString();;
if (map.contains("num"))
num = map["num"].toInt();
if (map.contains("pts"))
pts = map["pts"].toInt();
}
void Team::getColor(float* r, float* g, float* b)
{
*r = this->cR / 255.0;
*g = this->cG / 255.0;
*b = this->cB / 255.0;
}