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"
22 class AttackAnimation;
28 explicit PerformAttacks(BattleState *battle)
29 : ctrl(0), battle(battle), moveAnimation(0), attackAnimation(0), titleBarText(0), cursor(-1) { }
32 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
33 virtual void ExitState(app::Application &ctrl, SDL_Surface *screen);
34 virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen);
35 virtual void PauseState(app::Application &ctrl, SDL_Surface *screen);
37 virtual void Resize(int width, int height);
39 virtual void HandleEvents(const app::Input &);
40 virtual void UpdateWorld(float deltaT);
41 virtual void Render(SDL_Surface *);
44 void CheckNumberAnimation();
45 bool HasAnimationsRunning() const;
46 void ResetAnimation();
48 bool Finished() const { return cursor >= int(order.size()); }
51 void RenderTitleBar(SDL_Surface *screen, const geometry::Vector<int> &offset);
52 void RenderNumbers(SDL_Surface *screen, const geometry::Vector<int> &offset);
55 app::Application *ctrl;
57 graphics::Animation *moveAnimation;
58 AttackAnimation *attackAnimation;
59 const char *titleBarText;
60 app::Timer<Uint32> titleBarTimer;
61 std::vector<BattleState::Order> order;
62 std::vector<NumberAnimation> numberAnimation;
63 std::vector<geometry::Point<int> > numberPosition;
70 #endif /* BATTLE_PERFORMATTACKS_H_ */