diff options
author | Your Name <you@example.com> | 2021-04-15 15:23:23 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-15 15:23:23 -0400 |
commit | dfce4d0398a8bafbb7ad7a31345af181c0269c09 (patch) | |
tree | 695162ff8cc25e146f52d9e26fe19ffa9934b3d6 /src/armor.h | |
parent | 9034c3d2533177f7cb7a7ce939ec53f7fa63f60e (diff) | |
download | dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.gz dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.tar.bz2 dmtool-dfce4d0398a8bafbb7ad7a31345af181c0269c09.zip |
Added spells
Diffstat (limited to 'src/armor.h')
-rw-r--r-- | src/armor.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/armor.h b/src/armor.h index 0ea7199..2df1fff 100644 --- a/src/armor.h +++ b/src/armor.h @@ -5,18 +5,32 @@ namespace item { class Armor : public Item { public: - Armor(const nlohmann::json& data); - int getACBonus(void) const; - std::string getArmorType(void) const; - int getStrRequirement(void) const; - bool stealthDisadvantage(void) const; + 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"]) {} - virtual nlohmann::json toJson(void) const; + 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; }; } |