16template <
typename EntityType>
21 flecs::entity_t
id = data->id();
22 return ser->
value(flecs::Entity, &
id);
25 [](EntityType *dst, flecs::world_t *world, flecs::entity_t e) {
26 *dst = EntityType(world, e);
31 world.
component<bool_t>(
"flecs::meta::bool");
32 world.
component<char_t>(
"flecs::meta::char");
34 world.
component<u16_t>(
"flecs::meta::u16");
35 world.
component<u32_t>(
"flecs::meta::u32");
36 world.
component<u64_t>(
"flecs::meta::u64");
38 world.
component<i16_t>(
"flecs::meta::i16");
39 world.
component<i32_t>(
"flecs::meta::i32");
40 world.
component<i64_t>(
"flecs::meta::i64");
41 world.
component<f32_t>(
"flecs::meta::f32");
42 world.
component<f64_t>(
"flecs::meta::f64");
44 world.
component<type_kind_t>(
"flecs::meta::type_kind");
45 world.
component<primitive_kind_t>(
"flecs::meta::primitive_kind");
46 world.
component<member_t>(
"flecs::meta::member_t");
47 world.
component<enum_constant_t>(
"flecs::meta::enum_constant");
48 world.
component<bitmask_constant_t>(
"flecs::meta::bitmask_constant");
50 world.
component<Type>(
"flecs::meta::type");
51 world.
component<TypeSerializer>(
"flecs::meta::TypeSerializer");
52 world.
component<Primitive>(
"flecs::meta::primitive");
53 world.
component<Enum>(
"flecs::meta::enum");
54 world.
component<Bitmask>(
"flecs::meta::bitmask");
55 world.
component<Member>(
"flecs::meta::member");
56 world.
component<MemberRanges>(
"flecs::meta::member_ranges");
57 world.
component<Struct>(
"flecs::meta::struct");
58 world.
component<Array>(
"flecs::meta::array");
59 world.
component<Vector>(
"flecs::meta::vector");
61 world.
component<Unit>(
"flecs::meta::unit");
67 if (!flecs::is_same<i32_t, iptr_t>() && !flecs::is_same<i64_t, iptr_t>()) {
69 ecs_assert(flecs::type_id<iptr_t>() == flecs::Iptr,
70 ECS_INTERNAL_ERROR, NULL);
76 if (!flecs::is_same<u32_t, uptr_t>() && !flecs::is_same<u64_t, uptr_t>()) {
78 ecs_assert(flecs::type_id<uptr_t>() == flecs::Uptr,
79 ECS_INTERNAL_ERROR, NULL);
88 .opaque(flecs_entity_support<flecs::entity_view>);
90 .opaque(flecs_entity_support<flecs::entity>);
116 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
124 desc.
count = array_count;
126 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
133 return this->
array(_::type<T>::id(world_), array_count);
140 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
146 return this->
vector(_::type<T>::id(world_));
152 return this->value_(
this, type, v);
158 const_cast<flecs::world_t*
>(this->world)), &v);
162 return this->member_(
this, name);
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component id for EcsDocDescription.
#define ecs_assert(condition, error_code,...)
Assert.
ecs_id_t ecs_entity_t
An entity identifier.
flecs::component< T > component(Args &&... args) const
Find or register component.
flecs::entity entity(Args &&... args) const
Create an entity.
Used with ecs_array_init().
ecs_entity_t type
Element type.
int32_t count
Number of elements.
Used with ecs_primitive_init().
ecs_primitive_kind_t kind
Primitive type kind.
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_vector_init().
ecs_entity_t type
Element type.
flecs::entity get_type() const
Get type of value.
flecs::entity get_entity() const
Get entity value.
flecs::entity get_unit() const
Get unit of value.
ecs_meta_cursor_t cursor_
Cursor object.
const Self & scope(const Func &func) const
The function will be ran with the scope set to the current entity.
const Self & add() const
Add a component to an entity.
Type safe interface for opaque types.
opaque & as_type(flecs::id_t func)
Type that describes the type kind/structure of the opaque type.
opaque & serialize(flecs::serialize< T > func)
Serialize function.