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