4 * Created on: Aug 13, 2012
8 #ifndef BATTLE_ATTACKANIMATION_H_
9 #define BATTLE_ATTACKANIMATION_H_
11 #include "../app/Timer.h"
12 #include "../geometry/Point.h"
13 #include "../geometry/Vector.h"
18 namespace app { class State; }
19 namespace graphics { class Animation; }
25 class AttackAnimation {
28 AttackAnimation() : battle(0), state(0), cursor(0) { }
32 void StartTimer(int ms);
33 void PlayAttackAnimation();
34 void PlaySpellAnimation();
35 void PlayTargetAnimation(graphics::Animation *);
36 void PlayFullscreenAnimation(graphics::Animation *);
38 void WaitForAnimations();
41 void Start(BattleState *, app::State *);
43 bool Finished() const;
44 void Render(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
47 bool ExecuteCommand();
48 bool ExecuteStartTimer();
49 bool ExecuteAttackAnimation();
50 bool ExecuteSpellAnimation();
51 bool ExecuteTargetAnimation();
52 bool ExecuteFullscreenAnimation();
53 bool ExecuteWaitTimer();
54 bool ExecuteWaitAnimations();
68 Code(Command c) : command(c) { }
69 Code(int n) : number(n) { }
70 Code(void *p) : ptr(p) { }
77 std::vector<Code> text;
78 app::Timer<Uint32> timer;
79 struct AnimationMemo {
80 graphics::Animation *animation;
81 geometry::Point<int> position;
83 std::vector<AnimationMemo> animations;
84 std::vector<graphics::Animation *> foreignAnimations;
91 #endif /* BATTLE_ATTACKANIMATION_H_ */