17template<
typename Base,
typename ... Components>
49 template <typename E, if_t<is_enum<E>::value> = 0>
52 const auto& et = enum_type<E>(this->world_v());
54 return this->
kind(target);
61 template <
typename Phase>
160 return *
static_cast<Base*
>(
this);
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Remove a component from an entity.
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.
ecs_entity_t entity_t
Entity type.
ecs_world_t world_t
World type.
ecs_entity_t ecs_get_target(const ecs_world_t *world, ecs_entity_t entity, ecs_entity_t rel, int32_t index)
Get the target of a relationship.
#define ecs_dependson(e)
Construct a DependsOn pair.
void(* ecs_iter_action_t)(ecs_iter_t *it)
Function prototype for iterables.
#define ecs_ftime_t
Customizable precision for scalar time values.
Use with ecs_system_init() to create or update a system.
int32_t rate
Rate at which the system should run.
void * ctx
Context to be passed to callback (as ecs_iter_t::param).
bool multi_threaded
If true, the system will be run on multiple threads.
bool immediate
If true, the system will have access to the actual world.
ecs_ftime_t interval
Interval in seconds at which the system should run.
ecs_entity_t entity
Existing entity to associate with the system (optional).
ecs_run_action_t run
Callback that is invoked when a system is run.
ecs_entity_t tick_source
External tick source that determines when the system ticks.
System builder interface.
Base & kind(entity_t phase)
Specify in which phase the system should run.
Base & kind(E phase)
Specify in which phase the system should run, using an enum constant.
Base & tick_source(flecs::entity_t tick_source)
Set the tick source.
Base & rate(int32_t rate)
Set the system rate.
Base & immediate(bool value=true)
Specify whether the system should be run in an immediate (non-staged) context.
Base & ctx(void *ptr)
Set the system context.
Base & rate(const entity_t tick_source, int32_t rate)
Set the system rate.
Base & run(ecs_iter_action_t action)
Set the system run callback.
Base & kind()
Specify in which phase the system should run.
Base & interval(ecs_ftime_t interval)
Set the system interval.
Base & tick_source()
Set the tick source.
Base & multi_threaded(bool value=true)
Specify whether the system can run on multiple threads.
Base & desc()
Use with cascade() to iterate results in descending (bottom-to-top) order.