From 2ab51e507d620c4479e07ca0ec47d22c8c66bc90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 13 Apr 2021 15:14:34 -0400 Subject: Initial commit --- src/item.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/item.h (limited to 'src/item.h') 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 + +namespace item{ + class Item : public Jsonable { + public: + static std::shared_ptr 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; + }; +} -- cgit v1.2.3