18class StatEffectsComponent :
public Component{
20 StatEffectsComponent() {};
21 ~StatEffectsComponent() {};
24 void update(uint_fast16_t diffTime)
override;
30 void addEffect(uint32_t duration, std::function<
void()> resetFunction);
33 std::vector<StatEffect> effects = {};
void addEffect(uint32_t duration, std::function< void()> resetFunction)
Add a stat effect to the entity.
Definition StatEffectsComponent.cpp:24
Struct to hold the duration, reset function and start time of a stat effect.
Definition StatEffectsComponent.h:11
std::function< void()> resetFunction
Function to reset the effect, will be called on expiry of duration.
Definition StatEffectsComponent.h:13
uint32_t duration
Duration of the effect in milliseconds.
Definition StatEffectsComponent.h:12