-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
67 lines (66 loc) · 1.01 KB
/
player.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include"skill.h"
class Status
{
public:
int blood = 0;
static int Qi;
int attack = 0;
int defend = 0;
};
class Player
{
public:
Player(int id) :
id_(id)
{
init();
}
public:
int id_;
Status status;
Skill* skill;
void putSkill() {
auto tuple = skill->chooseSkill(Skills::CA);
int type = std::get<0>(tuple);
int value = std::get<1>(tuple);
switch (type)
{
case 0: status.Qi += value; break;
case 1: status.defend += value; break;
case 2: status.attack += value; break;
default: {
exception e;
throw(e);
break;
}
}
};
void receiveSkill()
{
};
public:
void setdefend(int def)
{
status.defend = def;
};
void setattack(int att)
{
status.attack = att;
};
private:
//每回合结束后重置一些属性
void resetAttribute()
{
status.attack = 0;
status.defend = 0;
}
void init()
{
status.blood = 1;
status.Qi = 0;
status.attack = 0;
status.defend = 0;
skill = new Skill(id_);
}
};