-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonster.cpp
99 lines (72 loc) · 2.84 KB
/
Monster.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*--------------------------------****************************************----------------------------------
| * * |
| Ether's Quest * Monster class definitions * |
| * * |
---------------------------------****************************************----------------------------------*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
The Monster class creates objects with the states:
string name, int health, int armore, and int strength
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "Monster.hpp"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------- Class Monster ----------------------------------------------------
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------
// Constructors
//----------------------------------------------------------------------------------
// Default constructor
Monster::Monster()
{
// empty
}
Monster::Monster(string name, int health, int armor, int strength)
{
this->name = name;
this->health = health;
this->armor = armor;
this->strength = strength;
}
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------------------
string Monster::get_name()
{
return name;
}
int Monster::get_health()
{
return health;
}
int Monster::get_armor()
{
return armor;
}
int Monster::get_strength()
{
return strength;
}
//---------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
// Mutators
//----------------------------------------------------------------------------------
void Monster::set_name(string name)
{
this->name = name;
}
void Monster::set_health(int health)
{
this->health = health;
}
void Monster::set_armor(int armor)
{
this->armor = armor;
}
void Monster::set_strength(int strength)
{
this->strength = strength;
}