]> git.localhorst.tv Git - l2e.git/blob - src/common/TargetingMode.h
converted pseudo-fields into real ones
[l2e.git] / src / common / TargetingMode.h
1 /*
2  * TargetingMode.h
3  *
4  *  Created on: Aug 10, 2012
5  *      Author: holy
6  */
7
8 #ifndef COMMON_TARGETINGMODE_H_
9 #define COMMON_TARGETINGMODE_H_
10
11 #include <SDL.h>
12
13 namespace common {
14
15 class TargetingMode {
16
17 public:
18         TargetingMode() : mode(0), ally(true) { }
19
20 public:
21         bool TargetsEnemy() const { return !ally; }
22         bool TargetsAlly() const { return ally; }
23         bool TargetsAll() const { return mode == ALL; }
24         bool TargetsMultiple() const { return mode == MULTIPLE; }
25         bool TargetsSingle() const { return mode == SINGLE; }
26
27         void TargetAll() { mode = ALL; }
28         void TargetMultiple() { mode = MULTIPLE; }
29         void TargetSingle() { mode = SINGLE; }
30         void TargetAlly() { ally = true; }
31         void TargetEnemy() { ally = false; }
32
33         static void CreateTypeDescription();
34
35 private:
36         enum {
37                 ALL = 0,
38                 MULTIPLE = 1,
39                 SINGLE = 2,
40         };
41         int mode;
42         bool ally;
43
44 };
45
46 }
47
48 #endif /* COMMON_TARGETINGMODE_H_ */