]> git.localhorst.tv Git - l2e.git/blob - src/menu/CapsuleFeedMenu.h
removed lazy fwd headers
[l2e.git] / src / menu / CapsuleFeedMenu.h
1 #ifndef MENU_CAPSULEFEEDMENU_H_
2 #define MENU_CAPSULEFEEDMENU_H_
3
4 namespace common {
5         class Capsule;
6         class Item;
7 }
8 namespace math {
9         template<class>
10         class Vector;
11 }
12 namespace menu {
13         class CapsuleMenu;
14 }
15
16 #include "../app/State.h"
17 #include "../graphics/Menu.h"
18
19 namespace menu {
20
21 class CapsuleMenu;
22
23 class CapsuleFeedMenu
24 : public app::State {
25
26 public:
27         explicit CapsuleFeedMenu(CapsuleMenu *parent);
28
29 public:
30         virtual void HandleEvents(const app::Input &);
31         virtual void UpdateWorld(Uint32 deltaT);
32         virtual void Render(SDL_Surface *);
33
34 public:
35         int Width() const;
36         int Height() const;
37
38 private:
39         virtual void OnEnterState(SDL_Surface *screen);
40         virtual void OnExitState(SDL_Surface *screen);
41         virtual void OnResumeState(SDL_Surface *screen);
42         virtual void OnPauseState(SDL_Surface *screen);
43
44         virtual void OnResize(int width, int height);
45
46         common::Capsule &GetCapsule();
47         const common::Capsule &GetCapsule() const;
48
49         void LoadInventory();
50         void FeedSelected();
51
52         void RenderName(SDL_Surface *screen, const math::Vector<int> &offset) const;
53         void RenderSprite(SDL_Surface *screen, const math::Vector<int> &offset) const;
54         void RenderGrowth(SDL_Surface *screen, const math::Vector<int> &offset) const;
55         void RenderHunger(SDL_Surface *screen, const math::Vector<int> &offset) const;
56         void RenderMenu(SDL_Surface *screen, const math::Vector<int> &offset) const;
57         void RenderItems(SDL_Surface *screen, const math::Vector<int> &offset) const;
58
59 private:
60         CapsuleMenu *parent;
61         enum Choice {
62                 CHOICE_SELECT,
63                 CHOICE_SORT,
64         };
65         graphics::Menu<Choice> menu;
66         graphics::Menu<const common::Item *> itemMenu;
67
68 };
69
70 }
71
72 #endif /* MENU_CAPSULEFEEDMENU_H_ */