11inline void world::init_builtin_components() {
12 component<Component>(
"flecs::core::Component");
13 component<Identifier>(
"flecs::core::Identifier");
14 component<Poly>(
"flecs::core::Poly");
17 _::system_init(*
this);
36 const char *name = alias;
47 ecs_assert(e != 0, ECS_INVALID_PARAMETER, NULL);
54 entity_t eid = e.
id();
55 const char *name = alias;
128template <typename Func, if_t< is_callable<Func>::value > >
130 static_assert(
arity<Func>::value == 1,
"singleton component must be the only argument");
132 this->m_world, this->
singleton<first_arg_t<Func>>(), func);
135template <typename Func, if_t< is_callable<Func>::value > >
137 static_assert(
arity<Func>::value == 1,
"singleton component must be the only argument");
139 this->m_world, this->
singleton<first_arg_t<Func>>(), func);
167 return flecs::entity(world_, impl_.constants[
static_cast<int>(value)].id);
#define ecs_assert(condition, error_code,...)
Assert.
void ecs_ensure(ecs_world_t *world, ecs_entity_t entity)
Ensure id is alive.
ecs_entity_t ecs_get_alive(const ecs_world_t *world, ecs_entity_t e)
Get alive identifier.
void ecs_set_alias(ecs_world_t *world, ecs_entity_t entity, const char *alias)
Set alias for entity.
ecs_entity_t ecs_get_scope(const ecs_world_t *world)
Get the current scope.
ecs_entity_t ecs_lookup_path_w_sep(const ecs_world_t *world, ecs_entity_t parent, const char *path, const char *sep, const char *prefix, bool recursive)
Lookup an entity from a path.
const char * ecs_get_name(const ecs_world_t *world, ecs_entity_t entity)
Get the name of an entity.
ecs_entity_t ecs_set_scope(ecs_world_t *world, ecs_entity_t scope)
Set the current scope.
Self & add()
Add a component to an entity.
Self & remove()
Remove a component from an entity.
const T * get() const
Get component value.
bool has(flecs::id_t e) const
Check if entity has the provided entity.
entity_t id() const
Get entity id.
T * get_mut() const
Get mutable component value.
ref< T > get_ref() const
Get reference to component.
void modified() const
Signal that component was modified.
Convenience type with enum reflection data.
flecs::entity get_scope() const
Get current scope.
T * get_mut() const
Get mut singleton component.
void remove() const
Remove singleton component.
flecs::entity get_alive(flecs::entity_t e) const
Get alive entity for id.
const T * get() const
Get singleton component.
flecs::entity lookup(const char *name) const
Lookup entity by name.
flecs::entity set_scope() const
Same as set_scope but with type.
flecs::entity ensure(flecs::entity_t e) const
Ensures that entity with provided generation is alive.
void modified() const
Mark singleton component as modified.
flecs::entity use(const char *alias=nullptr) const
Create alias for component.
void add() const
Add singleton component.
void set(const T &value) const
Set singleton component.
bool has() const
Test if world has singleton component.
flecs::entity singleton() const
Get singleton entity for type.
ref< T > get_ref() const
Get ref singleton component.