Peoplemon  0.1.0
Peoplemon 3 game source documentation
StorageGrid.hpp
Go to the documentation of this file.
1 #ifndef GAME_MENUS_STORAGEGRID_HPP
2 #define GAME_MENUS_STORAGEGRID_HPP
3 
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Resources.hpp>
7 #include <functional>
8 #include <list>
9 #include <vector>
10 
11 namespace game
12 {
13 namespace menu
14 {
20 class StorageGrid {
21 public:
22  static constexpr glm::vec2 BoxPosition = {293.f, 158.f};
23  static constexpr glm::vec2 BoxSize = {784.f - BoxPosition.x, 581.f - BoxPosition.y};
24 
30  StorageGrid(bl::engine::Engine& engine);
31 
37  void activate(bl::ecs::Entity background);
38 
42  void deactivate();
43 
49  void update(const std::vector<core::pplmn::StoredPeoplemon>& box);
50 
56  void notifyOffset(float offset);
57 
58 private:
59  bl::engine::Engine& engine;
60  bl::gfx::Dummy2D background;
61  std::list<bl::gfx::Sprite> peoplemon;
62 };
63 
64 } // namespace menu
65 } // namespace game
66 
67 #endif
Parent namespace for all functionality unique to the game.
Renderer for the grid of peoplemon in a storage box.
Definition: StorageGrid.hpp:20
void notifyOffset(float offset)
Applies the given offset to the grid position. Used for sliding in and out.
Definition: StorageGrid.cpp:26
void deactivate()
Removes the content from the scene and releases entities.
Definition: StorageGrid.cpp:21
void activate(bl::ecs::Entity background)
Sets the parent of the grid rectangle to the background.
Definition: StorageGrid.cpp:19
void update(const std::vector< core::pplmn::StoredPeoplemon > &box)
Updates the set of peoplemon to render.
Definition: StorageGrid.cpp:30
static constexpr glm::vec2 BoxPosition
Definition: StorageGrid.hpp:22
static constexpr glm::vec2 BoxSize
Definition: StorageGrid.hpp:23
StorageGrid(bl::engine::Engine &engine)
Initializes the grid to be empty.
Definition: StorageGrid.cpp:11