-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwarrior.hpp
executable file
·44 lines (34 loc) · 921 Bytes
/
warrior.hpp
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
43
44
#ifndef WARRIOR_HPP
#define WARRIOR_HPP
#include "util.hpp"
#include "animator.hpp"
class Warrior
{
public:
Warrior (int x, int y, Side side, UnitType type);
void tick (Action action);
void draw (bool selected) const;
void redraw();
void resign();
void damage (int dmg);
void attack (Warrior& enemy);
void move (int x, int y);
void reset_ap (bool r);
int x() const { return x_; }
int y() const { return y_; }
int speed() const { return speed_; }
int health() const { return health_; }
int range() const { return range_; }
int ap() const { return ap_; }
bool alive() const { return alive_; }
bool animated() const { return animator_.complete(); }
Side side() const { return side_; }
UnitType type() const { return type_; }
private:
int health_, power_, speed_, range_, x_, y_, ap_;
bool alive_, flip_, animated_;
Side side_;
UnitType type_;
Animator animator_;
};
#endif // WARRIOR_HPP