GameKit  0.0.1a
C++ gamedev tools
EasyMovement.hpp
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: EasyMovement.hpp
5  *
6  * Description:
7  *
8  * Created: 19/01/2018 03:27:45
9  *
10  * Author: Quentin Bazin, <quent42340@gmail.com>
11  *
12  * =====================================================================================
13  */
14 #ifndef GK_EASYMOVEMENT_HPP_
15 #define GK_EASYMOVEMENT_HPP_
16 
17 #include <functional>
18 
20 
21 namespace gk {
22 
23 class EasyMovement : public Movement {
24  public:
25  EasyMovement(const std::function<void(SceneObject &)> &func) : m_func(func) {}
26 
27  void process(SceneObject &object) override {
28  m_func(object);
29  }
30 
31  private:
32  std::function<void(SceneObject &)> m_func;
33 };
34 
35 } // namespace gk
36 
37 #endif // EASYMOVEMENT_HPP_
std::function< void(SceneObject &)> m_func
EasyMovement(const std::function< void(SceneObject &)> &func)
void process(SceneObject &object) override