X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=3561609e91c105a34413a8b29d042d7d1a0c50ce;hb=5121f4215d725f492bea084fb94900d7e5972743;hp=9f30fb5a1d439effc3b4ef8857ac1d7d69d1df60;hpb=9a273798937710928304fdcc5e33a78c6f8b48be;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 9f30fb5..3561609 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -8,7 +8,6 @@ #ifndef BATTLE_BATTLESTATE_H_ #define BATTLE_BATTLESTATE_H_ -#include "AttackChoice.h" #include "AttackTypeMenu.h" #include "Hero.h" #include "HeroTag.h" @@ -41,6 +40,7 @@ namespace graphics { namespace battle { +class AttackChoice; class PartyLayout; class Stats; @@ -84,10 +84,10 @@ public: AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; } MoveMenu &GetMoveMenu() { return moveMenu; } - graphics::Menu &GetSpellMenu() { return spellMenus[activeHero]; } - const graphics::Menu &GetSpellMenu() const { return spellMenus[activeHero]; } - graphics::Menu &GetIkariMenu() { return ikariMenus[activeHero]; } - const graphics::Menu &GetIkariMenu() const { return ikariMenus[activeHero]; } + graphics::Menu &GetSpellMenu() { return heroes[activeHero].SpellMenu(); } + const graphics::Menu &GetSpellMenu() const { return heroes[activeHero].SpellMenu(); } + graphics::Menu &GetIkariMenu() { return heroes[activeHero].IkariMenu(); } + const graphics::Menu &GetIkariMenu() const { return heroes[activeHero].IkariMenu(); } graphics::Menu &GetItemMenu() { return itemMenu; } const graphics::Menu &GetItemMenu() const { return itemMenu; } @@ -109,8 +109,8 @@ public: bool HasChosenAttackType() const { return ActiveHeroAttackChoice().GetType() != AttackChoice::UNDECIDED; } AttackChoice &ActiveHeroAttackChoice() { return AttackChoiceAt(activeHero); } const AttackChoice &ActiveHeroAttackChoice() const { return AttackChoiceAt(activeHero); } - AttackChoice &AttackChoiceAt(int index) { assert(index >= 0 && index < NumHeroes()); return attackChoices[index]; } - const AttackChoice &AttackChoiceAt(int index) const { assert(index >= 0 && index < NumHeroes()); return attackChoices[index]; } + AttackChoice &AttackChoiceAt(int index) { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); } + const AttackChoice &AttackChoiceAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroes[index].GetAttackChoice(); } AttackChoice &MonsterAttackChoiceAt(int index) { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; } const AttackChoice &MonsterAttackChoiceAt(int index) const { assert(index >= 0 && index < MaxMonsters()); return monsterAttacks[index]; } bool AttackSelectionDone() const { return activeHero >= numHeroes; } @@ -161,8 +161,6 @@ public: void RenderSmallHeroTags(SDL_Surface *screen, const geometry::Vector &offset); private: - void LoadSpellMenu(std::vector::size_type heroIndex); - void LoadIkariMenu(std::vector::size_type heroIndex); void LoadInventory(); Uint16 CalculateDamage(const Stats &attacker, const Stats &defender) const; @@ -181,14 +179,11 @@ private: std::vector monsterAttacks; std::vector attackOrder; Hero heroes[4]; - graphics::Menu spellMenus[4]; graphics::Menu itemMenu; - graphics::Menu ikariMenus[4]; HeroTag heroTags[4]; SmallHeroTag smallHeroTags[4]; geometry::Point heroTagPositions[4]; geometry::Point smallHeroTagPositions[4]; - AttackChoice attackChoices[4]; int numHeroes; int activeHero; int attackCursor;