Systems module

Structures

ecs_system_desc_t

Mentioned in

EcsTickSource
FlecsSystem

Functions

ecs_get_system_binding_ctxGet system binding context
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_get_queryGet the query object for a system
ecs_system_init

Mentioned in

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:

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.

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.