diff options
author | Your Name <you@example.com> | 2021-05-20 17:00:53 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-05-20 17:00:53 -0400 |
commit | b27700a7e0b281ece3dea23060c17e0cae28715d (patch) | |
tree | ef13e98281dd0183c4fb1e32cdf371ea1f6c1794 /src/armor.h | |
parent | be88609c825e18201f240415fe74a31c1a789484 (diff) | |
download | dmtool-b27700a7e0b281ece3dea23060c17e0cae28715d.tar.gz dmtool-b27700a7e0b281ece3dea23060c17e0cae28715d.tar.bz2 dmtool-b27700a7e0b281ece3dea23060c17e0cae28715d.zip |
Reduced exposure of implementation details
Diffstat (limited to 'src/armor.h')
-rw-r--r-- | src/armor.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/armor.h b/src/armor.h index 4351a24..c8bdb87 100644 --- a/src/armor.h +++ b/src/armor.h @@ -3,28 +3,23 @@ #include <nlohmann/json.hpp> namespace entry { - class Armor; + struct armorImpl; class Armor : public Item , public Substantial { public: - int getACBonus(void) const {return ac;} - std::string getArmorType(void) const {return armor_type;} - int getStrRequirement(void) const {return strength;} - bool stealthDisadvantage(void) const {return disadvantage;} - int getCost(void) const {return cost;} - double getWeight(void) const {return weight;} + Armor(); + int getACBonus(void) const; + std::string getArmorType(void) const; + int getStrRequirement(void) const; + bool stealthDisadvantage(void) const; + int getCost(void) const; + double getWeight(void) const; virtual std::string getText() const override; virtual std::string getText(const creature::Creature& c) const override; - NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Item, Armor, ac, armor_type, strength, disadvantage, cost, weight); - + NLOHMANN_FRIEND_DECLARES(Armor); private: - int ac; - std::string armor_type; - int strength; - bool disadvantage; - int cost; - double weight; + std::shared_ptr<armorImpl> data; }; } |