blob: 2df1fff2fac6bd763d77507a0618f0232dc7e4e0 (
plain)
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
|
#pragma once
#include "item.h"
#include "json.hpp"
namespace item {
class Armor : public Item {
public:
Armor(const nlohmann::json& data, const nlohmann::json& base) : Item(base), acBonus(data["ac"]), armorType(data["type"]), strRequirement(data["strength"]), stealthDis(data["disadvantage"]), cost(data["cost"]), weight(data["weight"]) {}
int getACBonus(void) const {return acBonus;}
std::string getArmorType(void) const {return armorType;}
int getStrRequirement(void) const {return strRequirement;}
bool stealthDisadvantage(void) const {return stealthDis;}
int getCost(void) const {return cost;}
double getWeight(void) const {return weight;}
/*virtual nlohmann::json toJson(void) const {
auto data = Item::toJson();
data["ac"] = acBonus;
data["type"] = armorType;
data["strength"] = strRequirement;
data["disadvantage"] = stealthDis;
data["cost"] = cost;
data["weight"] = weight;
return data;
}*/
private:
const int acBonus;
const std::string armorType;
const int strRequirement;
const bool stealthDis;
const int cost;
const double weight;
};
}
|