]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/TargetSelection.h
refactored battle resources to better compatibility with loader
[l2e.git] / src / battle / TargetSelection.h
index 64500b0b02aca225a117e2005d60f881f63fae11..fd1d041c90fe604ea01b229be51036353a21da7d 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <vector>
 
+namespace common { class TargetingMode; }
+
 namespace battle {
 
 class BattleState;
@@ -20,8 +22,8 @@ public:
        explicit TargetSelection(BattleState *battle = 0, bool multiple = false, bool atEnemy = true);
 
 public:
-       bool TargetsEnemies() const { return enemy; }
-       bool TargetsHeroes() const { return !TargetsEnemies(); }
+       bool TargetsMonsters() const { return enemy; }
+       bool TargetsHeroes() const { return !TargetsMonsters(); }
        bool IsSelected(int index) const { return index >= 0 && index < int(selected.size()) && selected[index].type != State::IGNORE; }
        bool HasSelected() const { return selection >= 0; }
        int SingleSelection() const { return selection; }
@@ -31,7 +33,9 @@ public:
        bool SelectSingle() const { return !SelectMultiple(); }
        void SetSingle() { multiple = false; }
 
-       void SelectEnemies();
+       void ReadMode(const common::TargetingMode &);
+
+       void SelectMonsters();
        void SelectHeroes();
        void Select(int index) { selected[index].type = State::SELECTED; selection = index; }
        void Unselect(int index) { selected[index].type = State::IGNORE; }
@@ -54,6 +58,9 @@ public:
        void SetGood(int index, int amount) { selected[index].type = State::GOOD; selected[index].number = amount; }
        void SetBad(int index, int amount) { selected[index].type = State::BAD; selected[index].number = amount; }
        int GetAmount(int index) const { return selected[index].number; }
+       bool Missed(int index) const { return selected[index].type == State::MISS; }
+       bool IsGood(int index) const { return selected[index].type == State::GOOD; }
+       bool IsBad(int index) const { return selected[index].type == State::BAD; }
 
 private:
        void FindNextEnemy();