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) { }
33 void WaitForAnimation();
34 void PlayAttackAnimation();
35 void PlaySpellAnimation();
36 void PlayTargetAnimation(graphics::Animation *);
37 void PlayFullscreenAnimation(graphics::Animation *);
40 void Start(BattleState *, app::State *);
42 bool Finished() const;
43 void Render(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
46 bool ExecuteCommand();
49 bool ExecuteWaitAnimation();
50 bool ExecuteAttackAnimation();
51 bool ExecuteSpellAnimation();
52 bool ExecuteTargetAnimation();
53 bool ExecuteFullscreenAnimation();
65 Code(Command c) : command(c) { }
66 Code(int n) : number(n) { }
67 Code(void *p) : ptr(p) { }
74 std::vector<Code> text;
75 app::Timer<Uint32> timer;
76 struct AnimationMemo {
77 graphics::Animation *animation;
78 geometry::Point<int> position;
80 std::vector<AnimationMemo> animations;
81 std::vector<graphics::Animation *> foreignAnimations;
88 #endif /* BATTLE_ATTACKANIMATION_H_ */