X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=65e8727906859fd442c174107ce92782d603fb1d;hb=57675025108b7ad3989737f18ebfeec8e5e44889;hp=858b111c426283008570054b8f48030dee72901a;hpb=185c6c79f8ba30981aad4e1d66f98143a344b95e;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 858b111..65e8727 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -14,9 +14,11 @@ #include "HeroTag.h" #include "Monster.h" #include "MoveMenu.h" +#include "Resources.h" #include "../app/State.h" #include "../geometry/Point.h" #include "../geometry/Vector.h" +#include "../graphics/Menu.h" #include #include @@ -37,20 +39,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 +65,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; } @@ -83,6 +78,10 @@ public: 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(); } + graphics::Menu &GetSpellMenu() { return spellMenus[activeHero]; } + const graphics::Menu &GetSpellMenu() const { return spellMenus[activeHero]; } + graphics::Menu &GetItemMenu() { return itemMenu; } + const graphics::Menu &GetItemMenu() const { return itemMenu; } public: geometry::Vector CalculateScreenOffset(SDL_Surface *screen) const { @@ -102,20 +101,15 @@ 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 > monsterPositions; std::vector > heroesPositions; std::vector monsters; std::vector heroes; + std::vector > spellMenus; + graphics::Menu itemMenu; std::vector heroTags; std::vector attackChoices; int activeHero;