Peoplemon  0.1.0
Peoplemon 3 game source documentation
StorageCursor.hpp
Go to the documentation of this file.
1 #ifndef GAME_MENUS_STORAGECURSOR_HPP
2 #define GAME_MENUS_STORAGECURSOR_HPP
3 
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Resources.hpp>
6 #include <Core/Input/Control.hpp>
7 #include <Core/Peoplemon/Id.hpp>
8 #include <SFML/Graphics.hpp>
9 
10 namespace game
11 {
12 namespace menu
13 {
20 public:
26  StorageCursor(bl::engine::Engine& engine);
27 
33  void activate(bl::ecs::Entity parent);
34 
38  void deactivate();
39 
45  void setHidden(bool hide);
46 
52  void update(float dt);
53 
61  bool process(core::input::EntityControl cmd, bool skipAnim);
62 
68  void setHolding(core::pplmn::Id peoplemon);
69 
74  bool moving() const;
75 
79  const sf::Vector2i& getPosition() const;
80 
86  void setX(int x);
87 
91  void pageLeft();
92 
96  void pageRight();
97 
101  static float TileSize();
102 
103 private:
104  bl::engine::Engine& engine;
105  sf::Vector2i position;
106  bl::rc::res::TextureRef cursorTxtr;
107  bl::gfx::Sprite cursor;
108  bl::rc::res::TextureRef pplTxtr;
109  bl::gfx::Sprite peoplemon;
111  float offset;
112  float moveVel;
113  bool pplInScene;
114 
115  static float size;
116 
117  void syncPos();
118  glm::vec2 makePos() const;
119 };
120 
121 } // namespace menu
122 } // namespace game
123 
124 #endif
Id
The id of a peoplemon.
Definition: Id.hpp:16
std::underlying_type_t< Control::EntityControl > EntityControl
Helper typedef to avoid too much casting boilerplate.
Definition: Control.hpp:44
Parent namespace for all functionality unique to the game.
Cursor that is used to navigate the storage system boxes.
void deactivate()
Removes from the current scene.
void update(float dt)
Updates the cursor motion.
void setHidden(bool hide)
Show or hide the cursor.
void pageRight()
Updates the cursor position if the box to the right is switched to.
bool process(core::input::EntityControl cmd, bool skipAnim)
Processes user input to move the cursor.
void setHolding(core::pplmn::Id peoplemon)
Sets a Peoplemon to render with the cursor. Pass Unknown to clear.
const sf::Vector2i & getPosition() const
Returns the position of the cursor in the box.
static float TileSize()
Returns the size of a square on the grid.
void activate(bl::ecs::Entity parent)
Adds to the current overlay.
bool moving() const
Returns whether or not the cursor position is being interpolated.
void setX(int x)
Sets the x position of the cursor.
StorageCursor(bl::engine::Engine &engine)
Construct a new Storage Cursor.
void pageLeft()
Updates the cursor position if the box to the left is switched to.