|
R-Type
Distributed multiplayer game engine in C++
|
Component managing active buffs on an entity. More...
#include <Buff.hpp>


Public Member Functions | |
| Buff ()=default | |
| Default constructor. | |
| Buff (BuffType type, float duration, float value) | |
| Constructor with initial buff. | |
| ~Buff () override=default | |
| void | addBuff (BuffType type, float duration, float value) |
| Add a new buff. | |
| void | removeBuff (BuffType type) |
| Remove a specific buff. | |
| bool | hasBuff (BuffType type) const |
| Check if entity has a specific buff. | |
| float | getBuffValue (BuffType type) const |
| Get buff value for a specific type. | |
| const std::vector< BuffInstance > & | getBuffs () const |
| Get all active buffs. | |
| std::vector< BuffInstance > & | getBuffsMutable () |
| Get mutable reference to buffs (for system updates) | |
| bool | hasAnyBuffs () const |
| Check if any buffs are active. | |
| void | clearAllBuffs () |
| Clear all buffs. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| std::vector< BuffInstance > | _buffs |
| Active buffs on this entity. | |
Component managing active buffs on an entity.
Stores and manages multiple active buffs with their durations. Supports both temporary (time-limited) and permanent buffs.
|
default |
Default constructor.
|
inline |
|
overridedefault |
|
inline |
|
inline |
|
inline |
Get all active buffs.
Definition at line 139 of file Buff.hpp.
References _buffs.
Referenced by ecs::BuffSystem::_applyBuffEffects().
|
inline |
Get mutable reference to buffs (for system updates)
Definition at line 145 of file Buff.hpp.
References _buffs.
Referenced by ecs::BuffSystem::_updateBuffTimers().
|
inline |
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
|
inline |
Check if any buffs are active.
Definition at line 151 of file Buff.hpp.
References _buffs.
Referenced by ecs::BuffSystem::update().
|
inline |
Check if entity has a specific buff.
| type | Type of buff to check |
Definition at line 114 of file Buff.hpp.
References _buffs.
Referenced by ecs::WeaponSystem::fireChargedShot(), and ecs::WeaponSystem::fireWeapon().
|
inline |
|
private |
Active buffs on this entity.
Definition at line 165 of file Buff.hpp.
Referenced by addBuff(), clearAllBuffs(), getBuffs(), getBuffsMutable(), getBuffValue(), hasAnyBuffs(), hasBuff(), and removeBuff().