Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
EntitySystem.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_ENTITY_SYSTEM_HPP_
9 #define RTYPE_ENTITY_SYSTEM_HPP_
10
11 #include "RType/ECS/ISystem.hpp"
12 #include "RType/ECS/Registry.hpp"
13 #include "Game/Player.hpp"
16 #include "Systems/NetworkSyncSystem.hpp"
17
34
39namespace rtp::server {
44 class EntitySystem : public ecs::ISystem {
45 public:
50 EntitySystem(ecs::Registry& registry, ServerNetwork& network, NetworkSyncSystem& networkSync);
51
56 void update(float dt) override;
57
63 ecs::Entity createPlayerEntity(PlayerPtr player, const Vec2f& spawnPos);
64
70 uint32_t roomId,
71 const Vec2f& pos,
73 float speed,
74 float amplitude,
75 float frequency,
77 );
78
90 uint32_t roomId,
91 const Vec2f& pos,
93 float speed,
94 float amplitude,
95 float frequency
96 );
97
108 uint32_t roomId,
109 const Vec2f& pos,
111 float value,
112 float duration
113 );
114
125 uint32_t roomId,
126 const Vec2f& pos,
127 const Vec2f& size,
128 int health,
130 );
131
138
139 protected:
143 };
144}
145
146#endif /* !RTYPE_ENTITY_SYSTEM_HPP_ */
Interface for ECS systems.
Network packet implementation for R-Type protocol.
Represents an entity in the ECS (Entity-Component-System) architecture.
Definition Entity.hpp:63
Abstract base class for all ECS systems.
Definition ISystem.hpp:57
Base class for systems that operate on entities in the ECS.
ServerNetwork & _network
Reference to the server network manager.
void update(float dt) override
Update movement system logic for one frame.
NetworkSyncSystem & _networkSync
Reference to the network sync system.
ecs::Entity creaetEnemyEntity(uint32_t roomId, const Vec2f &pos, ecs::components::Patterns pattern, float speed, float amplitude, float frequency)
Create a new enemy entity in the ECS with default type Scout.
ecs::Entity createObstacleEntity(uint32_t roomId, const Vec2f &pos, const Vec2f &size, int health, net::EntityType type=net::EntityType::Obstacle)
Create a new obstacle entity in the ECS.
ecs::Entity createPlayerEntity(PlayerPtr player)
Create a new player entity in the ECS.
void applyWeaponToEntity(ecs::Entity entity, ecs::components::WeaponKind weaponKind)
Apply a weapon configuration to an existing entity (player)
ecs::Entity createEnemyEntity(uint32_t roomId, const Vec2f &pos, ecs::components::Patterns pattern, float speed, float amplitude, float frequency, net::EntityType type=net::EntityType::Scout)
Create a new enemy entity in the ECS.
ecs::Entity createPowerupEntity(uint32_t roomId, const Vec2f &pos, ecs::components::PowerupType type, float value, float duration)
Create a new powerup entity in the ECS.
ecs::Registry & _registry
Reference to the entity registry.
System to handle network-related operations on the server side.
Implementation ASIO du serveur réseau (TCP + UDP)
WeaponKind
Types of player weapons.
Patterns
Enum representing different enemy movement patterns.
PowerupType
Supported powerup types.
Definition Powerup.hpp:16
EntityType
Types of entities in the game.
Definition Packet.hpp:144
File : GameManager.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
std::shared_ptr< Player > PlayerPtr
Shared pointer type for Player.
Definition Player.hpp:178