#include "json.hpp" #include "feature.h" #include "creature.h" #include #include using namespace std; typedef nlohmann::json json; namespace feature { shared_ptr Feature::create(const json& data) { return shared_ptr(new Feature(data)); } Feature::Feature(const json& data) : name(data["name"]), type(data["type"]), text(data["text"]) {} Feature::~Feature() {} string Feature::getName() const { return name; } string Feature::getType() const { return type; } string Feature::getText() const { return text; } json Feature::toJson() const { return json({ {"name", name}, {"type", type}, {"text", text} }); } }