Systems module

Structures

ecs_dbg_system_t
ecs_system_desc_t

Mentioned in

EcsTickSource
FlecsSystem

Functions

ecs_dbg_get_active_table
ecs_dbg_get_column_type
ecs_dbg_get_inactive_table
ecs_dbg_match_entity
ecs_dbg_system
ecs_get_queryGet the query object for a system
ecs_get_system_ctxGet system context
ecs_runRun a specific system manually
ecs_run_w_filterRun system with offset/limit and type filter
ecs_run_workerSame as ecs_run, but subdivides entities across number of provided stages.
ecs_system_init

Mentioned in

ecs_type overload
FlecsSystemImport

Enums

ecs_system_status_tSystem status change callback

Defines

Defines (system.h)

FLECS_SYSTEMS_H

ECS_SYSTEM(world,id,kind,...)
ecs_iter_action_t ecs_iter_action(id) = id;
ecs_entity_t id = ecs_system_init(world, &(ecs_system_desc_t){
.entity = { .name = #id, .add = {kind} },
.query.filter.expr = #__VA_ARGS__,
.callback = ecs_iter_action(id)
});
ecs_assert(id != 0, ECS_INVALID_PARAMETER, NULL);
(void)ecs_iter_action(id);
(void)id;

Mentioned in:

ECS_TRIGGER(world,trigger_name,kind,component)
ecs_entity_t __F##trigger_name = ecs_trigger_init(world, &(ecs_trigger_desc_t){
.entity.name = #trigger_name,
.callback = trigger_name,
.expr = #component,
.events = {kind},
});
ecs_entity_t trigger_name = __F##trigger_name;
ecs_assert(trigger_name != 0, ECS_INVALID_PARAMETER, NULL);
(void)__F##trigger_name;
(void)trigger_name;

Mentioned in:

FlecsSystemImportHandles(handles)

Typedefs

Typedefs (system.h)

typedef void(* ecs_system_status_action_t)(ecs_world_t *world, ecs_entity_t system, ecs_system_status_t status, void *ctx)

System status action. The status action is invoked whenever a system is enabled or disabled. Note that a system may be enabled but may not actually match any entities. In this case the system is enabled but not active.

In addition to communicating the enabled / disabled status, the action also communicates changes in the activation status of the system. A system becomes active when it has one or more matching entities, and becomes inactive when it no longer matches any entities.

A system switches between enabled and disabled when an application invokes the ecs_enable operation with a state different from the state of the system, for example the system is disabled, and ecs_enable is invoked with enabled: true.

Additionally a system may switch between enabled and disabled when it is an EcsOnDemand system, and interest is generated or lost for one of its [out] columns.

Parameters

world - The world.

system - The system for which to set the action.

action - The action.

ctx - Context that will be passed to the action when invoked.