aboutsummaryrefslogtreecommitdiff
path: root/src/spell.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/spell.cc')
-rw-r--r--src/spell.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/spell.cc b/src/spell.cc
index 0294956..83ec9da 100644
--- a/src/spell.cc
+++ b/src/spell.cc
@@ -6,6 +6,28 @@
using namespace std;
namespace entry {
+ struct spellImpl {
+ int level;
+ std::vector<std::string> classes;
+ std::string casting_time;
+ std::string range;
+ std::string components;
+ std::string duration;
+ };
+ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(spellImpl, level, classes, casting_time, range, components, duration);
+
+ NLOHMANN_FRIEND_DEFS(Entry, Spell, data);
+
+ Spell::Spell() : data(new spellImpl()) {}
+
+ int Spell::getLevel(void) const {return data->level;}
+ std::string Spell::getSchool(void) const {return getType();}
+ std::vector<std::string> Spell::getClasses(void) const {return data->classes;}
+ std::string Spell::getCastingTime(void) const {return data->casting_time;}
+ std::string Spell::getRange(void) const {return data->range;}
+ std::string Spell::getComponents(void) const {return data->components;}
+ std::string Spell::getDuration(void) const {return data->duration;}
+
string Spell::getText() const {
stringstream text;
text << utils::toOrdinal(getLevel()) << " level " << getSchool() << " spell." << endl;