]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
renamed BattleState's GetItemMenu -> ItemMenu
[l2e.git] / src / battle / BattleState.h
index 0143fe0fac21cefd940e2e9a48fb50dfa7df2321..4a07f8e7396ab1fe8c41f2bc0b6e8ac973a39b9b 100644 (file)
@@ -84,19 +84,15 @@ public:
        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::Item *> &GetItemMenu() { return itemMenu; }
-       const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
+       graphics::Menu<const common::Item *> &ItemMenu() { return itemMenu; }
+       const graphics::Menu<const common::Item *> &ItemMenu() const { return itemMenu; }
 
        void NextHero();
        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]; }
@@ -106,13 +102,7 @@ public:
        const HeroTag &HeroTagAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTags[index]; }
        const geometry::Point<int> &HeroTagPositionAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTagPositions[index]; }
 
-       bool HasChosenAttackType() const { return ActiveHeroAttackChoice().GetType() != AttackChoice::UNDECIDED; }
-       AttackChoice &ActiveHeroAttackChoice() { return AttackChoiceAt(activeHero); }
-       const AttackChoice &ActiveHeroAttackChoice() const { return AttackChoiceAt(activeHero); }
-       AttackChoice &AttackChoiceAt(int index) { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); }
-       const AttackChoice &AttackChoiceAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); }
-       AttackChoice &MonsterAttackChoiceAt(int index) { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; }
-       const AttackChoice &MonsterAttackChoiceAt(int index) const { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; }
+       bool HasChosenAttackType() const { return ActiveHero().GetAttackChoice().GetType() != AttackChoice::UNDECIDED; }
        bool AttackSelectionDone() const { return activeHero >= numHeroes; }
 
        int NumHeroes() const { return numHeroes; }
@@ -176,7 +166,6 @@ private:
        std::vector<geometry::Point<int> > monsterPositions;
        std::vector<geometry::Point<int> > heroesPositions;
        std::vector<Monster> monsters;
-       std::vector<AttackChoice> monsterAttacks;
        std::vector<Order> attackOrder;
        Hero heroes[4];
        graphics::Menu<const common::Item *> itemMenu;