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