]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.h
added target selection type detection for weapons
[l2e.git] / src / battle / Hero.h
index 5676cf93047e8c1d268086d92908d776aa1bc5c8..74449026f93efe706ac469222d895e6194808517 100644 (file)
@@ -8,7 +8,11 @@
 #ifndef BATTLE_HERO_H_
 #define BATTLE_HERO_H_
 
+#include "AttackChoice.h"
 #include "Stats.h"
+#include "../geometry/Point.h"
+#include "../graphics/Animation.h"
+#include "../graphics/Menu.h"
 
 #include <vector>
 #include <SDL.h>
@@ -18,12 +22,13 @@ namespace common {
        class Spell;
 }
 namespace graphics {
-       class Animation;
        class Sprite;
 }
 
 namespace battle {
 
+class Resources;
+
 class Hero {
 
 public:
@@ -75,13 +80,29 @@ public:
        bool HasRing() const { return ring; }
        bool HasJewel() const { return jewel; }
 
-       graphics::Animation *MeleeAnimation() { return meleeAnimation; }
+       graphics::AnimationRunner &GetAnimation() { return animation; }
+       const graphics::AnimationRunner &GetAnimation() const { return animation; }
+       void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
+
        const graphics::Animation *MeleeAnimation() const { return meleeAnimation; }
-       graphics::Animation *AttackAnimation() { return attackAnimation; }
        const graphics::Animation *AttackAnimation() const { return attackAnimation; }
-       graphics::Animation *SpellAnimation() { return spellAnimation; }
        const graphics::Animation *SpellAnimation() const { return spellAnimation; }
 
+       geometry::Point<int> &Position() { return position; }
+       const geometry::Point<int> &Position() const { return position; }
+
+       graphics::Menu<const common::Spell *> &SpellMenu() { return spellMenu; }
+       const graphics::Menu<const common::Spell *> &SpellMenu() const { return spellMenu; }
+       graphics::Menu<const common::Item *> &IkariMenu() { return ikariMenu; }
+       const graphics::Menu<const common::Item *> &IkariMenu() const { return ikariMenu; }
+
+       AttackChoice &GetAttackChoice() { return attackChoice; }
+       const AttackChoice &GetAttackChoice() const { return attackChoice; }
+
+public:
+       void UpdateSpellMenu();
+       void UpdateIkariMenu(const Resources *);
+
 // temporary setters until loader is implemented
 public:
        void SetName(const char *n) { name = n; }
@@ -105,9 +126,9 @@ public:
 
        void AddSpell(const common::Spell *s) { spells.push_back(s); }
 
-       void SetMeleeAnimation(graphics::Animation *a) { meleeAnimation = a; }
-       void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
-       void SetSpellAnimation(graphics::Animation *a) { spellAnimation = a; }
+       void SetMeleeAnimation(const graphics::Animation *a) { meleeAnimation = a; }
+       void SetAttackAnimation(const graphics::Animation *a) { attackAnimation = a; }
+       void SetSpellAnimation(const graphics::Animation *a) { spellAnimation = a; }
 
 private:
        const char *name;
@@ -120,9 +141,18 @@ private:
        common::Item *ring;
        common::Item *jewel;
 
-       graphics::Animation *meleeAnimation;
-       graphics::Animation *attackAnimation;
-       graphics::Animation *spellAnimation;
+       const graphics::Animation *meleeAnimation;
+       const graphics::Animation *attackAnimation;
+       const graphics::Animation *spellAnimation;
+
+       graphics::AnimationRunner animation;
+
+       geometry::Point<int> position;
+
+       graphics::Menu<const common::Spell *> spellMenu;
+       graphics::Menu<const common::Item *> ikariMenu;
+
+       AttackChoice attackChoice;
 
        // TODO: vector does not seem to be a good choice
        std::vector<const common::Spell *> spells;