]> git.localhorst.tv Git - l2e.git/blob - src/battle/AttackChoice.h
added spell target select
[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 Item;
15         class Spell;
16 }
17
18 namespace battle {
19
20 class AttackChoice {
21
22 public:
23         enum Type {
24                 SWORD,
25                 MAGIC,
26                 DEFEND,
27                 IKARI,
28                 ITEM,
29                 UNDECIDED
30         };
31
32 public:
33         explicit AttackChoice(BattleState *b = 0) : thing(0), selection(b), type(UNDECIDED) { }
34         ~AttackChoice() { }
35
36 public:
37         Type GetType() const { return type; }
38         void SetType(Type t) { type = t; }
39         const common::Item *GetItem() const { return (const common::Item *)thing; }
40         void SetItem(const common::Item *i) { thing = i; }
41         const common::Spell *GetSpell() const { return (const common::Spell *)thing; }
42         void SetSpell(const common::Spell *s) { thing = s; }
43         TargetSelection &Selection() { return selection; }
44         const TargetSelection &Selection() const { return selection; }
45
46         void Reset();
47
48 private:
49         const void *thing;
50         TargetSelection selection;
51         Type type;
52
53 };
54
55 }
56
57 #endif /* BATTLE_ATTACKCHOICE_H_ */