aboutsummaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-04-13 15:14:34 -0400
committerYour Name <you@example.com>2021-04-13 15:14:34 -0400
commit2ab51e507d620c4479e07ca0ec47d22c8c66bc90 (patch)
tree90906ecb043c01034280c767b83a88eb6df6956f /src/item.h
downloaddmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.tar.gz
dmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.tar.bz2
dmtool-2ab51e507d620c4479e07ca0ec47d22c8c66bc90.zip
Initial commit
Diffstat (limited to 'src/item.h')
-rw-r--r--src/item.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/item.h b/src/item.h
new file mode 100644
index 0000000..f8b2c87
--- /dev/null
+++ b/src/item.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "json.hpp"
+#include "jsonable.h"
+#include <memory>
+
+namespace item{
+ class Item : public Jsonable {
+ public:
+ static std::shared_ptr<Item> create(const nlohmann::json& data);
+
+ virtual ~Item();
+
+ virtual std::string getName(void) const;
+ virtual int getCost(void) const;
+ virtual double getWeight(void) const;
+
+ virtual nlohmann::json toJson(void) const;
+
+ protected:
+ Item(const nlohmann::json& data);
+
+ private:
+ const std::string name;
+ const int cost;
+ const double weight;
+ };
+}