aboutsummaryrefslogtreecommitdiff
path: root/src/armor.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-04-29 14:17:08 -0400
committerYour Name <you@example.com>2021-04-29 14:17:08 -0400
commit5a813a75412ac9b8fadb90c9abd46dd95aee8e9b (patch)
tree75c5466d459c793430a6481cd276a624cd843794 /src/armor.h
parentcd57ad6e208728bafcbc8c7d7b85d88603706978 (diff)
downloaddmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.gz
dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.bz2
dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.zip
Removed data files from repo
Diffstat (limited to 'src/armor.h')
-rw-r--r--src/armor.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/armor.h b/src/armor.h
index 57402cb..0d148b7 100644
--- a/src/armor.h
+++ b/src/armor.h
@@ -3,9 +3,13 @@
#include "json.hpp"
namespace entry {
+ class Armor;
+
+ std::string genText(const Armor& a, const creature::Creature& c);
+
class Armor : public Item , public Substantial {
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"]) {}
+ Armor(const nlohmann::json& data, const nlohmann::json& base) : Item(base), acBonus(data["ac"]), armorType(data["armor_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;}
@@ -14,7 +18,8 @@ namespace entry {
int getCost(void) const {return cost;}
double getWeight(void) const {return weight;}
- virtual std::string getText(const creature::Creature& c) const;
+ virtual std::string getText() const override;
+ virtual std::string getText(const creature::Creature& c) const override {return genText(*this, c);}
/*virtual nlohmann::json toJson(void) const {
auto data = Item::toJson();
@@ -35,6 +40,4 @@ namespace entry {
const int cost;
const double weight;
};
-
- std::string genText(const Armor& a, const creature::Creature& c);
}