16template <
typename EntityType>
22 return ser->
value(flecs::Entity, &
id);
26 *dst = EntityType(world, e);
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");
47 world.
component<enum_constant_t>(
"flecs::meta::enum_constant");
48 world.
component<bitmask_constant_t>(
"flecs::meta::bitmask_constant");
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>()) {
74 if (!flecs::is_same<u32_t, uptr_t>() && !flecs::is_same<u64_t, uptr_t>()) {
84 .
opaque(flecs_entity_support<flecs::entity_view>);
86 .
opaque(flecs_entity_support<flecs::entity>);
120 desc.
count = array_count;
129 return this->
array(_::type<T>::id(
world_), array_count);
148 return this->value_(
this, type, v);
158 return this->member_(
this, name);
component & opaque(const Func &type_support)
Register an opaque type interface.
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
#define ecs_assert(condition, error_code,...)
Assert.
#define ECS_INVALID_OPERATION
Invalid operation error code.
ecs_id_t ecs_entity_t
An entity identifier.
flecs::component< T > component(Args &&... args) const
Find or register a component.
flecs::entity entity(Args &&... args) const
Create an entity.
ecs_entity_t entity_t
Entity type.
ecs_world_t world_t
World type.
#define ecs_remove_pair(world, subject, first, second)
Remove a pair from 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)
Serialize value.
int(* member)(const struct ecs_serializer_t *ser, const char *member)
Serialize member.
Used with ecs_vector_init().
ecs_entity_t type
Element type.
flecs::entity get_type() const
Get the type of a value.
flecs::entity get_entity() const
Get entity value.
flecs::entity get_unit() const
Get the unit of a value.
ecs_meta_cursor_t cursor_
Cursor object.
const Self & scope(const Func &func) const
The function will be run 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)
Set the type that describes the kind/structure of the opaque type.
opaque & serialize(flecs::serialize< T > func)
Set the serialize function.
world_t * world_
Pointer to the underlying C world.