Function ecs_clone

Synopsis

#include <include/flecs.h>

FLECS_API ecs_entity_t ecs_clone(ecs_world_t *world, ecs_entity_t dst, ecs_entity_t src, bool copy_value)

Description

Create N new entities. This operation is the same as ecs_new, but creates N entities instead of one and does not recycle ids.

Parameters

world - The world.

component - The component type.

count - The number of entities to create.

Returns
The first entity id of the newly created entities. Clone an entity This operation clones the components of one entity into another entity. If no destination entity is provided, a new entity will be created. Component values are not copied unless copy_value is true.
Parameters

world - The world.

dst - The entity to copy the components to.

src - The entity to copy the components from.

copy_value - If true, the value of components will be copied to dst.

Returns
The destination entity.

Source

Line 912 in include/flecs.h.