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/spell.h | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/spell.h') diff --git a/src/spell.h b/src/spell.h index 1a560f2..2d9b24d 100644 --- a/src/spell.h +++ b/src/spell.h @@ -3,29 +3,25 @@ #include namespace entry { + struct spellImpl; + class Spell : public Entry { public: - Spell() {} + Spell(); virtual ~Spell() {} - int getLevel(void) const {return level;} - std::string getSchool(void) const {return getType();} - std::vector getClasses(void) const {return classes;} - std::string getCastingTime(void) const {return casting_time;} - std::string getRange(void) const {return range;} - std::string getComponents(void) const {return components;} - std::string getDuration(void) const {return duration;} + int getLevel(void) const; + std::string getSchool(void) const; + std::vector getClasses(void) const; + std::string getCastingTime(void) const; + std::string getRange(void) const; + std::string getComponents(void) const; + std::string getDuration(void) const; std::string getText(void) const override; - NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Entry, Spell, level, classes, casting_time, range, components, duration); - + NLOHMANN_FRIEND_DECLARES(Spell); private: - int level; - std::vector classes; - std::string casting_time; - std::string range; - std::string components; - std::string duration; + std::shared_ptr data; }; } -- cgit v1.2.3