4 * Created on: Aug 10, 2012
8 #ifndef COMMON_TARGETINGMODE_H_
9 #define COMMON_TARGETINGMODE_H_
18 TargetingMode() : mode(0) { }
21 bool TargetsEnemy() const { return (mode & FACTION_MASK) == ENEMY; }
22 bool TargetsAlly() const { return (mode & FACTION_MASK) == ALLY; }
23 bool TargetsAll() const { return (mode & COUNT_MASK) == ALL; }
24 bool TargetsMultiple() const { return (mode & COUNT_MASK) == MULTIPLE; }
25 bool TargetsSingle() const { return (mode & COUNT_MASK) == SINGLE; }
27 void TargetAll() { mode = (mode & FACTION_MASK) | ALL; }
28 void TargetMultiple() { mode = (mode & FACTION_MASK) | MULTIPLE; }
29 void TargetSingle() { mode = (mode & FACTION_MASK) | SINGLE; }
30 void TargetAlly() { mode = ALLY | (mode & COUNT_MASK); }
31 void TargetEnemy() { mode = ENEMY | (mode & COUNT_MASK); }
33 void TargetAllEnemies() { mode = ENEMY | ALL; }
34 void TargetMultipleEnemies() { mode = ENEMY | MULTIPLE; }
35 void TargetSingleEnemy() { mode = ENEMY | SINGLE; }
36 void TargetAllAllies() { mode = ALLY | ALL; }
37 void TargetMultipleAllies() { mode = ALLY | MULTIPLE; }
38 void TargetSingleAlly() { mode = ALLY | SINGLE; }
56 #endif /* COMMON_TARGETINGMODE_H_ */