Typedef in ldk_component.h

LDKComponentAttachFn

Callback used when a component is attached to an entity.

typedef bool(*LDKComponentAttachFn)(LDKEntityRegistry *entity_registry, LDKComponentRegistry *component_registry, LDKEntity entity, void *component, u32 component_index, const void *initial_value, 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.
initial_value
Initial value used by this operation.
user
Opaque caller-supplied data passed to the callback.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_component.h

ldk_component_attach

Attach a component to an entity.

LDK_API bool ldk_component_attach(
 LDKComponentRegistry *registry,
 LDKEntityRegistry *entity_registry,
 LDKEntity entity,
 u32 component_type,
 u32 component_index,
 const void *initial_value
);

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.
const void *initial_value
Initial value used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_component.h

ldk_component_detach

Detach a component from an entity.

LDK_API bool ldk_component_detach(
 LDKComponentRegistry *registry,
 LDKEntityRegistry *entity_system,
 LDKEntity entity,
 u32 component_type
);

Parameters

LDKComponentRegistry *registry
Registry on which the operation is performed.
LDKEntityRegistry *entity_system
Entity system used by this operation.
LDKEntity entity
Entity to inspect or modify.
u32 component_type
Registered ECS component type identifier.

Returns

True if the operation succeeds; false otherwise.