blob: 7cc3be5ec72be03be7ff0e462b9ff973753c2fd1 (
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
|
#ifndef ACTOR_HPP
#define ACTOR_HPP
#include <string>
class Actor
{
public:
const enum Type
{
PLAYER, ENEMY
} type;
const unsigned maxHp;
const std::string name;
Actor() = delete;
Actor(std::string _name, unsigned _maxHp, Type _type);
virtual ~Actor();
void damage(int amt);
void heal(int amt);
// TODO shouldnt be done by the map ?
// bool move(int x, y);
/* accessors */
bool alive() { return _alive; }
unsigned hp() { return _hp; }
int x() { return _x; }
int y() { return _y; }
private:
bool _alive;
unsigned _hp;
int _x, _y;
};
#endif
|