-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.cpp
More file actions
57 lines (47 loc) · 957 Bytes
/
player.cpp
File metadata and controls
57 lines (47 loc) · 957 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <QDebug>
#include "player.h"
Player::Player()
{
//TODO
}
Player::Player(QVariantMap map)
:Actor(map)
{
name = map["name"].toString();
life = map["life"].toInt();
deaths = map["deaths"].toInt();
kills = map["kills"].toInt();
team = map["team"].toInt();
}
void Player::update(QVariantMap map)
{
Actor::update(map);
if (map.contains("name"))
name = map["name"].toString();
if (map.contains("life"))
life = map["life"].toInt();
if (map.contains("deaths"))
deaths = map["deaths"].toInt();
if (map.contains("kills"))
kills = map["kills"].toInt();
if (map.contains("flag"))
flag = map["flag"].toInt() ;
if (map.contains("team"))
team = map["team"].toInt();
}
int Player::getLife()
{
return life;
}
int Player::getKills()
{
return kills;
}
int Player::getDeaths()
{
return deaths;
}
QString Player::getName()
{
return name;
}