From 5a813a75412ac9b8fadb90c9abd46dd95aee8e9b Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 Apr 2021 14:17:08 -0400 Subject: Removed data files from repo --- src/armor.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/armor.h') 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); } -- cgit v1.2.3