From c942f4295c810d8d36910c996d3c321f37419cd6 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 12 Feb 2018 22:09:40 +0100 Subject: Add inventory and item types headers --- src/main/headers/Item.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/headers/Item.hpp (limited to 'src/main/headers/Item.hpp') diff --git a/src/main/headers/Item.hpp b/src/main/headers/Item.hpp new file mode 100644 index 0000000..3664a0e --- /dev/null +++ b/src/main/headers/Item.hpp @@ -0,0 +1,29 @@ +#ifndef ITEM_HPP +#define ITEM_HPP + +#include + +class Actor; + +/* + * TODO description + */ +class Item +{ +public: + Item() = delete; + virtual ~Item() {} + + virtual bool use(Actor &actor) = 0; + virtual bool use(Item &item) = 0; + + bool stackable() { return _maxAmount == 1; } + +protected: + const unsigned _maxAmount; + const unsigned _amount; // stackable + + std::string _name; +}; + +#endif -- cgit v1.2.1