Peoplemon  0.1.0
Peoplemon 3 game source documentation
Movement.hpp
Go to the documentation of this file.
1 #ifndef CORE_SYSTEMS_MOVEMENT_HPP
2 #define CORE_SYSTEMS_MOVEMENT_HPP
3 
4 #include <BLIB/Audio/AudioSystem.hpp>
5 #include <BLIB/ECS.hpp>
6 #include <BLIB/Engine/System.hpp>
7 #include <BLIB/Tilemap/Position.hpp>
9 
10 namespace core
11 {
12 namespace system
13 {
14 class Systems;
15 
21 class Movement : public bl::engine::System {
22 public:
28  Movement(Systems& owner);
29 
33  virtual ~Movement() = default;
34 
43  bool makeMovable(bl::ecs::Entity entity, float moveSpeed, float fastMoveSpeed);
44 
53  bool moveEntity(bl::ecs::Entity entity, bl::tmap::Direction direction, bool fast);
54 
55 private:
56  Systems& owner;
57  bl::audio::AudioSystem::Handle jumpSound;
58 
59  virtual void init(bl::engine::Engine&) override;
60  virtual void update(std::mutex&, float dt, float, float, float) override;
61 };
62 
63 } // namespace system
64 } // namespace core
65 
66 #endif
Core classes and functionality for both the editor and game.
Primary System for managing entity movement and interpolation.
Definition: Movement.hpp:21
virtual ~Movement()=default
Destroys the system.
Movement(Systems &owner)
Create the movement system.
Definition: Movement.cpp:11
bool moveEntity(bl::ecs::Entity entity, bl::tmap::Direction direction, bool fast)
Moves an entity in the given direction using either its fast or slow speed.
Definition: Movement.cpp:27
bool makeMovable(bl::ecs::Entity entity, float moveSpeed, float fastMoveSpeed)
Adds a Movable component to the given entity if it does not already exist.
Definition: Movement.cpp:19
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47