X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.h;h=385962faeb0a7e7642e8e08c7d063a81227c0839;hb=ed792d6d00d822384d79d049e644e372f7c3b4cd;hp=5676cf93047e8c1d268086d92908d776aa1bc5c8;hpb=9d5e525f2bd9035e9add815e287313d09c1bf0fd;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 5676cf9..385962f 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -8,20 +8,18 @@ #ifndef BATTLE_HERO_H_ #define BATTLE_HERO_H_ +#include "fwd.h" +#include "AttackChoice.h" #include "Stats.h" +#include "../common/fwd.h" +#include "../geometry/Vector.h" +#include "../graphics/Animation.h" +#include "../graphics/fwd.h" +#include "../graphics/Menu.h" #include #include -namespace common { - class Item; - class Spell; -} -namespace graphics { - class Animation; - class Sprite; -} - namespace battle { class Hero { @@ -75,13 +73,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::Vector &Position() { return position; } + const geometry::Vector &Position() const { return position; } + + graphics::Menu &SpellMenu() { return spellMenu; } + const graphics::Menu &SpellMenu() const { return spellMenu; } + graphics::Menu &IkariMenu() { return ikariMenu; } + const graphics::Menu &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 +119,12 @@ 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; } + + static void CreateTypeDescription(); + static void Construct(void *); private: const char *name; @@ -120,20 +137,29 @@ 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::Vector position; + + graphics::Menu spellMenu; + graphics::Menu ikariMenu; + + AttackChoice attackChoice; // TODO: vector does not seem to be a good choice std::vector spells; - Uint16 maxHealth, health; - Uint16 maxMana, mana; + int maxHealth, health; + int maxMana, mana; Stats stats; - Uint8 level; - Uint8 ip; + int level; + int ip; };