]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
added forwarding headers
[l2e.git] / src / battle / BattleState.h
index 4fd9a15165696399e2100190c51b77b7c1ff44b3..fbaa1d0169f79107b954ba3ece200ca18018454f 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef BATTLE_BATTLESTATE_H_
 #define BATTLE_BATTLESTATE_H_
 
+#include "fwd.h"
 #include "AttackTypeMenu.h"
 #include "Hero.h"
 #include "HeroTag.h"
 #include "MoveMenu.h"
 #include "Resources.h"
 #include "SmallHeroTag.h"
+#include "../app/fwd.h"
 #include "../app/State.h"
-#include "../geometry/Point.h"
+#include "../common/fwd.h"
 #include "../geometry/Vector.h"
 #include "../graphics/Animation.h"
+#include "../graphics/fwd.h"
 #include "../graphics/Menu.h"
 
 #include <cassert>
 #include <vector>
 #include <SDL.h>
 
-namespace app { class Input; }
-namespace common {
-       class Inventory;
-       class Item;
-       class Spell;
-}
-namespace graphics {
-       class Font;
-       class Frame;
-       class Gauge;
-       class Sprite;
-}
-
 namespace battle {
 
-class AttackChoice;
-class PartyLayout;
-class Stats;
-
 class BattleState
 : public app::State {
 
@@ -99,7 +85,7 @@ public:
        const Monster &MonsterAt(int index) const { assert(index >= 0 && index < NumHeroes()); return monsters[index]; }
 
        const HeroTag &HeroTagAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTags[index]; }
-       const geometry::Point<int> &HeroTagPositionAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTagPositions[index]; }
+       const geometry::Vector<int> &HeroTagPositionAt(int index) const { assert(index >= 0 && index < NumHeroes()); return heroTagPositions[index]; }
 
        bool HasChosenAttackType() const { return ActiveHero().GetAttackChoice().GetType() != AttackChoice::UNDECIDED; }
        bool AttackSelectionDone() const { return activeHero >= numHeroes; }
@@ -140,6 +126,7 @@ public:
        }
        int Width() const { return background->w; }
        int Height() const { return background->h; }
+       geometry::Vector<int> Size() const { return geometry::Vector<int>(Width(), Height()); }
 
        void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
        void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
@@ -150,7 +137,8 @@ public:
 private:
        void LoadInventory();
 
-       void DecideMonsterAttack(Monster &);
+       void DecideMonsterAttack(Monster &) const;
+       void CalculateDamage(const Stats &attackerStats, TargetSelection &targets) const;
        Uint16 CalculateDamage(const Stats &attacker, const Stats &defender) const;
 
 private:
@@ -166,8 +154,8 @@ private:
        graphics::Menu<const common::Item *> itemMenu;
        HeroTag heroTags[4];
        SmallHeroTag smallHeroTags[4];
-       geometry::Point<int> heroTagPositions[4];
-       geometry::Point<int> smallHeroTagPositions[4];
+       geometry::Vector<int> heroTagPositions[4];
+       geometry::Vector<int> smallHeroTagPositions[4];
        int numHeroes;
        int activeHero;
        int attackCursor;