-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeapon.cpp
61 lines (50 loc) · 1.29 KB
/
Weapon.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
#include "Weapon.h"
#include "string"
Weapon::Weapon(std::string na, REEnums::WeaponType ty unsigned da, unsigned du,
unsigned we, unsigned ac) :
Item(na, REEnums::Weapon, du),
type(ty),
damage(da),
weight(we),
accuracy(ac),
favoredOne(fo),
favoredTwo(ft),
unfavoredOne(uo),
unfavoredTwo(ut)
{}
unsigned Weapon::getDamage() const {
return damage;
}
unsigned Weapon::getDurability() const {
return durability;
}
unsigned Weapon::getWeight() const {
return weight;
}
unsigned Weapon::getAccuracy() const {
return accuracy;
}
REEnums::WeaponType getType() const {
return type;
}
bool Weapon::isFavored(const REEnums::WeaponType type) {
if (type == favoredOne or type == favoredTwo) {
return true;
}
return false;
}
bool Weapon::isUnfavored(const REEnums::WeaponType type) {
if (type == unfavoredOne or type == unfavoredTwo) {
return true;
}
return false;
}
void Weapon::setDamage(const unsigned newDa) {
damage = newDa;
}
void Weapon::setWeight(const unsigned newWe) {
weight = newWe;
}
void Weapon::setAccuracy(const unsigned newAc) {
accuracy = newAc;
}