]> git.localhorst.tv Git - l2e.git/blob - src/battle/states/PerformAttacks.h
relocate scripts
[l2e.git] / src / battle / states / PerformAttacks.h
1 #ifndef BATTLE_PERFORMATTACKS_H_
2 #define BATTLE_PERFORMATTACKS_H_
3
4 namespace battle {
5         class Battle;
6         class BattleState;
7         class TargetSelection;
8 }
9
10 #include "../../app/State.h"
11
12 #include "../NumberAnimation.h"
13 #include "../../math/Vector.h"
14 #include "../../graphics/Animation.h"
15
16 #include <vector>
17
18
19 namespace battle {
20
21 class PerformAttacks
22 : public app::State {
23
24 public:
25         PerformAttacks(Battle *battle, BattleState *parent);
26
27 public:
28         virtual void HandleEvents(const app::Input &);
29         virtual void UpdateWorld(Uint32 deltaT);
30         virtual void Render(SDL_Surface *);
31
32 private:
33         virtual void OnEnterState(SDL_Surface *screen);
34         virtual void OnExitState(SDL_Surface *screen);
35         virtual void OnResumeState(SDL_Surface *screen);
36         virtual void OnPauseState(SDL_Surface *screen);
37
38         virtual void OnResize(int width, int height);
39
40 private:
41         void CheckAnimations();
42         bool HasAnimationsRunning() const;
43         void ResetAnimation();
44
45 private:
46         void AddNumberAnimations(const TargetSelection &);
47
48         void RenderTitleBar(SDL_Surface *screen) const;
49         void RenderNumbers(SDL_Surface *screen) const;
50         void RenderTargetAnimation(SDL_Surface *screen) const;
51
52 private:
53         Battle *battle;
54         BattleState *parent;
55         graphics::AnimationRunner moveAnimation;
56         graphics::AnimationRunner targetAnimation;
57         const char *titleBarText;
58         app::Timer<Uint32> titleBarTimer;
59         app::Timer<Uint32> targetAnimationTimer;
60         std::vector<NumberAnimation> numberAnimation;
61         std::vector<math::Vector<int> > numberPosition;
62         math::Vector<int> framePosition;
63         math::Vector<int> frameSize;
64         math::Vector<int> textPosition;
65         int cursor;
66
67 };
68
69 }
70
71 #endif