-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArmor.cpp
More file actions
28 lines (20 loc) · 716 Bytes
/
Copy pathArmor.cpp
File metadata and controls
28 lines (20 loc) · 716 Bytes
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
#include "Armor.h"
Armor::Armor(const string& name, const string& description, const int armor, const int reqLevel) :
Item(name, ItemTypes::ARMOR, description),
armor(armor),
reqLevel(reqLevel) {
this->equipped = false;
}
Armor::~Armor() {}
int Armor::getArmor() const { return this->armor; }
int Armor::getReqLevel() const { return this->reqLevel; }
bool Armor::getEquipped() const { return this->equipped; }
string Armor::getInfo() const {
return "[Armor: " + to_string(getArmor()) + "| Requires level " + to_string(getReqLevel()) + "| " + (getEquipped() ? "Equipped" : "Not equipped") + "]";
}
void Armor::equipItem() {
this->equipped = true;
}
void Armor::unequipItem() {
this->equipped = false;
}