#include "json.hpp" #include "feature.h" #include "spellcasting.h" #include "attack.h" #include "utils.h" #include #include using namespace std; typedef nlohmann::json json; namespace entry { shared_ptr Feature::create(const json& data) { if(data["type"] == "spells") { return utils::loadDFromJson(data); } else if(data["type"] == "attack") { return utils::loadDFromJson(data); } return shared_ptr(new Feature(data)); } }