blob: 56f8733d2d4d4fd770da4cbc1d7344c12746b750 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef ITEM_HPP
#define ITEM_HPP
#include <string>
class Actor;
/*
* TODO description
*/
class Item
{
public:
enum Type {
BULLET, MELEEWEAPON, RANGEDWEAPON, STICK, HEAL, FOOD
};
const Type type;
Item() = delete;
virtual ~Item() {}
virtual bool use(Actor &user, Actor &actor) = 0;
int amount() { return _amount; }
bool stackable() { return _maxAmount == 1; }
protected:
unsigned _maxAmount;
unsigned _amount; // stackable
const std::string _name;
Item(Type t, const std::string &name) : _name(name), type(t) {}
};
#endif
|