4 * Created on: Aug 10, 2012
8 #ifndef BATTLE_PERFORMATTACKS_H_
9 #define BATTLE_PERFORMATTACKS_H_
11 #include "../../app/State.h"
13 #include "../NumberAnimation.h"
14 #include "../../math/Vector.h"
15 #include "../../graphics/Animation.h"
22 class TargetSelection;
28 explicit PerformAttacks(BattleState *battle)
29 : battle(battle), moveAnimation(0), targetAnimation(0), titleBarText(0), cursor(-1) { }
32 virtual void HandleEvents(const app::Input &);
33 virtual void UpdateWorld(Uint32 deltaT);
34 virtual void Render(SDL_Surface *);
37 virtual void OnEnterState(SDL_Surface *screen);
38 virtual void OnExitState(SDL_Surface *screen);
39 virtual void OnResumeState(SDL_Surface *screen);
40 virtual void OnPauseState(SDL_Surface *screen);
42 virtual void OnResize(int width, int height);
45 void CheckAnimations();
46 bool HasAnimationsRunning() const;
47 void ResetAnimation();
50 void AddNumberAnimations(const TargetSelection &);
52 void RenderTitleBar(SDL_Surface *screen, const math::Vector<int> &offset) const;
53 void RenderNumbers(SDL_Surface *screen, const math::Vector<int> &offset) const;
54 void RenderTargetAnimation(SDL_Surface *screen, const math::Vector<int> &offset) const;
58 graphics::AnimationRunner moveAnimation;
59 graphics::AnimationRunner targetAnimation;
60 const char *titleBarText;
61 app::Timer<Uint32> titleBarTimer;
62 app::Timer<Uint32> targetAnimationTimer;
63 std::vector<NumberAnimation> numberAnimation;
64 std::vector<math::Vector<int> > numberPosition;
71 #endif /* BATTLE_PERFORMATTACKS_H_ */