Peoplemon  0.1.0
Peoplemon 3 game source documentation
PeopledexRow.hpp
Go to the documentation of this file.
1 #ifndef GAME_MENUS_PEOPLEDEXROW_HPP
2 #define GAME_MENUS_PEOPLEDEXROW_HPP
3 
4 #include <BLIB/Interfaces/Menu.hpp>
5 #include <BLIB/Resources.hpp>
7 
8 namespace game
9 {
10 namespace menu
11 {
18 class PeopledexRow : public bl::menu::Item {
19 public:
21  using Ptr = std::shared_ptr<PeopledexRow>;
22 
30  static Ptr create(core::pplmn::Id ppl, const core::player::Peopledex& dex);
31 
36  virtual ~PeopledexRow() = default;
37 
42  virtual glm::vec2 getSize() const override;
43 
44 protected:
51  virtual void doCreate(bl::engine::Engine& engine) override;
52 
58  virtual void doSceneAdd(bl::rc::Scene* overlay) override;
59 
63  virtual void doSceneRemove() override;
64 
68  virtual bl::ecs::Entity getEntity() const override;
69 
75  virtual void draw(bl::rc::scene::CodeScene::RenderContext& ctx) override;
76 
77 private:
78  const core::pplmn::Id ppl;
79  const core::player::Peopledex& dex;
80 
81  bl::rc::res::TextureRef bgndTxtr;
82  bl::rc::res::TextureRef activeBgndTxtr;
83  bl::gfx::Sprite background;
84 
85  bl::rc::res::TextureRef ballTxtr;
86  bl::gfx::Sprite ball;
87 
88  bl::gfx::Text id;
89  bl::gfx::Text name;
90 
92  void makeActive();
93  void makeInactive();
94 };
95 
96 } // namespace menu
97 } // namespace game
98 
99 #endif
Id
The id of a peoplemon.
Definition: Id.hpp:16
Parent namespace for all functionality unique to the game.
Maintains the information required to populate the peopledex.
Definition: Peopledex.hpp:24
Item row for peoplemon in the peopledex.
virtual void doSceneRemove() override
Called when the item should be removed from the overlay.
virtual void doCreate(bl::engine::Engine &engine) override
Called at least once when the item is added to a menu. Should create required graphics primitives and...
virtual glm::vec2 getSize() const override
Returns the size that the row takes up.
virtual bl::ecs::Entity getEntity() const override
Returns the entity (or top level entity) of the item.
static Ptr create(core::pplmn::Id ppl, const core::player::Peopledex &dex)
Create a new peopledex row.
virtual void doSceneAdd(bl::rc::Scene *overlay) override
Called when the item should be added to the overlay.
std::shared_ptr< PeopledexRow > Ptr
Pointer to the row item.
virtual ~PeopledexRow()=default
Destroy the Peopledex Row object.
virtual void draw(bl::rc::scene::CodeScene::RenderContext &ctx) override
Renders the item.