Timed Event System
Source file: client/engine/systems/systems_functions/TimedEventSystem.cpp
Purpose: Execute cooldown-based periodic actions for each entity.
Components used:
TimedEvents(list ofCooldownActionwithcooldown,cooldown_max, andactioncallback)GameWorld(last_delta_used as time step)
Behavior
- For each entity with
TimedEvents, increments each action'scooldownbygame_world.last_delta_. - When
cooldownexceedscooldown_max, resets it to 0 and executesaction(entityId)if set. - Supports chaining multiple independent periodic actions on the same entity (e.g., auto-fire, timed effects).
Main signature
void TimedEventSystem(Eng::registry ®, GameWorld &game_world,
Eng::sparse_array<Com::TimedEvents> &timed_events);
Notes
- No ordering guarantees beyond the vector order of
cooldown_actions. - Frame-rate independent thanks to delta time usage.