80#define ECS_MEMBER_DESC_CACHE_SIZE (32)
96typedef char ecs_char_t;
97typedef unsigned char ecs_byte_t;
98typedef uint8_t ecs_u8_t;
99typedef uint16_t ecs_u16_t;
100typedef uint32_t ecs_u32_t;
101typedef uint64_t ecs_u64_t;
102typedef uintptr_t ecs_uptr_t;
103typedef int8_t ecs_i8_t;
104typedef int16_t ecs_i16_t;
105typedef int32_t ecs_i32_t;
106typedef int64_t ecs_i64_t;
107typedef intptr_t ecs_iptr_t;
108typedef float ecs_f32_t;
109typedef double ecs_f64_t;
110typedef char* ecs_string_t;
145FLECS_API
extern const ecs_entity_t ecs_id(ecs_string_t);
158 EcsTypeKindLast = EcsOpaqueType
188 EcsPrimitiveKindLast = EcsId
303#if !defined(__cplusplus) || !defined(FLECS_CPP)
322#elif defined(__cplusplus)
343 template <
typename T>
347 int member(
const char *name)
const;
422 void* (*ensure_element)(
427 void* (*ensure_member)(
504 EcsMetaTypeOpKindLast = EcsOpId
526#define ECS_META_MAX_SCOPE_DEPTH (32)
924#define ecs_primitive(world, ...)\
925 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
927#define ecs_enum(world, ...)\
928 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
930#define ecs_bitmask(world, ...)\
931 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
933#define ecs_array(world, ...)\
934 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
936#define ecs_vector(world, ...)\
937 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
939#define ecs_opaque(world, ...)\
940 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
942#define ecs_struct(world, ...)\
943 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
945#define ecs_unit(world, ...)\
946 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
948#define ecs_unit_prefix(world, ...)\
949 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
951#define ecs_quantity(world, ...)\
952 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.
Used with ecs_enum_init().
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)
Used with ecs_unit_init().
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)