My Project
NewEntitySystem.hpp
1 /*
2 ** EPITECH PROJECT, 2022
3 ** B-CPP-500-PAR-5-1-rtype-martin.vanaud
4 ** File description:
5 ** NewEntitySystem
6 */
7 
8 #ifndef NEWENTITYSYSTEM_HPP_
9  #define NEWENTITYSYSTEM_HPP_
10 
11  #include <unordered_map>
12  #include <string>
13 
14  /* Ecs */
15  #include "Registry.hpp"
16 
17  /* Graphical Lib */
18  #include "GraphicalLib.hpp"
19 
20  /* Component */
21  #include "Component/CAsset.hpp"
22  #include "Component/CClientNetworkId.hpp"
23  #include "Component/CNetworkQueue.hpp"
24  #include "Component/CSceneId.hpp"
25  #include "Component/CServerId.hpp"
26  #include "Component/CText.hpp"
27  #include "Component/CColor.hpp"
28  #include "Component/CRefId.hpp"
29  #include "Component/CRef.hpp"
30  #include "Component/CSound.hpp"
31  #include "Component/CSoundId.hpp"
32 
36 namespace System {
41  public:
46  ~NewEntitySystem() = default;
47 
58  void operator()(
59  Registry &registry,
66 
76 
88 
98 
117 
123  void doesEntityAlreadyExist(int newEntityId);
124 
125  protected:
126  private:
127  std::unordered_map<int, std::string> _entityType;
128  std::unique_ptr<rtype::GraphicalLib> _graphicLib;
129  };
130 }
131 
132 #endif /* !NEWENTITYSYSTEM_HPP_ */
System::NewEntitySystem::addEnemy
void addEnemy(Registry &registry, packet_new_entity &packet_new_entity, Sparse_array< component::casset_t > &assets, Sparse_array< component::csound_t > &sounds)
A method to add a new enemy entity.
Definition: NewEntitySystem.cpp:93
Sparse_array
Class that handle Element of type Component like a vector which can be holed.
Definition: SparseArray.hpp:22
System::NewEntitySystem::addEnemy2
void addEnemy2(Registry &registry, packet_new_entity &packet_new_entity, Sparse_array< component::casset_t > &assets, Sparse_array< component::csound_t > &sounds)
A method to add a new enemy entity.
Definition: NewEntitySystem.cpp:142
System
Namespace for systems.
Definition: DirectionSystem.hpp:24
System::NewEntitySystem::addBullet
void addBullet(Registry &registry, packet_new_entity &packet_new_entity, Sparse_array< component::casset_t > &assets, Sparse_array< component::csound_t > &sounds)
A method to add a new bullet entity.
Definition: NewEntitySystem.cpp:71
Registry
Class that handle ECS.
Definition: Registry.hpp:22
System::NewEntitySystem::NewEntitySystem
NewEntitySystem()
Construct a new New Entity System object.
Definition: NewEntitySystem.cpp:29
System::NewEntitySystem::operator()
void operator()(Registry &registry, Sparse_array< component::cnetwork_queue_t > &network, Sparse_array< component::cserverid_t > &serverIds, Sparse_array< component::casset_t > &assets, Sparse_array< component::cclient_network_id > &clientNetwrokId, Sparse_array< component::csceneid_t > &sceneId, Sparse_array< component::csound_t > &sounds)
Function that will be automaticaly called while the client is working (on loop)
Definition: NewEntitySystem.cpp:51
System::NewEntitySystem::doesEntityAlreadyExist
void doesEntityAlreadyExist(int newEntityId)
A method to check if an entity already exists.
packet_new_entity
A packet to handle a new entity informations.
Definition: NewEntity.hpp:16
System::NewEntitySystem::addShip
void addShip(Registry &registry, packet_new_entity &packet_new_entity, Sparse_array< component::casset_t > &assets, Sparse_array< component::cclient_network_id > &clientNetworkId, Sparse_array< component::csceneid_t > &sceneId, Sparse_array< component::csound_t > &sounds)
A method to add a new ship entity.
Definition: NewEntitySystem.cpp:114
System::NewEntitySystem
NewEntitySystem class that handles the creation of an entity.
Definition: NewEntitySystem.hpp:40
System::NewEntitySystem::addEnemy3
void addEnemy3(Registry &registry, packet_new_entity &packet_new_entity, Sparse_array< component::casset_t > &assets, Sparse_array< component::csound_t > &sounds)
A method to add a new enemy entity.
Definition: NewEntitySystem.cpp:165