32 timer& rate(int32_t rate, flecs::entity_t tick_source = 0) {
51template <
typename... Args>
56inline void world::randomize_timers()
const {
100 world.
component<RateFilter>(
"flecs::timer::RateFilter");
101 world.
component<Timer>(
"flecs::timer::Timer");
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 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 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.
ecs_ftime_t timeout()
Get timeout.
ecs_ftime_t interval()
Get interval.
void set_tick_source()
Set external tick source.
void rate(int32_t rate)
Set system rate (system is its own tick source).
flecs::timer timer() const
Find or register a singleton timer.
flecs::component< T > component(Args &&... args) const
Find or register component.
#define ecs_ftime_t
Customizable precision for scalar time values.