Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
CollisionSystem.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Air-Trap
4** File description:
5** CollisionSystem
6*/
7
8#pragma once
9
10#include <unordered_set>
11
12#include "RType/ECS/ISystem.hpp"
28
30#include "Systems/NetworkSyncSystem.hpp"
31
32namespace rtp::server {
33
35 public:
43 RoomSystem& roomSystem,
44 NetworkSyncSystem& networkSync);
45
50 void update(float dt) override;
51
56 void setInvincible(bool enabled) { _invincibleMode = enabled; }
57
62 bool isInvincible() const { return _invincibleMode; }
63
64 private:
76 const ecs::components::BoundingBox& bb) const;
77
83 void despawn(const ecs::Entity& entity, uint32_t roomId);
84
91 void spawnPowerup(const Vec2f& position, uint32_t roomId, int dropRoll);
92
93 private:
97 bool _invincibleMode = false;
98};
99
100} // namespace rtp::server
Interface for ECS systems.
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
void spawnPowerup(const Vec2f &position, uint32_t roomId, int dropRoll)
Spawn a power-up at given position.
void update(float dt) override
Update system logic for one frame.
RoomSystem & _roomSystem
Reference to the RoomSystem.
void despawn(const ecs::Entity &entity, uint32_t roomId)
Handle collision between two entities.
NetworkSyncSystem & _networkSync
Reference to the NetworkSyncSystem.
void setInvincible(bool enabled)
Set invincibility mode for all players.
bool isInvincible() const
Check if invincibility mode is enabled.
bool _invincibleMode
Debug: players are invincible.
ecs::Registry & _registry
Reference to the ECS registry.
bool overlaps(const ecs::components::Transform &a, const ecs::components::BoundingBox &ab, const ecs::components::Transform &b, const ecs::components::BoundingBox &bb) const
Check if two entities overlap based on their transforms and bounding boxes.
System to handle network-related operations on the server side.
System to handle room-related operations on the server side.
File : GameManager.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
Component representing position, rotation, and scale of an entity.
Definition Transform.hpp:23