Peoplemon  0.1.0
Peoplemon 3 game source documentation
Peopledex.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATES_PEOPLEDEX_HPP
2 #define GAME_STATES_PEOPLEDEX_HPP
3 
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Interfaces/Menu.hpp>
7 #include <Game/States/State.hpp>
8 
9 namespace game
10 {
11 namespace state
12 {
18 class Peopledex
19 : public State
20 , public bl::input::Listener {
21 public:
28  static bl::engine::State::Ptr create(core::system::Systems& systems);
29 
33  virtual ~Peopledex() = default;
34 
38  virtual const char* name() const override;
39 
45  virtual void activate(bl::engine::Engine& engine) override;
46 
52  virtual void deactivate(bl::engine::Engine& engine) override;
53 
60  virtual void update(bl::engine::Engine& engine, float dt, float) override;
61 
62 private:
63  bl::menu::Menu menu;
64  core::input::MenuDriver menuDriver;
65 
66  bl::rc::res::TextureRef bgndTxtr;
67  bl::gfx::Sprite background;
68 
69  core::pplmn::Id firstId;
70  core::pplmn::Id lastId;
71  bl::rc::res::TextureRef upTxtr;
72  bl::gfx::Sprite upArrow;
73  bl::rc::res::TextureRef downTxtr;
74  bl::gfx::Sprite downArrow;
75 
76  bl::rc::res::TextureRef seenTxtr;
77  bl::gfx::Sprite seenBox;
78  bl::gfx::Text seenLabel;
79 
80  bl::rc::res::TextureRef ownedTxtr;
81  bl::gfx::Sprite ownedBox;
82  bl::gfx::Text ownedLabel;
83 
84  bl::rc::res::TextureRef thumbTxtr;
85  bl::gfx::Sprite thumbnail;
86  bl::gfx::Text nameLabel;
87  bl::gfx::Text descLabel;
88  bl::gfx::Text locationLabel;
89 
91  void onHighlight(core::pplmn::Id ppl);
92  void onSelect(core::pplmn::Id ppl);
93  bl::menu::Item::Ptr makeRow(core::pplmn::Id ppl);
94 
95  virtual bool observe(const bl::input::Actor&, unsigned int activatedControl,
96  bl::input::DispatchType, bool eventTriggered) override;
97 };
98 
99 } // namespace state
100 } // namespace game
101 
102 #endif
bl::menu::TriggerDriver< Control::MoveUp, Control::MoveRight, Control::MoveDown, Control::MoveLeft, Control::Interact > MenuDriver
Helper typedef for Peoplemon specific menu driving.
Definition: MenuDriver.hpp:18
Id
The id of a peoplemon.
Definition: Id.hpp:16
Parent namespace for all functionality unique to the game.
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47
The peopledex menu state.
Definition: Peopledex.hpp:20
virtual void deactivate(bl::engine::Engine &engine) override
Deactivates the state.
Definition: Peopledex.cpp:140
virtual void update(bl::engine::Engine &engine, float dt, float) override
Updates the state and menus and whatnot.
Definition: Peopledex.cpp:145
virtual void activate(bl::engine::Engine &engine) override
Activates the state.
Definition: Peopledex.cpp:122
static bl::engine::State::Ptr create(core::system::Systems &systems)
Create a new Peopledex state.
Definition: Peopledex.cpp:29
virtual ~Peopledex()=default
Destroy the Peopledex object.
virtual const char * name() const override
Returns "Peopledex".
Definition: Peopledex.cpp:120
Parent to all game states. Provides some commonly required data like core game systems.
Definition: State.hpp:29
core::system::Systems & systems
Definition: State.hpp:66