aboutsummaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
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;
+ };
+}