]> git.localhorst.tv Git - l2e.git/blob - src/common/Spell.h
made Gauge default constructible
[l2e.git] / src / common / Spell.h
1 /*
2  * Spell.h
3  *
4  *  Created on: Aug 10, 2012
5  *      Author: holy
6  */
7
8 #ifndef COMMON_SPELL_H_
9 #define COMMON_SPELL_H_
10
11 #include "HeroGroup.h"
12 #include "TargetingMode.h"
13
14 namespace common {
15
16 class Spell {
17
18 public:
19         Spell();
20
21 public:
22         const char *Name() const { return name; }
23         Uint16 Value() const { return value; }
24         Uint8 Cost() const { return cost; }
25
26         bool CanUseOnStatusScreen() const { return usability & USABILITY_STATUS; }
27         bool CanUseInBattle() const { return usability & USABILITY_BATTLE; }
28
29         TargetingMode &GetTargetingMode() { return targetingMode; }
30         const TargetingMode &GetTargetingMode() const { return targetingMode; }
31
32         HeroGroup &UsableBy() { return usableBy; }
33         const HeroGroup &UsableBy() const { return usableBy; }
34
35 // temporary setters
36 public:
37         void SetName(const char *n) { name = n; }
38         void SetCost(Uint8 c) { cost = c; }
39         void SetUsableInBattle() { usability |= USABILITY_BATTLE; }
40
41 private:
42         enum Usability {
43                 // USABILITY_UNUSED = 1,
44                 // USABILITY_UNUSED = 2,
45                 // USABILITY_UNUSED = 4,
46                 // USABILITY_UNUSED = 8,
47                 // USABILITY_UNUSED = 16,
48                 // USABILITY_UNUSED = 32,
49                 USABILITY_STATUS = 64,
50                 USABILITY_BATTLE = 128,
51         };
52
53 private:
54         const char *name;
55
56         Uint16 value;
57
58         Uint8 cost;
59         Uint8 usability;
60         TargetingMode targetingMode;
61         HeroGroup usableBy;
62
63 };
64
65 }
66
67 #endif /* COMMON_SPELL_H_ */