From 5937d893da5656be3f486c863ae54e08bbe66579 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 9 Aug 2022 16:57:53 -0400 Subject: Added generic items, worked on features --- src/item.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/item.h') diff --git a/src/item.h b/src/item.h index fc43a40..e8a40b9 100644 --- a/src/item.h +++ b/src/item.h @@ -4,17 +4,21 @@ #include namespace entry { + struct itemImpl; + class Item : public Entry { public: + Item(); static std::shared_ptr create(const nlohmann::json& data); virtual ~Item() {} - }; + virtual int getCost(void) const; + virtual double getWeight(void) const; + virtual std::string getCostWeightText() const; + virtual std::string getText() const override; + virtual std::string getText(const creature::Creature& c) const override; - class Substantial { - public: - virtual int getCost(void) const = 0; - virtual double getWeight(void) const = 0; - std::string getText() const; - virtual ~Substantial() {} + NLOHMANN_FRIEND_DECLARES(Item); + private: + std::shared_ptr data; }; } -- cgit v1.2.3