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