]> git.localhorst.tv Git - l2e.git/blob - src/battle/Capsule.h
renamed namespace geometry -> math
[l2e.git] / src / battle / Capsule.h
1 #ifndef BATTLE_CAPSULE_H_
2 #define BATTLE_CAPSULE_H_
3
4 namespace common {
5         class Capsule;
6 }
7
8 #include "AttackChoice.h"
9 #include "../common/Stats.h"
10 #include "../math/Vector.h"
11 #include "../graphics/Animation.h"
12 #include "../graphics/fwd.h"
13 #include "../graphics/Menu.h"
14
15 namespace battle {
16
17 class Capsule {
18
19 public:
20         Capsule(common::Capsule *master = 0);
21
22 public:
23         bool Active() const { return master; }
24
25         const char *Name() const;
26         Uint8 Level() const;
27         const graphics::Sprite *Sprite();
28
29         Uint16 MaxHealth() const;
30         Uint16 Health() const;
31         int RelativeHealth(int max) const;
32         void SubtractHealth(int amount);
33
34         common::Stats &GetStats() { return stats; }
35         const common::Stats &GetStats() const { return stats; }
36
37         graphics::AnimationRunner &GetAnimation() { return animation; }
38         const graphics::AnimationRunner &GetAnimation() const { return animation; }
39         void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
40
41         const graphics::Animation *MeleeAnimation() const;
42         const graphics::Animation *AttackAnimation() const;
43         const graphics::Animation *SpellAnimation() const;
44
45         math::Vector<int> &Position() { return position; }
46         const math::Vector<int> &Position() const { return position; }
47
48         AttackChoice &GetAttackChoice() { return attackChoice; }
49         const AttackChoice &GetAttackChoice() const { return attackChoice; }
50
51 private:
52         common::Capsule *master;
53
54         int health;
55
56         graphics::AnimationRunner animation;
57         math::Vector<int> position;
58         AttackChoice attackChoice;
59         common::Stats stats;
60
61 };
62
63 }
64
65 #endif /* BATTLE_CAPSULE_H_ */