Struct ecs_entity_desc_t


#include <include/flecs.h>

typedef struct ecs_entity_desc_t


Used with ecs_entity_init

Mentioned in


Lines 605-637 in include/flecs.h.

typedef struct ecs_entity_desc_t {
    int32_t _canary;

    ecs_entity_t id;     /* Set to modify existing entity (optional) */

    const char *name;    /* Name of the entity. If no entity is provided, an 
                          * entity with this name will be looked up first. When
                          * an entity is provided, the name will be verified
                          * with the existing entity. */

    const char *sep;     /* Optional custom separator for hierarchical names */
    const char *root_sep; /* Optional, used for identifiers relative to root */

    const char *symbol;  /* Optional entity symbol. A symbol is an unscoped
                          * identifier that can be used to lookup an entity. The
                          * primary use case for this is to associate the entity
                          * with a language identifier, such as a type or 
                          * function name, where these identifiers differ from
                          * the name they are registered with in flecs. For 
                          * example, C type "EcsPosition" might be registered
                          * as "flecs.components.transform.Position", with the
                          * symbol set to "EcsPosition". */

    bool use_low_id;     /* When set to true, a low id (typically reserved for
                          * components) will be used to create the entity, if
                          * no id is specified. */

    /* Array of ids to add to the new or existing entity. */
    ecs_id_t add[ECS_ID_CACHE_SIZE];

    /* String expression with components to add */
    const char *add_expr;
} ecs_entity_desc_t;