AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; }
MoveMenu &GetMoveMenu() { return moveMenu; }
- graphics::Menu<const common::Spell *> &GetSpellMenu() { return heroes[activeHero].SpellMenu(); }
- const graphics::Menu<const common::Spell *> &GetSpellMenu() const { return heroes[activeHero].SpellMenu(); }
- graphics::Menu<const common::Item *> &GetIkariMenu() { return heroes[activeHero].IkariMenu(); }
- const graphics::Menu<const common::Item *> &GetIkariMenu() const { return heroes[activeHero].IkariMenu(); }
+ graphics::Menu<const common::Spell *> &GetSpellMenu() { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].SpellMenu(); }
+ const graphics::Menu<const common::Spell *> &GetSpellMenu() const { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].SpellMenu(); }
+ graphics::Menu<const common::Item *> &GetIkariMenu() { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].IkariMenu(); }
+ const graphics::Menu<const common::Item *> &GetIkariMenu() const { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].IkariMenu(); }
graphics::Menu<const common::Item *> &GetItemMenu() { return itemMenu; }
const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
bool BeforeFirstHero() const { return activeHero < 0; }
void PreviousHero();
void SwapHeroes(int lhs, int rhs);
- Hero &ActiveHero() { return heroes[activeHero]; }
- const Hero &ActiveHero() const { return heroes[activeHero]; }
+ 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]; }