17template<
typename Base,
typename ... Components>
18struct system_builder_i : query_builder_i<Base, Components ...> {
20 using BaseClass = query_builder_i<Base, Components ...>;
24 : BaseClass(&desc->query)
31 Base&
kind(entity_t phase) {
35 ecs_remove_id(world_v(), desc_->entity, ecs_dependson(cur_phase));
39 ecs_add_id(world_v(), desc_->entity, ecs_dependson(phase));
45 template <typename E, if_t<is_enum<E>::value> = 0>
48 const auto& et = enum_type<E>(this->world_v());
49 flecs::entity_t target = et.entity(phase);
50 return this->
kind(target);
57 template <
typename Phase>
67 desc_->multi_threaded = value;
76 desc_->immediate = value;
152 virtual flecs::world_t* world_v()
override = 0;
156 return *
static_cast<Base*
>(
this);
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Add a (component) id to an entity.
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Remove a (component) id from an entity.
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.
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.
Base & kind(entity_t phase)
Specify in which phase the system should run.
Base & tick_source(flecs::entity_t tick_source)
Set tick source.
Base & rate(int32_t rate)
Set system rate.
Base & immediate(bool value=true)
Specify whether system should be ran in staged context.
Base & ctx(void *ptr)
Set system context.
Base & rate(const entity_t tick_source, int32_t rate)
Set system rate.
Base & run(ecs_iter_action_t action)
Set system run callback.
Base & kind()
Specify in which phase the system should run.
Base & interval(ecs_ftime_t interval)
Set system interval.
Base & tick_source()
Set tick source.
Base & multi_threaded(bool value=true)
Specify whether system can run on multiple threads.