Typedef in ldk_component.h

LDKComponentDestroyFn

Callback used when component instance data is destroyed.

typedef void(*LDKComponentDestroyFn)(LDKEntityRegistry *entity_registry, LDKComponentRegistry *component_registry, LDKEntity entity, void *component, u32 component_index, void *user);

Parameters

entity_registry
Entity registry used by this operation.
component_registry
Component registry used by this operation.
entity
Entity to inspect or modify.
component
Component used by this operation.
component_index
Zero-based index of the component entry.
user
Opaque caller-supplied data passed to the callback.
Function in ldk_component.h

ldk_component_create

Create the component.

LDK_API void * ldk_component_create(
 LDKComponentRegistry *module,
 u32 component_type,
 u32 *component_index
);

Parameters

LDKComponentRegistry *module
Module used by this operation.
u32 component_type
Registered ECS component type identifier.
u32 *component_index
Zero-based index of the component entry.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_component.h

ldk_component_destroy

Destroy the component.

LDK_API bool ldk_component_destroy(
 LDKComponentRegistry *module,
 LDKEntityRegistry *entity_module,
 u32 component_type,
 u32 component_index
);

Parameters

LDKComponentRegistry *module
Module used by this operation.
LDKEntityRegistry *entity_module
Entity module used by this operation.
u32 component_type
Registered ECS component type identifier.
u32 component_index
Zero-based index of the component entry.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_component.h

ldk_component_destroy_data

Release data associated with a component instance.

LDK_API void ldk_component_destroy_data(
 LDKComponentRegistry *registry,
 LDKEntityRegistry *entity_registry,
 LDKEntity entity,
 u32 component_type,
 u32 component_index
);

Parameters

LDKComponentRegistry *registry
Registry on which the operation is performed.
LDKEntityRegistry *entity_registry
Entity registry used by this operation.
LDKEntity entity
Entity to inspect or modify.
u32 component_type
Registered ECS component type identifier.
u32 component_index
Zero-based index of the component entry.