X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=60c24bc87aef33faf4537d961d82ea8cf05bc199;hb=f1e445b660889a18eaf05e7fcc16b360fb8605d5;hp=e002b7c026d8c33816d5bfadf5f213b9606fadf3;hpb=06b6411e5dc8fc6b905530f7adbde8bd0c2bb0ea;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index e002b7c..60c24bc 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -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;