X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=1a0586c9025e31b42113468bc06c50e607517bfe;hb=b7a90738b9ae701cfc86bf74a11ba59d7fcb17ba;hp=96a7ce20643d5b62f4aee3d3c9f0f68103280a3a;hpb=7946f704a4cd3a985d2fb523079fce7fa14c341e;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 96a7ce2..1a0586c 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -79,9 +79,19 @@ public: void PreviousHero() { --activeHero; } Hero &ActiveHero() { return heroes[activeHero]; } const Hero &ActiveHero() const { return heroes[activeHero]; } + Hero &HeroAt(std::vector::size_type index) { return heroes[index]; } + const Hero &HeroAt(std::vector::size_type index) const { return heroes[index]; } + const HeroTag &ActiveHeroTag() const { return heroTags[activeHero]; } + const HeroTag &HeroTagAt(std::vector::size_type index) const { return heroTags[index]; } + const geometry::Point &HeroTagPositionAt(std::vector::size_type index) const { return heroTagPositions[index]; } bool HasChosenAttackType() const { return attackChoices[activeHero].GetType() != AttackChoice::UNDECIDED; } void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); } + AttackChoice &ActiveHeroAttackChoice() { return attackChoices[activeHero]; } + const AttackChoice &ActiveHeroAttackChoice() const { return attackChoices[activeHero]; } + TargetSelection &ActiveHeroTargets() { return attackChoices[activeHero].Selection(); } + const TargetSelection &ActiveHeroTargets() const { return attackChoices[activeHero].Selection(); } bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); } + graphics::Menu &GetSpellMenu() { return spellMenus[activeHero]; } const graphics::Menu &GetSpellMenu() const { return spellMenus[activeHero]; } graphics::Menu &GetIkariMenu() { return ikariMenus[activeHero]; } @@ -89,6 +99,13 @@ public: graphics::Menu &GetItemMenu() { return itemMenu; } const graphics::Menu &GetItemMenu() const { return itemMenu; } + const std::vector > &MonsterPositions() const { return monsterPositions; } + bool MonsterPositionOccupied(int index) { return index >= 0 && index < int(monsters.size()) && monsters[index].Health() > 0; } + const std::vector > &HeroesPositions() const { return heroesPositions; } + bool HeroPositionOccupied(int index) { return index >= 0 && index < int(heroes.size()); } + std::vector &Heroes() { return heroes; } + const std::vector &Heroes() const { return heroes; } + public: geometry::Vector CalculateScreenOffset(SDL_Surface *screen) const { return geometry::Vector( @@ -113,6 +130,7 @@ private: const Resources *res; AttackTypeMenu attackTypeMenu; MoveMenu moveMenu; + // TODO: combine all data about heros or monsters std::vector > monsterPositions; std::vector > heroesPositions; std::vector monsters; @@ -120,8 +138,9 @@ private: std::vector > spellMenus; graphics::Menu itemMenu; std::vector > ikariMenus; - std::vector heroTags; - std::vector attackChoices; + HeroTag heroTags[4]; + geometry::Point heroTagPositions[4]; + AttackChoice attackChoices[4]; int activeHero; };