diff options
author | Your Name <you@example.com> | 2021-04-29 14:17:08 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-04-29 14:17:08 -0400 |
commit | 5a813a75412ac9b8fadb90c9abd46dd95aee8e9b (patch) | |
tree | 75c5466d459c793430a6481cd276a624cd843794 /src/spell.h | |
parent | cd57ad6e208728bafcbc8c7d7b85d88603706978 (diff) | |
download | dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.gz dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.tar.bz2 dmtool-5a813a75412ac9b8fadb90c9abd46dd95aee8e9b.zip |
Removed data files from repo
Diffstat (limited to 'src/spell.h')
-rw-r--r-- | src/spell.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/spell.h b/src/spell.h index d493d5d..31b7d72 100644 --- a/src/spell.h +++ b/src/spell.h @@ -1,47 +1,44 @@ #pragma once #include "json.hpp" -#include "jsonable.h" +#include "entry.h" -namespace spell { - class Spell : public Jsonable { +namespace entry { + class Spell : public Entry { public: - Spell(const nlohmann::json& data) : name(data["name"]), level(data["level"]), school(data["school"]), classes(data["classes"]), castingTime(data["casting_time"]), range(data["range"]), components(data["components"]), duration(data["duration"]), text(data["text"]) {}; + Spell(const nlohmann::json& data, const nlohmann::json& base) : Entry(base), level(data["level"]), classes(data["classes"]), castingTime(data["casting_time"]), range(data["range"]), components(data["components"]), duration(data["duration"]) {}; virtual ~Spell() {}; - std::string getName(void) const {return name;} + //std::string getName(void) const {return name;} int getLevel(void) const {return level;} - std::string getSchool(void) const {return school;} + std::string getSchool(void) const {return getType();} std::vector<std::string> getClasses(void) const {return classes;} std::string getCastingTime(void) const {return castingTime;} std::string getRange(void) const {return range;} std::string getComponents(void) const {return components;} std::string getDuration(void) const {return duration;} - std::string getText(void) const {return text;} + + std::string getText(void) const override; virtual nlohmann::json toJson(void) const { - /*return nlohmann::json({ - {"name", name}, - {"level", level}, - {"school", school}, - {"classes", classes}, - {"casting_time", castingTime}, - {"range", range}, - {"components", components}, - {"duration", duration}, - {"text", text} - });*/ - return nlohmann::json(name); + auto data = Entry::toJson(); + data["level"] = level; + data["classes"] = classes; + data["casting_time"] = castingTime; + data["range"] = range; + data["components"] = components; + data["duration"] = duration; + return data; } private: - const std::string name; + //const std::string name; const int level; - const std::string school; + //const std::string school; const std::vector<std::string> classes; const std::string castingTime; const std::string range; const std::string components; const std::string duration; - const std::string text; + //const std::string text; }; } |