aboutsummaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-08-09 16:57:53 -0400
committerYour Name <you@example.com>2022-08-09 16:57:53 -0400
commit5937d893da5656be3f486c863ae54e08bbe66579 (patch)
tree15aedaf0753fcf73fe85e90e88a7d0af33036eca /src/item.h
parent947d83c59ea86615e3a81a2ec122d843b5eceee9 (diff)
downloaddmtool-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.h18
1 files changed, 11 insertions, 7 deletions
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 <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;
};
}