My Project
ShootSystem.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** R-Type
4 ** File description:
5 ** Created by casimir,
6 */
7 
8 #ifndef R_TYPE_SHOOTSYSTEM_HPP
9  #define R_TYPE_SHOOTSYSTEM_HPP
10 
11  /* Ecs */
12  #include "Registry.hpp"
13 
14  /* Components */
15  #include "Component/CNetworkQueue.hpp"
16  #include "Component/CDamage.hpp"
17  #include "Component/CDirection.hpp"
18  #include "Component/CHitBox.hpp"
19  #include "Component/CPosition.hpp"
20  #include "Component/CLobbyId.hpp"
21  #include "Component/CNetIdToClientId.hpp"
22  #include "Component/CHealth.hpp"
23 
27 namespace System {
31  class ShootSystem {
32  public:
36  ShootSystem();
37  ~ShootSystem() = default;
38 
48  void operator()(
49  Registry &registry,
55  );
56 
66  Entity createBullet(Registry &registry, Sparse_array<component::cposition_t> &position, uint16_t playerId, int lobbyId);
67 
68  protected:
69  private:
70  };
71 }
72 
73 #endif //R_TYPE_SHOOTSYSTEM_HPP
Sparse_array
Class that handle Element of type Component like a vector which can be holed.
Definition: SparseArray.hpp:22
System
Namespace for systems.
Definition: DirectionSystem.hpp:24
System::ShootSystem::operator()
void operator()(Registry &registry, Sparse_array< component::cnetwork_queue_t > &netqueue, Sparse_array< component::cposition_t > &position, Sparse_array< component::clobby_id_t > &lobbyId, Sparse_array< component::cnet_id_to_client_id_t > &netIdToClientId, Sparse_array< component::chealth_t > &health)
The main handler for the Shoot System.
Definition: ShootSystem.cpp:28
System::ShootSystem
The Shoot System class, it handles all packets related to a mouse click by the user,...
Definition: ShootSystem.hpp:31
Registry
Class that handle ECS.
Definition: Registry.hpp:22
System::ShootSystem::ShootSystem
ShootSystem()
Construct a new Shoot System object.
Definition: ShootSystem.cpp:24
Entity
Class that handle entity in a sparse array like an index.
Definition: Entity.hpp:16
System::ShootSystem::createBullet
Entity createBullet(Registry &registry, Sparse_array< component::cposition_t > &position, uint16_t playerId, int lobbyId)
Create a Bullet object.
Definition: ShootSystem.cpp:42