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 *);
44 bool Finished() const;
45 void Render(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
48 bool ExecuteCommand();
49 bool ExecuteStartTimer();
50 bool ExecuteAttackAnimation();
51 bool ExecuteSpellAnimation();
52 bool ExecuteTargetAnimation();
53 bool ExecuteFullscreenAnimation();
54 bool ExecuteWaitTimer();
55 bool ExecuteWaitAnimations();
69 Code(Command c) : command(c) { }
70 Code(int n) : number(n) { }
71 Code(void *p) : ptr(p) { }
78 std::vector<Code> text;
79 app::Timer<Uint32> timer;
80 struct AnimationMemo {
81 graphics::Animation *animation;
82 geometry::Point<int> position;
84 std::vector<AnimationMemo> animations;
85 std::vector<graphics::Animation *> foreignAnimations;
92 #endif /* BATTLE_ATTACKANIMATION_H_ */