]> git.localhorst.tv Git - l2e.git/blob - src/common/TargetingMode.h
f6f9e53f3947709f048c88f09b6340224cfe383d
[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         static const int TYPE_ID = 306;
19
20 public:
21         TargetingMode() : mode(0), ally(true) { }
22
23 public:
24         bool TargetsEnemy() const { return !ally; }
25         bool TargetsAlly() const { return ally; }
26         bool TargetsAll() const { return mode == ALL; }
27         bool TargetsMultiple() const { return mode == MULTIPLE; }
28         bool TargetsSingle() const { return mode == SINGLE; }
29
30         void TargetAll() { mode = ALL; }
31         void TargetMultiple() { mode = MULTIPLE; }
32         void TargetSingle() { mode = SINGLE; }
33         void TargetAlly() { ally = true; }
34         void TargetEnemy() { ally = false; }
35
36         static void CreateTypeDescription();
37         static void Construct(void *);
38
39 private:
40         enum {
41                 ALL = 0,
42                 MULTIPLE = 1,
43                 SINGLE = 2,
44         };
45         int mode;
46         bool ally;
47
48 };
49
50 }
51
52 #endif /* COMMON_TARGETINGMODE_H_ */