]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
added spell selection battle state
[l2e.git] / src / battle / BattleState.h
index 72342f0961e0616de36b058305a7fa30127722a5..858b111c426283008570054b8f48030dee72901a 100644 (file)
@@ -37,7 +37,7 @@ class BattleState
 : public app::State {
 
 public:
-       BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const graphics::Sprite *attackIcons, const graphics::Sprite *moveIcons, const graphics::Frame *heroTagFrame, const graphics::Frame *activeHeroTagFrame, const graphics::Gauge *healthGauge, const graphics::Gauge *manaGauge, const graphics::Gauge *ikariGauge, const graphics::Sprite *heroTagSprites, const graphics::Font *heroTagFont)
+       BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const graphics::Sprite *attackIcons, const graphics::Sprite *moveIcons, const graphics::Frame *heroTagFrame, const graphics::Frame *activeHeroTagFrame, const graphics::Gauge *healthGauge, const graphics::Gauge *manaGauge, const graphics::Gauge *ikariGauge, const graphics::Sprite *heroTagSprites, const graphics::Font *heroTagFont, const graphics::Frame *selectFrame)
        : background(background)
        , monstersLayout(&monstersLayout)
        , heroesLayout(&heroesLayout)
@@ -48,6 +48,7 @@ public:
        , ikariGauge(ikariGauge)
        , heroTagSprites(heroTagSprites)
        , heroTagFont(heroTagFont)
+       , selectFrame(selectFrame)
        , attackTypeMenu(attackIcons)
        , moveMenu(moveIcons)
        , activeHero(-1) { }
@@ -71,9 +72,14 @@ public:
 public:
        AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; }
        MoveMenu &GetMoveMenu() { return moveMenu; }
+       const graphics::Frame &GetSelectFrame() const { return *selectFrame; }
 
        bool HasMoreHeroes() const { return activeHero < (int) heroes.size(); }
        void NextHero() { ++activeHero; }
+       bool BeforeFirstHero() const { return activeHero < 0; }
+       void PreviousHero() { --activeHero; }
+       Hero &ActiveHero() { return heroes[activeHero]; }
+       const Hero &ActiveHero() const { return heroes[activeHero]; }
        bool HasChosenAttackType() const { return attackChoices[activeHero].GetType() != AttackChoice::UNDECIDED; }
        void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); }
        bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); }
@@ -103,6 +109,7 @@ private:
        const graphics::Gauge *ikariGauge;
        const graphics::Sprite *heroTagSprites;
        const graphics::Font *heroTagFont;
+       const graphics::Frame *selectFrame;
        AttackTypeMenu attackTypeMenu;
        MoveMenu moveMenu;
        std::vector<geometry::Point<int> > monsterPositions;