]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
added struct for battle resources
[l2e.git] / src / battle / BattleState.h
index 858b111c426283008570054b8f48030dee72901a..484e4529c6a49d7d78776b3de9420f286a96bcdf 100644 (file)
@@ -14,6 +14,7 @@
 #include "HeroTag.h"
 #include "Monster.h"
 #include "MoveMenu.h"
+#include "Resources.h"
 #include "../app/State.h"
 #include "../geometry/Point.h"
 #include "../geometry/Vector.h"
@@ -37,20 +38,13 @@ 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, const graphics::Frame *selectFrame)
+       BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const Resources *res)
        : background(background)
        , monstersLayout(&monstersLayout)
        , heroesLayout(&heroesLayout)
-       , heroTagFrame(heroTagFrame)
-       , activeHeroTagFrame(activeHeroTagFrame)
-       , healthGauge(healthGauge)
-       , manaGauge(manaGauge)
-       , ikariGauge(ikariGauge)
-       , heroTagSprites(heroTagSprites)
-       , heroTagFont(heroTagFont)
-       , selectFrame(selectFrame)
-       , attackTypeMenu(attackIcons)
-       , moveMenu(moveIcons)
+       , res(res)
+       , attackTypeMenu(res->attackIcons)
+       , moveMenu(res->moveIcons)
        , activeHero(-1) { }
 
 public:
@@ -70,9 +64,9 @@ public:
        virtual void Render(SDL_Surface *);
 
 public:
+       const Resources &Res() const { return *res; }
        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; }
@@ -102,14 +96,7 @@ private:
        SDL_Surface *background;
        const PartyLayout *monstersLayout;
        const PartyLayout *heroesLayout;
-       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;
+       const Resources *res;
        AttackTypeMenu attackTypeMenu;
        MoveMenu moveMenu;
        std::vector<geometry::Point<int> > monsterPositions;