diff options
| author | Your Name <you@example.com> | 2022-08-09 16:57:53 -0400 | 
|---|---|---|
| committer | Your Name <you@example.com> | 2022-08-09 16:57:53 -0400 | 
| commit | 5937d893da5656be3f486c863ae54e08bbe66579 (patch) | |
| tree | 15aedaf0753fcf73fe85e90e88a7d0af33036eca /src/item.h | |
| parent | 947d83c59ea86615e3a81a2ec122d843b5eceee9 (diff) | |
| download | dmtool-5937d893da5656be3f486c863ae54e08bbe66579.tar.gz dmtool-5937d893da5656be3f486c863ae54e08bbe66579.tar.bz2 dmtool-5937d893da5656be3f486c863ae54e08bbe66579.zip  | |
Added generic items, worked on features
Diffstat (limited to 'src/item.h')
| -rw-r--r-- | src/item.h | 18 | 
1 files changed, 11 insertions, 7 deletions
@@ -4,17 +4,21 @@  #include <memory>  namespace entry { +    struct itemImpl; +      class Item : public Entry {          public: +            Item();              static std::shared_ptr<Item> 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<itemImpl> data;      };  }  | 
