Hero &HeroAt(int index) { return heroes[index]; }
const Hero &HeroAt(int index) const { return heroes[index]; }
- Monster &MonsterAt(std::vector<Monster>::size_type index) { return monsters[index]; }
- const Monster &MonsterAt(std::vector<Monster>::size_type index) const { return monsters[index]; }
+ Monster &MonsterAt(int index) { return monsters[index]; }
+ const Monster &MonsterAt(int index) const { return monsters[index]; }
const HeroTag &HeroTagAt(int index) const { return heroTags[index]; }
const geometry::Point<int> &HeroTagPositionAt(int index) const { return heroTagPositions[index]; }
const AttackChoice &AttackChoiceAt(int index) const { return attackChoices[index]; }
bool AttackSelectionDone() const { return activeHero >= numHeroes; }
+ int NumHeroes() const { return numHeroes; }
+ int MaxMonsters() const { return monsters.size(); }
+
const std::vector<geometry::Point<int> > &MonsterPositions() const { return monsterPositions; }
bool MonsterPositionOccupied(int index) { return index >= 0 && index < int(monsters.size()) && monsters[index].Health() > 0; }
const std::vector<geometry::Point<int> > &HeroesPositions() const { return heroesPositions; }
bool HeroPositionOccupied(int index) { return index >= 0 && index < numHeroes; }
- int NumHeroes() const { return numHeroes; }
- std::vector<Monster> &Monsters() { return monsters; }
- const std::vector<Monster> &Monsters() const { return monsters; }
void SetRunaway() { ranAway = true; }
void ClearAllAttacks();
if (titleBarText) {
titleBarText = 0;
++cursor;
- while (cursor < (int)battle->Monsters().size() && !battle->MonsterPositionOccupied(cursor)) {
+ while (cursor < battle->MaxMonsters() && !battle->MonsterPositionOccupied(cursor)) {
++cursor;
}
- if (cursor >= (int)battle->Monsters().size()) {
+ if (cursor >= battle->MaxMonsters()) {
battle->ClearAllAttacks();
ctrl->PopState();
}