RType
Collision.hpp
Go to the documentation of this file.
1 //
2 // Created by nathan on 1/10/24.
3 //
4 
5 #pragma once
6 
7 #include "AService.hpp"
8 #include "Drawable.hpp"
9 #include <utility>
10 #include <vector>
11 
12 class Collision : public AService
13 {
14  public:
15 
16  /**
17  * @brief Construct a new Collision:: Collision object
18  * @param serverSocket
19  */
20  explicit Collision(std::shared_ptr<ServerSocket> serverSocket) :
22 
23  /**
24  * @brief update, update the collision
25  *
26  * @param event
27  * @param component
28  */
29  void update(std::shared_ptr<Event> event, std::shared_ptr<IComponentRType> component) override;
30 
31  /**
32  * @brief checkCollision, check the collision
33  *
34  * @param drawable
35  * @param other
36  * @return bool (true or false) if there is a collision
37  */
38  static bool checkCollision(const std::shared_ptr<Drawable> &drawable, const std::shared_ptr<Drawable> &other);
39 
40  /**
41  * @brief cancelMove, cancel the move
42  *
43  * @param event
44  * @param drawable
45  */
46  static void cancelMove(const std::shared_ptr<Event> &event, const std::shared_ptr<Drawable> &drawable);
47  int _score = 0;
48 };