-/*
- * TargetSelection.h
- *
- * Created on: Aug 9, 2012
- * Author: holy
- */
-
#ifndef BATTLE_TARGETSELECTION_H_
#define BATTLE_TARGETSELECTION_H_
+namespace battle {
+ class Battle;
+}
+namespace common {
+ class TargetingMode;
+}
+
#include <vector>
-namespace battle {
-class BattleState;
+namespace battle {
class TargetSelection {
public:
- explicit TargetSelection(BattleState *battle = 0, bool multiple = false, bool atEnemy = true);
+ TargetSelection();
+ explicit TargetSelection(Battle *battle, 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; }
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; }
int number;
explicit State(Type type = IGNORE, int num = 0) : type(type), number(num) { }
};
- BattleState *battle;
+ Battle *battle;
std::vector<State> selected;
int selection;
int cursor;
}
-#endif /* BATTLE_TARGETSELECTION_H_ */
+#endif