]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackChoice.h
8577976ce708d6eeb16a13fe752e6998af54df9c
[l2e.git] / src / battle / AttackChoice.h
1 #ifndef BATTLE_ATTACKCHOICE_H_
2 #define BATTLE_ATTACKCHOICE_H_
3
4 #include "TargetSelection.h"
5 #include "../common/fwd.h"
6
7 namespace battle {
8
9 class AttackChoice {
10
11 public:
12         enum Type {
13                 SWORD,
14                 MAGIC,
15                 DEFEND,
16                 IKARI,
17                 ITEM,
18                 UNDECIDED
19         };
20
21 public:
22         explicit AttackChoice(BattleState *b = 0) : thing(0), selection(b), type(UNDECIDED) { }
23         ~AttackChoice() { }
24
25 public:
26         Type GetType() const { return type; }
27         void SetType(Type t) { type = t; }
28         const common::Item *GetItem() const { return (const common::Item *)thing; }
29         void SetItem(const common::Item *i) { thing = i; }
30         const common::Spell *GetSpell() const { return (const common::Spell *)thing; }
31         void SetSpell(const common::Spell *s) { thing = s; }
32         TargetSelection &Selection() { return selection; }
33         const TargetSelection &Selection() const { return selection; }
34
35         void Reset();
36
37 private:
38         const void *thing;
39         TargetSelection selection;
40         Type type;
41
42 };
43
44 }
45
46 #endif /* BATTLE_ATTACKCHOICE_H_ */