- void PreviousHero() { --activeHero; }
- Hero &ActiveHero() { return heroes[activeHero]; }
- const Hero &ActiveHero() const { return heroes[activeHero]; }
- Hero &HeroAt(std::vector<Hero>::size_type index) { return heroes[index]; }
- const Hero &HeroAt(std::vector<Hero>::size_type index) const { return heroes[index]; }
- const HeroTag &ActiveHeroTag() const { return heroTags[activeHero]; }
- const HeroTag &HeroTagAt(std::vector<Hero>::size_type index) const { return heroTags[index]; }
- const geometry::Point<int> &HeroTagPositionAt(std::vector<Hero>::size_type index) const { return heroTagPositions[index]; }
- bool HasChosenAttackType() const { return attackChoices[activeHero].GetType() != AttackChoice::UNDECIDED; }
- void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); }
- TargetSelection &ActiveHeroTargets() { return attackChoices[activeHero].Selection(); }
- const TargetSelection &ActiveHeroTargets() const { return attackChoices[activeHero].Selection(); }
- bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); }
-
- graphics::Menu</* Spell */ void *> &GetSpellMenu() { return spellMenus[activeHero]; }
- const graphics::Menu</* Spell */ void *> &GetSpellMenu() const { return spellMenus[activeHero]; }
- graphics::Menu</* Ikari or Item */ void *> &GetIkariMenu() { return ikariMenus[activeHero]; }
- const graphics::Menu</* Ikari or Item */ void *> &GetIkariMenu() const { return ikariMenus[activeHero]; }
- graphics::Menu<const common::Item *> &GetItemMenu() { return itemMenu; }
- const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
-
- const std::vector<geometry::Point<int> > &MonsterPositions() const { return monsterPositions; }
+ void PreviousHero();
+ void SwapHeroes(int lhs, int rhs);
+ Hero &ActiveHero() { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero]; }
+ const Hero &ActiveHero() const { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero]; }
+
+ Hero &HeroAt(int index) { assert(index >= 0 && index < NumHeroes()); return heroes[index]; }
+ const Hero &HeroAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroes[index]; }
+ Monster &MonsterAt(int index) { assert(index >= 0 && index < NumHeroes()); return monsters[index]; }
+ const Monster &MonsterAt(int index) const { assert(index >= 0 && index < NumHeroes()); return monsters[index]; }
+
+ const HeroTag &HeroTagAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTags[index]; }
+ const geometry::Vector<int> &HeroTagPositionAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTagPositions[index]; }
+
+ bool HasChosenAttackType() const { return ActiveHero().GetAttackChoice().GetType() != AttackChoice::UNDECIDED; }
+ bool AttackSelectionDone() const { return activeHero >= numHeroes; }
+
+ int NumHeroes() const { return numHeroes; }
+ int MaxHeroes() const { return 4; }
+ int MaxMonsters() const { return monsters.size(); }
+