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");
47 world.
component<enum_constant_t>(
"flecs::meta::enum_constant");
48 world.
component<bitmask_constant_t>(
"flecs::meta::bitmask_constant");
50 world.
component<MetaType>(
"flecs::meta::MetaType");
51 world.
component<MetaTypeSerialized>(
"flecs::meta::MetaTypeSerialized");
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::MemberRanges");
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(_::cpp_type<T>::id(m_world), array_count);
140 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
146 return this->
vector(_::cpp_type<T>::id(m_world));
152 return this->value_(
this, type, v);
158 const_cast<flecs::world_t*
>(this->world)), &v);
162 return this->member_(
this, name);
#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().
Used with ecs_primitive_init().
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().
flecs::entity get_type() const
Get type of value.
ecs_meta_cursor_t m_cursor
Cursor object.
flecs::entity get_entity() const
Get entity value.
flecs::entity get_unit() const
Get unit of value.
Self & scope(const Func &func)
The function will be ran with the scope set to the current entity.
Self & add()
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.