-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.cpp
More file actions
56 lines (43 loc) · 1.04 KB
/
Player.cpp
File metadata and controls
56 lines (43 loc) · 1.04 KB
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
// Player class implementation
// By Nick Verrochi
// Last Modified: 5/12/15
#include "Player.h"
using namespace std;
Player::Player(const string &playerName) {
name = playerName;
level = 1;
exp = 0;
expToNext = 100;
escaping = false;
}
void Player::setExp(const unsigned long long &num) {
exp = (num < 0 ? 0 : num);
}
unsigned long long Player::getExp() const {
return exp;
}
void Player::setExpToNext(const unsigned long long &num) {
expToNext = (num > 0 ? num : 1);
}
unsigned long long Player::getExpToNext() const {
return expToNext;
}
void Player::setPlayerClass(const string &name) {
playerClass = name;
}
string Player::getPlayerClass() const {
return playerClass;
}
void Player::setID(const ClassID &id) {
classID = id;
}
ClassID Player::getID() const {
return classID;
}
void Player::setEscaping(const bool &esc) {
escaping = esc;
}
bool Player::isEscaping() const {
return escaping;
}
const string Player::ChoiceOutOfRangeException = "Error! Choice out of Range! \n";