4 * Created on: Aug 10, 2012
8 #ifndef BATTLE_PERFORMATTACKS_H_
9 #define BATTLE_PERFORMATTACKS_H_
11 #include "../../app/State.h"
13 #include "../BattleState.h"
14 #include "../NumberAnimation.h"
15 #include "../../geometry/Vector.h"
16 #include "../../graphics/ComplexAnimation.h"
26 explicit PerformAttacks(BattleState *battle)
27 : ctrl(0), battle(battle), moveAnimation(0), targetAnimation(0), titleBarText(0), cursor(-1) { }
30 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
31 virtual void ExitState(app::Application &ctrl, SDL_Surface *screen);
32 virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen);
33 virtual void PauseState(app::Application &ctrl, SDL_Surface *screen);
35 virtual void Resize(int width, int height);
37 virtual void HandleEvents(const app::Input &);
38 virtual void UpdateWorld(float deltaT);
39 virtual void Render(SDL_Surface *);
42 void CheckAnimations();
43 bool HasAnimationsRunning() const;
44 void ResetAnimation();
47 void RenderTitleBar(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
48 void RenderNumbers(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
49 void RenderTargetAnimation(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
52 app::Application *ctrl;
54 graphics::Animation *moveAnimation;
55 graphics::Animation *targetAnimation;
56 const char *titleBarText;
57 app::Timer<Uint32> titleBarTimer;
58 app::Timer<Uint32> targetAnimationTimer;
59 std::vector<NumberAnimation> numberAnimation;
60 std::vector<geometry::Point<int> > numberPosition;
67 #endif /* BATTLE_PERFORMATTACKS_H_ */