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;
137FLECS_API
extern const ecs_entity_t ecs_id(ecs_string_t);
150 EcsTypeKindLast = EcsOpaqueType
180 EcsPrimitiveKindLast = EcsId
295#if !defined(__cplusplus) || !defined(FLECS_CPP)
314#elif defined(__cplusplus)
335 template <
typename T>
339 int member(
const char *name)
const;
414 void* (*ensure_element)(
419 void* (*ensure_member)(
496 EcsMetaTypeOpKindLast = EcsOpId
518#define ECS_META_MAX_SCOPE_DEPTH (32)
916#define ecs_primitive(world, ...)\
917 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
919#define ecs_enum(world, ...)\
920 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
922#define ecs_bitmask(world, ...)\
923 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
925#define ecs_array(world, ...)\
926 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
928#define ecs_vector(world, ...)\
929 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
931#define ecs_opaque(world, ...)\
932 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
934#define ecs_struct(world, ...)\
935 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
937#define ecs_unit(world, ...)\
938 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
940#define ecs_unit_prefix(world, ...)\
941 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
943#define ecs_quantity(world, ...)\
944 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.
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Component added to array type entities.
int32_t count
Number of elements.
ecs_entity_t type
Element type.
Component added to bitmask type entities.
Component added to enum type entities.
ecs_map_t constants
Populated from child entities with Constant component.
Component added to member entities to express valid value ranges.
Component added to member entities.
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.
void(* assign_id)(void *dst, ecs_world_t *world, ecs_id_t id)
Assign (component) id value.
Component added to primitive types.
Component added to struct type entities.
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.
Component added to vector type entities.
ecs_entity_t type
Element type.
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.
ecs_member_value_range_t warning_range
Numerical range outside of which the value represents an warning.
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.
ecs_member_value_range_t range
Numerical range that specifies which values member can assume.
int32_t count
May be set when used with ecs_struct_desc_t.
ecs_member_value_range_t error_range
Numerical range outside of which the value represents an error.
Type expressing a range for a member value.
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)