]> git.localhorst.tv Git - l2e.git/blob - src/menu/SelectHero.h
removed stupid file headers that eclipse put in
[l2e.git] / src / menu / SelectHero.h
1 #ifndef MENU_SELECTHERO_H_
2 #define MENU_SELECTHERO_H_
3
4 #include "fwd.h"
5 #include "../app/State.h"
6 #include "../app/Timer.h"
7 #include "../common/fwd.h"
8
9 #include <SDL.h>
10
11 namespace menu {
12
13 class SelectHero
14 : public app::State {
15
16 public:
17         typedef void (*Callback)(void *, int selection);
18
19 public:
20         SelectHero(app::State *parent, PartyMenu *partyMenu, void *ref, Callback, int initialHero = 0);
21
22 public:
23         virtual void HandleEvents(const app::Input &);
24         virtual void UpdateWorld(float deltaT);
25         virtual void Render(SDL_Surface *);
26
27 private:
28         virtual void OnEnterState(SDL_Surface *screen);
29         virtual void OnExitState(SDL_Surface *screen);
30         virtual void OnResumeState(SDL_Surface *screen);
31         virtual void OnPauseState(SDL_Surface *screen);
32
33         virtual void OnResize(int width, int height);
34
35 private:
36         common::GameConfig &Game();
37         const common::GameConfig &Game() const;
38         Resources &Res();
39         const Resources &Res() const;
40
41         void SelectUp();
42         void SelectRight();
43         void SelectDown();
44         void SelectLeft();
45
46         void RenderCursor(SDL_Surface *screen) const;
47
48 private:
49         app::State *parent;
50         PartyMenu *partyMenu;
51         void *ref;
52         Callback callback;
53         app::Timer<Uint32> cursorBlink;
54         int cursor;
55
56 };
57
58 }
59
60 #endif /* MENU_SELECTHERO_H_ */