Peoplemon  0.1.0
Peoplemon 3 game source documentation
MapExplorer.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATES_MAP_EXPLORER_HPP
2 #define GAME_STATES_MAP_EXPLORER_HPP
3 
4 #include <BLIB/Cameras.hpp>
5 #include <Core/Maps/Map.hpp>
6 #include <Game/States/State.hpp>
7 
8 namespace game
9 {
10 namespace state
11 {
19 : public State
20 , public bl::event::Listener<sf::Event> {
21 public:
28  static bl::engine::State::Ptr create(core::system::Systems& systems);
29 
34  virtual ~MapExplorer() = default;
35 
40  virtual const char* name() const override;
41 
47  virtual void activate(bl::engine::Engine& engine) override;
48 
54  virtual void deactivate(bl::engine::Engine& engine) override;
55 
62  virtual void update(bl::engine::Engine& engine, float dt, float) override;
63 
64 private:
65  enum HintState { Hidden, Showing, Fading };
66 
67  bl::gfx::Rectangle hintBox;
68  bl::gfx::Text hintText;
69  HintState hintState;
70  float hintTime;
71 
73 
74  virtual void observe(const sf::Event& event) override;
75 };
76 
77 } // namespace state
78 } // namespace game
79 
80 #endif
Parent namespace for all functionality unique to the game.
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47
Debug only state that allows free roaming the map with a special camera.
Definition: MapExplorer.hpp:20
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates a new MapExplorer state.
Definition: MapExplorer.cpp:54
virtual void update(bl::engine::Engine &engine, float dt, float) override
Updates the game world logic and the hint fadeout.
Definition: MapExplorer.cpp:99
virtual ~MapExplorer()=default
Destroy the Map Explorer state.
virtual const char * name() const override
Returns "MapExplorer".
Definition: MapExplorer.cpp:76
virtual void deactivate(bl::engine::Engine &engine) override
Reconnects the player to their entity and pops the camera.
Definition: MapExplorer.cpp:92
virtual void activate(bl::engine::Engine &engine) override
Activates the state and camera. Disconnects the player from their entity.
Definition: MapExplorer.cpp:78
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