]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
closed the gap between battle and map state (yay)
[l2e.git] / src / battle / BattleState.h
index e002b7c026d8c33816d5bfadf5f213b9606fadf3..60c24bc87aef33faf4537d961d82ea8cf05bc199 100644 (file)
@@ -18,6 +18,7 @@
 #include "SmallHeroTag.h"
 #include "../app/fwd.h"
 #include "../app/State.h"
+#include "../common/GameConfig.h"
 #include "../common/fwd.h"
 #include "../common/Stats.h"
 #include "../geometry/Vector.h"
@@ -35,11 +36,12 @@ class BattleState
 : public app::State {
 
 public:
-       BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const Resources *res)
-       : background(background)
-       , monstersLayout(&monstersLayout)
-       , heroesLayout(&heroesLayout)
-       , res(res)
+       BattleState(common::GameConfig *game, SDL_Surface *background, const PartyLayout *monstersLayout)
+       : game(game)
+       , background(background)
+       , monstersLayout(monstersLayout)
+       , heroesLayout(game->heroesLayout)
+       , res(game->battleResources)
        , attackTypeMenu(res->attackIcons)
        , moveMenu(res->moveIcons)
        , numHeroes(0)
@@ -47,7 +49,7 @@ public:
        , attackCursor(-1)
        , expReward(0)
        , goldReward(0)
-       , ranAway(false) { assert(background && res); }
+       , ranAway(false) { assert(background && monstersLayout && game); }
 
 public:
        void AddMonster(const Monster &);
@@ -143,6 +145,7 @@ private:
        Uint16 CalculateDamage(const common::Stats &attacker, const common::Stats &defender) const;
 
 private:
+       common::GameConfig *game;
        SDL_Surface *background;
        const PartyLayout *monstersLayout;
        const PartyLayout *heroesLayout;