78#define ECS_MEMBER_DESC_CACHE_SIZE (32)
88typedef char ecs_char_t;
89typedef unsigned char ecs_byte_t;
90typedef uint8_t ecs_u8_t;
91typedef uint16_t ecs_u16_t;
92typedef uint32_t ecs_u32_t;
93typedef uint64_t ecs_u64_t;
94typedef uintptr_t ecs_uptr_t;
95typedef int8_t ecs_i8_t;
96typedef int16_t ecs_i16_t;
97typedef int32_t ecs_i32_t;
98typedef int64_t ecs_i64_t;
99typedef intptr_t ecs_iptr_t;
100typedef float ecs_f32_t;
101typedef double ecs_f64_t;
102typedef char* ecs_string_t;
136FLECS_API
extern const ecs_entity_t ecs_id(ecs_string_t);
148 EcsTypeKindLast = EcsOpaqueType
160typedef enum ecs_primitive_kind_t {
178 EcsPrimitiveKindLast = EcsEntity
179} ecs_primitive_kind_t;
182 ecs_primitive_kind_t kind;
260#if !defined(__cplusplus) || !defined(FLECS_CPP)
279#elif defined(__cplusplus)
300 template <
typename T>
304 int member(
const char *name)
const;
373 void* (*ensure_element)(
378 void* (*ensure_member)(
454 EcsMetaTypeOpKindLast = EcsOpEntity
476#define ECS_META_MAX_SCOPE_DEPTH (32)
680 ecs_primitive_kind_t type_kind,
688 ecs_primitive_kind_t kind;
852#define ecs_primitive(world, ...)\
853 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
855#define ecs_enum(world, ...)\
856 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
858#define ecs_bitmask(world, ...)\
859 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
861#define ecs_array(world, ...)\
862 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
864#define ecs_vector(world, ...)\
865 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
867#define ecs_opaque(world, ...)\
868 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
870#define ecs_struct(world, ...)\
871 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
873#define ecs_unit(world, ...)\
874 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
876#define ecs_unit_prefix(world, ...)\
877 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
879#define ecs_quantity(world, ...)\
880 ecs_quantity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ )
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
ecs_map_t constants
Populated from child entities with Constant component.
size_t(* count)(const void *dst)
Return number of elements.
void(* assign_null)(void *dst)
Assign null value.
void(* clear)(void *dst)
Clear collection elements.
void(* assign_uint)(void *dst, uint64_t value)
Assign unsigned int value.
ecs_meta_serialize_t serialize
Serialize action.
void(* assign_char)(void *dst, char value)
Assign char value.
ecs_entity_t as_type
Type that describes the serialized output.
void(* assign_bool)(void *dst, bool value)
Assign bool value.
void(* assign_string)(void *dst, const char *value)
Assign string value.
void(* resize)(void *dst, size_t count)
Resize to number of elements.
void(* assign_int)(void *dst, int64_t value)
Assign int value.
void(* assign_float)(void *dst, double value)
Assign float value.
void(* assign_entity)(void *dst, ecs_world_t *world, ecs_entity_t entity)
Assign entity value.
ecs_vec_t members
Populated from child entities with Member component.
ecs_unit_translation_t translation
Translation of prefix.
char * symbol
Symbol of prefix (e.g.
ecs_unit_translation_t translation
Translation for derived unit.
ecs_entity_t prefix
Order of magnitude prefix relative to derived.
ecs_entity_t base
Base unit (e.g.
ecs_entity_t over
Over unit (e.g.
Used with ecs_array_init.
ecs_entity_t entity
Existing entity to use for type (optional)
ecs_entity_t constant
Should not be set by ecs_bitmask_desc_t.
ecs_flags32_t value
May be set when used with ecs_bitmask_desc_t.
const char * name
Must be set when used with ecs_bitmask_desc_t.
Used with ecs_bitmask_init.
ecs_entity_t entity
Existing entity to use for type (optional)
Used with ecs_entity_init.
ecs_entity_t constant
Should not be set by ecs_enum_desc_t.
int32_t value
May be set when used with ecs_enum_desc_t.
const char * name
Must be set when used with ecs_enum_desc_t.
ecs_entity_t entity
Existing entity to use for type (optional)
Element type of members vector in EcsStruct.
const char * name
Must be set when used with ecs_struct_desc_t.
ecs_size_t size
Should not be set by ecs_struct_desc_t.
ecs_entity_t unit
May be set when used with ecs_struct_desc_t, will be auto-populated if type entity is also a unit.
int32_t count
May be set when used with ecs_struct_desc_t.
Used with ecs_opaque_init.
Used with ecs_primitive_init.
ecs_entity_t entity
Existing entity to use for type (optional)
int(* value)(const struct ecs_serializer_t *ser, ecs_entity_t type, const void *value)
Pointer to the value to serialize.
int(* member)(const struct ecs_serializer_t *ser, const char *member)
Member name.
Used with ecs_struct_init.
ecs_entity_t entity
Existing entity to use for type (optional)
ecs_entity_t base
Base unit, e.g.
ecs_entity_t over
Over unit, e.g.
const char * symbol
Unit symbol, e.g.
ecs_entity_t prefix
Prefix indicating order of magnitude relative to the derived unit.
ecs_entity_t quantity
Unit quantity, e.g.
ecs_unit_translation_t translation
Translation to apply to derived unit (optional)
ecs_entity_t entity
Existing entity to associate with unit (optional)
Used with ecs_unit_prefix_init.
ecs_entity_t entity
Existing entity to associate with unit prefix (optional)
const char * symbol
Unit symbol, e.g.
ecs_unit_translation_t translation
Translation to apply to derived unit (optional)
int32_t power
Power to apply to factor (e.g.
int32_t factor
Factor to apply (e.g.
Used with ecs_vector_init.
ecs_entity_t entity
Existing entity to use for type (optional)