]> git.localhorst.tv Git - l2e.git/blob - src/battle/states/SelectTarget.h
121b8ad235f72638aef1c60698d3255e6921a87b
[l2e.git] / src / battle / states / SelectTarget.h
1 /*
2  * SelectTarget.h
3  *
4  *  Created on: Aug 9, 2012
5  *      Author: holy
6  */
7
8 #ifndef BATTLE_SELECTTARGET_H_
9 #define BATTLE_SELECTTARGET_H_
10
11 namespace battle {
12         class BattleState;
13         class SelectAttackType;
14         class TargetSelection;
15 }
16 namespace math {
17         template<class>
18         class Vector;
19 }
20 namespace graphics {
21         class Sprite;
22 }
23
24 #include "../../app/State.h"
25
26 namespace battle {
27
28 class SelectTarget
29 : public app::State {
30
31 public:
32         SelectTarget(BattleState *battle, SelectAttackType *parent, TargetSelection *selection, const graphics::Sprite *cursorIcon)
33         : battle(battle), parent(parent), selection(selection), cursorIcon(cursorIcon), flipFlop(true) { }
34
35 public:
36         virtual void HandleEvents(const app::Input &);
37         virtual void UpdateWorld(Uint32 deltaT);
38         virtual void Render(SDL_Surface *);
39
40 private:
41         virtual void OnEnterState(SDL_Surface *screen);
42         virtual void OnExitState(SDL_Surface *screen);
43         virtual void OnResumeState(SDL_Surface *screen);
44         virtual void OnPauseState(SDL_Surface *screen);
45
46         virtual void OnResize(int width, int height);
47
48 private:
49         void RenderCursors(SDL_Surface *screen, const math::Vector<int> &offset);
50
51 private:
52         BattleState *battle;
53         SelectAttackType *parent;
54         TargetSelection *selection;
55         const graphics::Sprite *cursorIcon;
56         bool flipFlop;
57
58 };
59
60 }
61
62 #endif /* BATTLE_SELECTTARGET_H_ */