From b27700a7e0b281ece3dea23060c17e0cae28715d Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 20 May 2021 17:00:53 -0400 Subject: Reduced exposure of implementation details --- src/armor.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/armor.h') 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 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 data; }; } -- cgit v1.2.3