]> git.localhorst.tv Git - blobs.git/blob - src/ui/CreaturePanel.hpp
track creature with camera
[blobs.git] / src / ui / CreaturePanel.hpp
1 #ifndef BLOBS_UI_CREATUREPANEL_HPP_
2 #define BLOBS_UI_CREATUREPANEL_HPP_
3
4 #include "Panel.hpp"
5
6
7 namespace blobs {
8 namespace app {
9         struct Assets;
10 }
11 namespace creature {
12         class Creature;
13 }
14 namespace graphics {
15         class Viewport;
16 }
17 namespace ui {
18
19 class Label;
20 class Meter;
21
22 class CreaturePanel {
23
24 public:
25         explicit CreaturePanel(const app::Assets &);
26         ~CreaturePanel();
27
28         CreaturePanel(const CreaturePanel &) = delete;
29         CreaturePanel &operator =(const CreaturePanel &) = delete;
30
31         CreaturePanel(CreaturePanel &&) = delete;
32         CreaturePanel &operator =(CreaturePanel &&) = delete;
33
34 public:
35         void Show(creature::Creature &);
36         void Hide() noexcept;
37
38         bool Shown() const noexcept { return c; }
39         const creature::Creature &GetCreature() const noexcept { return *c; }
40
41         void Draw(app::Assets &, graphics::Viewport &) noexcept;
42
43 private:
44         void CreateNeeds();
45
46 private:
47         const app::Assets &assets;
48         creature::Creature *c;
49
50         Label *name;
51         Label *age;
52         Label *mass;
53         Label *pos;
54         Label *tile;
55         Label *goal;
56         Panel *needs;
57         Panel panel;
58
59         Meter *health_meter;
60         std::vector<Meter *> need_meters;
61
62 };
63
64 }
65 }
66
67 #endif