diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-12 22:09:40 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-12 22:09:40 +0100 |
commit | c942f4295c810d8d36910c996d3c321f37419cd6 (patch) | |
tree | 7b462c18ae9c50782dc2edfd04aaba76f15828f4 /src/main/headers/Item.hpp | |
parent | Remove Actor::Type and Scene::Type in favor of dynamic_cast<T>() (diff) | |
download | Subconscious-old-c942f4295c810d8d36910c996d3c321f37419cd6.tar.gz Subconscious-old-c942f4295c810d8d36910c996d3c321f37419cd6.zip |
Add inventory and item types headers
Diffstat (limited to 'src/main/headers/Item.hpp')
-rw-r--r-- | src/main/headers/Item.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
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 <string> + +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 |