R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
BuffSystem.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** RTYPE
4** File description:
5** BuffSystem - Manages buff timers and effects
6*/
7
8#pragma once
9
16
17namespace ecs {
18
26 class BuffSystem : public ISystem {
27 public:
31 BuffSystem() = default;
32
36 ~BuffSystem() override = default;
37
47 void update(Registry &registry, float deltaTime) override;
48
56 ComponentMask getComponentMask() const override;
57
58 private:
64 void _updateBuffTimers(Buff &buff, float deltaTime);
65
72 void _applyBuffEffects(Address address, Registry &registry, const Buff &buff);
73
79 void _applySpeedBoost(Velocity &velocity, float multiplier);
80
86 void _applyDamageBoost(Weapon &weapon, float multiplier);
87
93 void _applyFireRateBoost(Weapon &weapon, float multiplier);
94
100 void _applyShield(Health &health, float duration);
101
108 void _applyHealthRegen(Health &health, float deltaTime, float regenRate);
109 };
110
111} // namespace ecs
Registry for the ECS (Entity-Component System).
System managing buff timers and applying buff effects.
void _applyBuffEffects(Address address, Registry &registry, const Buff &buff)
Apply buff effects to entity stats.
void _applyHealthRegen(Health &health, float deltaTime, float regenRate)
Apply health regeneration.
void _applyFireRateBoost(Weapon &weapon, float multiplier)
Apply fire rate buff multiplier.
void update(Registry &registry, float deltaTime) override
Update buff timers and apply effects.
void _applyDamageBoost(Weapon &weapon, float multiplier)
Apply damage buff multiplier.
~BuffSystem() override=default
Destructor.
void _updateBuffTimers(Buff &buff, float deltaTime)
Update buff timers and remove expired ones.
void _applySpeedBoost(Velocity &velocity, float multiplier)
Apply speed buff multiplier.
ComponentMask getComponentMask() const override
Gets the component mask for this system.
void _applyShield(Health &health, float duration)
Apply shield (invincibility)
BuffSystem()=default
Constructs a BuffSystem.
Component managing active buffs on an entity.
Definition Buff.hpp:58
Component representing entity health and invincibility.
Definition Health.hpp:20
Base interface for all ECS systems.
Definition ISystem.hpp:37
Manages entities, their signatures and component type registrations.
Definition Registry.hpp:68
Component representing movement direction and speed.
Definition Velocity.hpp:20
Component for entities capable of shooting projectiles.
Definition Weapon.hpp:28
Maximum number of distinct component types supported by the Registry.
Definition GameLogic.hpp:26
std::uint32_t Address
Type used to represent an entity address/ID.
std::uint64_t ComponentMask
Type alias for component bitmask.
Definition ISystem.hpp:24