]> git.localhorst.tv Git - l2e.git/blob - src/common/TargetingMode.h
added constructors for described types
[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         static void Construct(void *);
35
36 private:
37         enum {
38                 ALL = 0,
39                 MULTIPLE = 1,
40                 SINGLE = 2,
41         };
42         int mode;
43         bool ally;
44
45 };
46
47 }
48
49 #endif /* COMMON_TARGETINGMODE_H_ */