-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pokemon.cpp
52 lines (40 loc) · 745 Bytes
/
Pokemon.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
/**
* @file : Pokemon.cpp
* @author : Ethan Ward
* @date : 2014.02.05
* Purpose: Implementation of Pokemon class.
*/
#include "Pokemon.h"
Pokemon::Pokemon() {
m_hp = 0;
m_attackLevel = 0;
m_defenseLevel = 0;
m_name = "";
}
void Pokemon::reduceHP(int amount) {
m_hp -= amount;
}
int Pokemon::getHP() const {
return(m_hp);
}
int Pokemon::getAttack() const {
return(m_attackLevel);
}
int Pokemon::getDefense() const {
return(m_defenseLevel);
}
std::string Pokemon::getName() const {
return(m_name);
}
void Pokemon::setHP(int hp) {
m_hp = hp;
}
void Pokemon::setAttack(int attack) {
m_attackLevel = attack;
}
void Pokemon::setDefense(int defense) {
m_defenseLevel = defense;
}
void Pokemon::setName(std::string name) {
m_name = name;
}