aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/headers/Actor.hpp
blob: 24b7c728ecd829fde71c1c31f1a9ac8aab4b87fc (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
38
39
40
41
42
#ifndef ACTOR_HPP
#define ACTOR_HPP

#include <list>
#include <string>

#include "Item.hpp"

class Actor 
{
public:
    const unsigned maxHp;
    const std::string name;

    Actor() = delete;
    virtual ~Actor();

    void damage(int amt);
    void heal(int amt);

    void store(Item &item);
    Item& drop();

    /* accessors */
    bool alive() { return _alive; }
    unsigned hp() { return _hp; }

    int x() { return _x; }
    int y() { return _y; }

protected:
    bool _alive;
    unsigned _hp;
    int _x, _y;

    unsigned _inventorySize;
    std::list<Item*> _inventory;

    Actor(std::string _name, unsigned _maxHp);
};

#endif