]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
added dummy state that echoes all selected attacks
[l2e.git] / src / battle / BattleState.h
index 93e1e2b032c82a666dcb5cd1bed79c997530d243..347afc3f744e7bc3bfb2cec893c16f9aee48288e 100644 (file)
@@ -51,7 +51,8 @@ public:
        , res(res)
        , attackTypeMenu(res->attackIcons)
        , moveMenu(res->moveIcons)
-       , activeHero(-1) { }
+       , activeHero(-1)
+       , ranAway(false) { }
 
 public:
        void AddMonster(const Monster &);
@@ -65,7 +66,7 @@ public:
 
        virtual void Resize(int width, int height);
 
-       virtual void HandleInput(const app::Input &);
+       virtual void HandleEvents(const app::Input &);
        virtual void UpdateWorld(float deltaT);
        virtual void Render(SDL_Surface *);
 
@@ -82,6 +83,9 @@ public:
        const Hero &ActiveHero() const { return heroes[activeHero]; }
        Hero &HeroAt(std::vector<Hero>::size_type index) { return heroes[index]; }
        const Hero &HeroAt(std::vector<Hero>::size_type index) const { return heroes[index]; }
+       Monster &MonsterAt(std::vector<Monster>::size_type index) { return monsters[index]; }
+       const Monster &MonsterAt(std::vector<Monster>::size_type index) const { return monsters[index]; }
+       void SwapHeroes(std::vector<Hero>::size_type lhs, std::vector<Hero>::size_type rhs);
        const HeroTag &ActiveHeroTag() const { return heroTags[activeHero]; }
        const HeroTag &HeroTagAt(std::vector<Hero>::size_type index) const { return heroTags[index]; }
        const geometry::Point<int> &HeroTagPositionAt(std::vector<Hero>::size_type index) const { return heroTagPositions[index]; }
@@ -89,6 +93,7 @@ public:
        void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); }
        AttackChoice &ActiveHeroAttackChoice() { return attackChoices[activeHero]; }
        const AttackChoice &ActiveHeroAttackChoice() const { return attackChoices[activeHero]; }
+       const AttackChoice &AttackChoiceAt(std::vector<Hero>::size_type index) const { return attackChoices[index]; }
        TargetSelection &ActiveHeroTargets() { return attackChoices[activeHero].Selection(); }
        const TargetSelection &ActiveHeroTargets() const { return attackChoices[activeHero].Selection(); }
        bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); }
@@ -106,6 +111,11 @@ public:
        bool HeroPositionOccupied(int index) { return index >= 0 && index < int(heroes.size()); }
        std::vector<Hero> &Heroes() { return heroes; }
        const std::vector<Hero> &Heroes() const { return heroes; }
+       std::vector<Monster> &Monsters() { return monsters; }
+       const std::vector<Monster> &Monsters() const { return monsters; }
+
+       void SetRunaway() { ranAway = true; }
+       void ClearAllAttacks();
 
 public:
        geometry::Vector<int> CalculateScreenOffset(SDL_Surface *screen) const {
@@ -145,6 +155,7 @@ private:
        geometry::Point<int> heroTagPositions[4];
        AttackChoice attackChoices[4];
        int activeHero;
+       bool ranAway;
 
 };