diff options
Diffstat (limited to 'src/spellcasting.h')
-rw-r--r-- | src/spellcasting.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/spellcasting.h b/src/spellcasting.h index 0ea235c..654a386 100644 --- a/src/spellcasting.h +++ b/src/spellcasting.h @@ -3,6 +3,7 @@ #include "json.hpp" #include "spell.h" #include "jsonable.h" +#include "rules.h" typedef nlohmann::json json; @@ -23,11 +24,11 @@ namespace entry { class Spellcasting : public Feature { public: - Spellcasting(const json& data, const json& base) : Feature(base), innate(data["innate"]), ability(data["spellcasting_ability"]), spellsBySlot(json2vec<SlotLevel>(data["levels"])) {} + Spellcasting(const json& data, const json& base) : Feature(base), innate(data["innate"]), ability(rules::Ability(data["spellcasting_ability"])), spellsBySlot(json2vec<SlotLevel>(data["levels"])) {} virtual ~Spellcasting() {} bool isInnate(void) const {return innate;} - std::string getAbility(void) const {return ability;} + rules::Ability getAbility(void) const {return ability;} std::vector<SlotLevel> getSpellsBySlot(void) const {return spellsBySlot;} virtual std::string getText(const creature::Creature& c) const; @@ -41,7 +42,7 @@ namespace entry { private: const bool innate; - const std::string ability; + const rules::Ability ability; const std::vector<SlotLevel> spellsBySlot; }; |