Systems module

Structures

ecs_system_desc_t

Mentioned in

EcsTickSource

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_SYSTEM_H

ECS_SYSTEM_DEFINE(world,id,kind,...)
{
ecs_system_desc_t desc = {0};
desc.entity.name = #id;
desc.entity.add[0] = kind;
desc.query.filter.expr = #__VA_ARGS__;
desc.callback = id;
ecs_id(id) = ecs_system_init(world, &desc);
}
ecs_assert(ecs_id(id) != 0, ECS_INVALID_PARAMETER, NULL);

ECS_SYSTEM(world,id,kind,...)
ecs_entity_t ecs_id(id); ECS_SYSTEM_DEFINE(world, id, kind, __VA_ARGS__);
ecs_entity_t id = ecs_id(id);
(void)ecs_id(id);
(void)id;

Mentioned in:

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 the action has changed.

status - The status that triggered the callback.

ctx - Context passed to ecs_system_desc_t as status_ctx.