#pragma once #include "defines.h" #include #include namespace creature { class Creature; } namespace entry { struct entryImpl; class Entry { public: Entry(); // Also can be created programmatically Entry(const std::string& entry, const std::string& name, const std::string& type, const std::string& text); static std::shared_ptr create(const nlohmann::json& data); virtual ~Entry() {} std::string getName(void) const; std::string getType(void) const; virtual std::string getText(void) const; virtual std::string getText(const creature::Creature& c) const; void setText(const std::string& t); virtual void init(void) {} NLOHMANN_FRIEND_DECLARES(Entry); private: std::shared_ptr data; }; }