diff options
Diffstat (limited to 'src/spellcasting.h')
-rw-r--r-- | src/spellcasting.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/spellcasting.h b/src/spellcasting.h index 654a386..3a55277 100644 --- a/src/spellcasting.h +++ b/src/spellcasting.h @@ -9,15 +9,19 @@ typedef nlohmann::json json; namespace entry { struct SlotLevel : public Jsonable { - SlotLevel(const json& data) : numSlots(data["slots"]), spells(jsonList2vec<spell::Spell>("spellcasting", data["spells"])) {} + SlotLevel(const json& data) : numSlots(data["slots"]), spells(jsonList2vec<Spell>("spellcasting", data["spells"])) {} virtual ~SlotLevel() {} const int numSlots; - const std::vector<spell::Spell> spells; + const std::vector<Spell> spells; json toJson(void) const { + std::vector<string> s; + for(auto spell : spells) { + s.push_back(spell.getName()); + } return json({ {"slots", numSlots}, - {"spells", spells} + {"spells", s} }); } }; |