FLECS_API ecs_ftime_t ecs_get_timeout(const ecs_world_t *world, ecs_entity_t tick_source)
Get current timeout value for the specified timer.
FLECS_API void ecs_reset_timer(ecs_world_t *world, ecs_entity_t tick_source)
Reset time value of timer to 0.
FLECS_API ecs_entity_t ecs_set_interval(ecs_world_t *world, ecs_entity_t tick_source, ecs_ftime_t interval)
Set timer interval.
FLECS_API ecs_ftime_t ecs_get_interval(const ecs_world_t *world, ecs_entity_t tick_source)
Get current interval value for the specified timer.
FLECS_API void ecs_set_tick_source(ecs_world_t *world, ecs_entity_t system, ecs_entity_t tick_source)
Assign tick source to system.
FLECS_API ecs_entity_t ecs_set_rate(ecs_world_t *world, ecs_entity_t tick_source, int32_t rate, ecs_entity_t source)
Set rate filter.
FLECS_API void FlecsTimerImport(ecs_world_t *world)
Timer module import function.
struct EcsTimer EcsTimer
Component used for one shot/interval timer functionality.
FLECS_API void ecs_start_timer(ecs_world_t *world, ecs_entity_t tick_source)
Start timer.
FLECS_API void ecs_randomize_timers(ecs_world_t *world)
Enable randomizing initial time value of timers.
FLECS_API ecs_entity_t ecs_set_timeout(ecs_world_t *world, ecs_entity_t tick_source, ecs_ftime_t timeout)
Set timer timeout.
FLECS_API void ecs_stop_timer(ecs_world_t *world, ecs_entity_t tick_source)
Stop timer This operation stops a timer from triggering.
struct EcsRateFilter EcsRateFilter
Apply a rate filter to a tick source.
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
#define ecs_ftime_t
Customizable precision for scalar time values.
Apply a rate filter to a tick source.
int32_t rate
Rate of the rate filter.
int32_t tick_count
Number of times the rate filter ticked.
ecs_ftime_t time_elapsed
Time elapsed since last tick.
ecs_entity_t src
Source of the rate filter.
Component used for one shot/interval timer functionality.
ecs_ftime_t time
Incrementing time value.
bool active
Is the timer active or not.
bool single_shot
Is this a single shot timer.
ecs_ftime_t overshoot
Used to correct returned interval time.
int32_t fired_count
Number of times ticked.
ecs_ftime_t timeout
Timer timeout period.