Flecs v4.0
A fast entity component system (ECS) for C & C++
|
Component class. More...
#include <component.hpp>
Public Member Functions | |
component (flecs::world_t *world, const char *name=nullptr, bool allow_tag=true, flecs::id_t id=0) | |
Register a component. | |
template<typename Func > | |
component< T > & | on_add (Func &&func) |
Register on_add hook. | |
template<typename Func > | |
component< T > & | on_remove (Func &&func) |
Register on_remove hook. | |
template<typename Func > | |
component< T > & | on_set (Func &&func) |
Register on_set hook. | |
template<typename Kind > | |
untyped_component & | metric (flecs::entity_t parent=0, const char *brief=nullptr, const char *name=nullptr) |
Register member as metric. | |
Public Member Functions inherited from flecs::untyped_component | |
entity () | |
entity (world_t *world) | |
Create entity. | |
entity (const flecs::world_t *world, flecs::entity_t id) | |
Wrap an existing entity id. | |
entity (world_t *world, const char *name) | |
Create a named entity. | |
entity (entity_t id) | |
Conversion from flecs::entity_t to flecs::entity. | |
Public Member Functions inherited from flecs::entity | |
entity (world_t *world) | |
Create entity. | |
entity (const flecs::world_t *world, flecs::entity_t id) | |
Wrap an existing entity id. | |
entity (world_t *world, const char *name) | |
Create a named entity. | |
entity (entity_t id) | |
Conversion from flecs::entity_t to flecs::entity. | |
template<typename T > | |
T & | ensure () const |
Get mutable component value. | |
void * | ensure (entity_t comp) const |
Get mutable component value (untyped). | |
template<typename First , typename Second , typename P = pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0> | |
A & | ensure () const |
Get mutable pointer for a pair. | |
template<typename First > | |
First & | ensure (entity_t second) const |
Get mutable pointer for the first element of a pair. | |
void * | ensure (entity_t first, entity_t second) const |
Get mutable pointer for a pair (untyped). | |
template<typename Second > | |
Second & | ensure_second (entity_t first) const |
Get mutable pointer for the second element of a pair. | |
template<typename T > | |
void | modified () const |
Signal that component was modified. | |
template<typename First , typename Second , typename A = actual_type_t<flecs::pair<First, Second>>> | |
void | modified () const |
Signal that the first element of a pair was modified. | |
template<typename First > | |
void | modified (entity_t second) const |
Signal that the first part of a pair was modified. | |
void | modified (entity_t first, entity_t second) const |
Signal that a pair has modified (untyped). | |
void | modified (entity_t comp) const |
Signal that component was modified. | |
template<typename T , if_t< is_actual< T >::value > = 0> | |
ref< T > | get_ref () const |
Get reference to component. | |
template<typename T , typename A = actual_type_t<T>, if_t< flecs::is_pair< T >::value > = 0> | |
ref< A > | get_ref () const |
Get reference to component. | |
template<typename First , typename Second , typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>> | |
ref< A > | get_ref () const |
template<typename First > | |
ref< First > | get_ref (flecs::entity_t second) const |
template<typename Second > | |
ref< Second > | get_ref_second (flecs::entity_t first) const |
void | clear () const |
Clear an entity. | |
void | destruct () const |
Delete an entity. | |
flecs::entity_view | view () const |
Return entity as entity_view. | |
const char * | from_json (const char *json) |
Deserialize entity to JSON. | |
Public Member Functions inherited from flecs::entity_builder< entity > | |
const entity & | add () const |
Add a component to an entity. | |
const entity & | add (E value) const |
Add pair for enum constant. | |
const entity & | add (id_t component) const |
Add an entity to an entity. | |
const entity & | add (entity_t first, entity_t second) const |
Add a pair. | |
const entity & | add () const |
Add a pair. | |
const entity & | add (Second second) const |
Add a pair. | |
const entity & | add (Second constant) const |
Add a pair. | |
const entity & | add_second (flecs::entity_t first) const |
Add a pair. | |
const entity & | add_if (bool cond, flecs::id_t component) const |
Conditional add. | |
const entity & | add_if (bool cond) const |
Conditional add. | |
const entity & | add_if (bool cond, flecs::entity_t first, flecs::entity_t second) const |
Conditional add. | |
const entity & | add_if (bool cond, flecs::entity_t second) const |
Conditional add. | |
const entity & | add_if (bool cond) const |
Conditional add. | |
const entity & | add_if (bool cond, E constant) const |
Conditional add. | |
const entity & | is_a (entity_t second) const |
Shortcut for add(IsA, entity) . | |
const entity & | is_a () const |
Shortcut for add(IsA, entity) . | |
const entity & | child_of (entity_t second) const |
Shortcut for add(ChildOf, entity) . | |
const entity & | child_of () const |
Shortcut for add(ChildOf, entity) . | |
const entity & | depends_on (entity_t second) const |
Shortcut for add(DependsOn, entity) . | |
const entity & | depends_on (E second) const |
Shortcut for add(DependsOn, entity) . | |
const entity & | depends_on () const |
Shortcut for add(DependsOn, entity) . | |
const entity & | slot_of (entity_t second) const |
Shortcut for add(SlotOf, entity) . | |
const entity & | slot_of () const |
Shortcut for add(SlotOf, entity) . | |
const entity & | slot () const |
Shortcut for add(SlotOf, target(ChildOf)) . | |
const entity & | remove () const |
Remove a component from an entity. | |
const entity & | remove () const |
Remove pair for enum. | |
const entity & | remove (entity_t entity) const |
Remove an entity from an entity. | |
const entity & | remove (entity_t first, entity_t second) const |
Remove a pair. | |
const entity & | remove () const |
Removes a pair. | |
const entity & | remove (Second second) const |
Remove a pair. | |
const entity & | remove (Second constant) const |
Remove a pair. | |
const entity & | remove_second (flecs::entity_t first) const |
Removes a pair. | |
const entity & | auto_override (flecs::id_t id) const |
Mark id for auto-overriding. | |
const entity & | auto_override (flecs::entity_t first, flecs::entity_t second) const |
Mark pair for auto-overriding. | |
const entity & | auto_override () const |
Mark component for auto-overriding. | |
const entity & | auto_override (flecs::entity_t second) const |
Mark pair for auto-overriding. | |
const entity & | auto_override () const |
Mark pair for auto-overriding. | |
const entity & | set_auto_override (const T &val) const |
Set component, mark component for auto-overriding. | |
const entity & | set_auto_override (T &&val) const |
Set component, mark component for auto-overriding. | |
const entity & | set_auto_override (flecs::entity_t second, const First &val) const |
Set pair, mark component for auto-overriding. | |
const entity & | set_auto_override (flecs::entity_t second, First &&val) const |
Set pair, mark component for auto-overriding. | |
const entity & | set_auto_override (const A &val) const |
Set component, mark component for auto-overriding. | |
const entity & | set_auto_override (A &&val) const |
Set component, mark component for auto-overriding. | |
const entity & | emplace_auto_override (Args &&... args) const |
Emplace component, mark component for auto-overriding. | |
const entity & | emplace_auto_override (Args &&... args) const |
Emplace pair, mark pair for auto-overriding. | |
const entity & | enable () const |
Enable an entity. | |
const entity & | enable (flecs::id_t id, bool toggle=true) const |
Enable an id. | |
const entity & | enable () const |
Enable a component. | |
const entity & | enable (flecs::id_t first, flecs::id_t second) const |
Enable a pair. | |
const entity & | enable (flecs::id_t second) const |
Enable a pair. | |
const entity & | enable () const |
Enable a pair. | |
const entity & | disable () const |
Disable an entity. | |
const entity & | disable (flecs::id_t id) const |
Disable an id. | |
const entity & | disable () const |
Disable a component. | |
const entity & | disable (flecs::id_t first, flecs::id_t second) const |
Disable a pair. | |
const entity & | disable (flecs::id_t second) const |
Disable a pair. | |
const entity & | disable () const |
Disable a pair. | |
const entity & | set_ptr (entity_t comp, size_t size, const void *ptr) const |
const entity & | set_ptr (entity_t comp, const void *ptr) const |
const entity & | set (T &&value) const |
const entity & | set (const T &value) const |
const entity & | set (A &&value) const |
const entity & | set (const A &value) const |
const entity & | set (A &&value) const |
Set a pair for an entity. | |
const entity & | set (const A &value) const |
Set a pair for an entity. | |
const entity & | set (Second second, const First &value) const |
Set a pair for an entity. | |
const entity & | set (Second second, First &&value) const |
Set a pair for an entity. | |
const entity & | set (Second constant, const First &value) const |
Set a pair for an entity. | |
const entity & | set_second (entity_t first, const Second &value) const |
Set a pair for an entity. | |
const entity & | set_second (entity_t first, Second &&value) const |
Set a pair for an entity. | |
const entity & | set_second (const Second &value) const |
const entity & | insert (const Func &func) const |
Set 1..N components. | |
const entity & | emplace (Args &&... args) const |
Emplace component. | |
const entity & | emplace (Args &&... args) const |
const entity & | emplace_first (flecs::entity_t second, Args &&... args) const |
const entity & | emplace_second (flecs::entity_t first, Args &&... args) const |
const entity & | with (const Func &func) const |
Entities created in function will have the current entity. | |
const entity & | with (const Func &func) const |
Entities created in function will have (First, this) . | |
const entity & | with (entity_t first, const Func &func) const |
Entities created in function will have (first, this) . | |
const entity & | scope (const Func &func) const |
The function will be ran with the scope set to the current entity. | |
scoped_world | scope () const |
Return world scoped to entity. | |
const entity & | set_name (const char *name) const |
const entity & | set_alias (const char *name) const |
const entity & | set_doc_name (const char *name) const |
Set human readable name. | |
const entity & | set_doc_brief (const char *brief) const |
Set brief description. | |
const entity & | set_doc_detail (const char *detail) const |
Set detailed description. | |
const entity & | set_doc_link (const char *link) const |
Set link to external documentation. | |
const entity & | set_doc_color (const char *color) const |
Set doc color. | |
const entity & | set_doc_uuid (const char *uuid) const |
Set doc UUID. | |
const entity & | observe (flecs::entity_t evt, Func &&callback) const |
Observe event on entity. | |
const entity & | observe (Func &&callback) const |
Observe event on entity. | |
const entity & | observe (Func &&callback) const |
Observe event on entity. | |
const entity & | set_json (flecs::id_t e, const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set component from JSON. | |
const entity & | set_json (flecs::entity_t r, flecs::entity_t t, const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set pair from JSON. | |
const entity & | set_json (const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set component from JSON. | |
const entity & | set_json (const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set pair from JSON. | |
const entity & | set_json (flecs::entity_t t, const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set pair from JSON. | |
const entity & | set_json_second (flecs::entity_t r, const char *json, flecs::from_json_desc_t *desc=nullptr) const |
Set pair from JSON. | |
entity_view () | |
entity_view (flecs::world_t *world, flecs::id_t id) | |
Wrap an existing entity id. | |
entity_view (entity_t id) | |
Implicit conversion from flecs::entity_t to flecs::entity_view. | |
Public Member Functions inherited from flecs::entity_view | |
entity_view (flecs::world_t *world, flecs::id_t id) | |
Wrap an existing entity id. | |
entity_view (entity_t id) | |
Implicit conversion from flecs::entity_t to flecs::entity_view. | |
entity_t | id () const |
Get entity id. | |
bool | is_valid () const |
Check if entity is valid. | |
operator bool () const | |
bool | is_alive () const |
Check if entity is alive. | |
flecs::string_view | name () const |
Return the entity name. | |
flecs::string_view | symbol () const |
Return the entity symbol. | |
flecs::string | path (const char *sep="::", const char *init_sep="::") const |
Return the entity path. | |
flecs::string | path_from (flecs::entity_t parent, const char *sep="::", const char *init_sep="::") const |
Return the entity path relative to a parent. | |
template<typename Parent > | |
flecs::string | path_from (const char *sep="::", const char *init_sep="::") const |
Return the entity path relative to a parent. | |
bool | enabled () const |
flecs::type | type () const |
Get the entity's type. | |
flecs::table | table () const |
Get the entity's table. | |
flecs::table_range | range () const |
Get table range for the entity. | |
template<typename Func > | |
void | each (const Func &func) const |
Iterate (component) ids of an entity. | |
template<typename Func > | |
void | each (flecs::id_t first, flecs::id_t second, const Func &func) const |
Iterate matching pair ids of an entity. | |
template<typename Func > | |
void | each (const flecs::entity_view &rel, const Func &func) const |
Iterate targets for a given relationship. | |
template<typename First , typename Func > | |
void | each (const Func &func) const |
Iterate targets for a given relationship. | |
template<typename Func > | |
void | children (flecs::entity_t rel, Func &&func) const |
Iterate children for entity. | |
template<typename Rel , typename Func > | |
void | children (Func &&func) const |
Iterate children for entity. | |
template<typename Func > | |
void | children (Func &&func) const |
Iterate children for entity. | |
template<typename T , if_t< is_actual< T >::value > = 0> | |
const T * | get () const |
Get component value. | |
template<typename T , typename A = actual_type_t<T>, if_t< flecs::is_pair< T >::value > = 0> | |
const A * | get () const |
Get component value. | |
template<typename First , typename Second , typename P = pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0> | |
const A * | get () const |
Get a pair. | |
template<typename First , typename Second , if_not_t< is_enum< Second >::value > = 0> | |
const First * | get (Second second) const |
Get a pair. | |
template<typename First , typename Second , if_t< is_enum< Second >::value > = 0> | |
const First * | get (Second constant) const |
Get a pair. | |
const void * | get (flecs::id_t comp) const |
Get component value (untyped). | |
const void * | get (flecs::entity_t first, flecs::entity_t second) const |
Get a pair (untyped). | |
template<typename Func , if_t< is_callable< Func >::value > = 0> | |
bool | get (const Func &func) const |
Get 1..N components. | |
template<typename T , if_t< is_enum< T >::value > = 0> | |
const T * | get () const |
Get enum constant. | |
template<typename Second > | |
const Second * | get_second (flecs::entity_t first) const |
Get the second part for a pair. | |
template<typename First , typename Second > | |
const Second * | get_second () const |
Get the second part for a pair. | |
template<typename T , if_t< is_actual< T >::value > = 0> | |
T * | get_mut () const |
Get mutable component value. | |
template<typename T , typename A = actual_type_t<T>, if_t< flecs::is_pair< T >::value > = 0> | |
A * | get_mut () const |
Get mutable component value. | |
template<typename First , typename Second , typename P = pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0> | |
A * | get_mut () const |
Get a mutable pair. | |
template<typename First , typename Second , if_not_t< is_enum< Second >::value > = 0> | |
First * | get_mut (Second second) const |
Get a mutable pair. | |
template<typename First , typename Second , if_t< is_enum< Second >::value > = 0> | |
First * | get_mut (Second constant) const |
Get a mutable pair. | |
void * | get_mut (flecs::id_t comp) const |
Get mutable component value (untyped). | |
void * | get_mut (flecs::entity_t first, flecs::entity_t second) const |
Get a mutable pair (untyped). | |
template<typename Second > | |
Second * | get_mut_second (flecs::entity_t first) const |
Get the second part for a pair. | |
template<typename First , typename Second > | |
Second * | get_mut_second () const |
Get the second part for a pair. | |
template<typename First > | |
flecs::entity | target (int32_t index=0) const |
Get target for a given pair. | |
flecs::entity | target (flecs::entity_t first, int32_t index=0) const |
Get target for a given pair. | |
flecs::entity | target_for (flecs::entity_t relationship, flecs::id_t id) const |
Get the target of a pair for a given relationship id. | |
template<typename T > | |
flecs::entity | target_for (flecs::entity_t relationship) const |
template<typename First , typename Second > | |
flecs::entity | target_for (flecs::entity_t relationship) const |
int32_t | depth (flecs::entity_t rel) const |
Get depth for given relationship. | |
template<typename Rel > | |
int32_t | depth () const |
Get depth for given relationship. | |
flecs::entity | parent () const |
Get parent of entity. | |
flecs::entity | lookup (const char *path, bool search_path=false) const |
Lookup an entity by name. | |
bool | has (flecs::id_t e) const |
Check if entity has the provided entity. | |
template<typename T > | |
bool | has () const |
Check if entity has the provided component. | |
template<typename E , if_t< is_enum< E >::value > = 0> | |
bool | has (E value) const |
Check if entity has the provided enum constant. | |
template<typename First , typename Second > | |
bool | has () const |
Check if entity has the provided pair. | |
template<typename First , typename Second , if_not_t< is_enum< Second >::value > = 0> | |
bool | has (Second second) const |
Check if entity has the provided pair. | |
template<typename Second > | |
bool | has_second (flecs::entity_t first) const |
Check if entity has the provided pair. | |
template<typename First , typename E , if_t< is_enum< E >::value > = 0> | |
bool | has (E value) const |
Check if entity has the provided pair. | |
bool | has (flecs::id_t first, flecs::id_t second) const |
Check if entity has the provided pair. | |
bool | owns (flecs::id_t e) const |
Check if entity owns the provided entity. | |
template<typename First > | |
bool | owns (flecs::id_t second) const |
Check if entity owns the provided pair. | |
bool | owns (flecs::id_t first, flecs::id_t second) const |
Check if entity owns the provided pair. | |
template<typename T > | |
bool | owns () const |
Check if entity owns the provided component. | |
template<typename First , typename Second > | |
bool | owns () const |
Check if entity owns the provided pair. | |
bool | enabled (flecs::id_t id) const |
Test if id is enabled. | |
template<typename T > | |
bool | enabled () const |
Test if component is enabled. | |
bool | enabled (flecs::id_t first, flecs::id_t second) const |
Test if pair is enabled. | |
template<typename First > | |
bool | enabled (flecs::id_t second) const |
Test if pair is enabled. | |
template<typename First , typename Second > | |
bool | enabled () const |
Test if pair is enabled. | |
flecs::entity | clone (bool clone_value=true, flecs::entity_t dst_id=0) const |
flecs::entity | mut (const flecs::world &stage) const |
Return mutable entity handle for current stage When an entity handle created from the world is used while the world is in staged mode, it will only allow for readonly operations since structural changes are not allowed on the world while in staged mode. | |
flecs::entity | mut (const flecs::iter &it) const |
Same as mut(world), but for iterator. | |
flecs::entity | mut (const flecs::entity_view &e) const |
Same as mut(world), but for entity. | |
int32_t | alert_count (flecs::entity_t alert=0) const |
Return number of alerts for entity. | |
const char * | doc_name () const |
Get human readable name. | |
const char * | doc_brief () const |
Get brief description. | |
const char * | doc_detail () const |
Get detailed description. | |
const char * | doc_link () const |
Get link to external documentation. | |
const char * | doc_color () const |
Get color. | |
const char * | doc_uuid () const |
Get UUID. | |
template<typename E > | |
E | to_constant () const |
Convert entity to enum constant. | |
void | emit (flecs::entity_t evt) const |
Emit event for entity. | |
void | emit (flecs::entity evt) const |
Emit event for entity. | |
template<typename Evt , if_t< is_empty< Evt >::value > = 0> | |
void | emit () const |
Emit event for entity. | |
template<typename Evt , if_not_t< is_empty< Evt >::value > = 0> | |
void | emit (const Evt &payload) const |
Emit event with payload for entity. | |
void | enqueue (flecs::entity_t evt) const |
Enqueue event for entity. | |
void | enqueue (flecs::entity evt) const |
Enqueue event for entity. | |
template<typename Evt , if_t< is_empty< Evt >::value > = 0> | |
void | enqueue () const |
Enqueue event for entity. | |
template<typename Evt , if_not_t< is_empty< Evt >::value > = 0> | |
void | enqueue (const Evt &payload) const |
Enqueue event with payload for entity. | |
flecs::string | to_json (const flecs::entity_to_json_desc_t *desc=nullptr) const |
Serialize entity to JSON. | |
const Self & | unit (const char *symbol, flecs::entity_t prefix=0, flecs::entity_t base=0, flecs::entity_t over=0, int32_t factor=0, int32_t power=0) const |
Make entity a unit. | |
Public Member Functions inherited from flecs::id | |
id (flecs::id_t value) | |
id (flecs::world_t *world, flecs::id_t value=0) | |
id (flecs::world_t *world, flecs::id_t first, flecs::id_t second) | |
id (flecs::world_t *world, const char *expr) | |
id (flecs::id_t first, flecs::id_t second) | |
id (const flecs::id &first, const flecs::id &second) | |
bool | is_pair () const |
Test if id is pair (has first, second) | |
bool | is_wildcard () const |
Test if id is a wildcard. | |
bool | is_entity () const |
Test if id is entity. | |
flecs::entity | entity () const |
Return id as entity (only allowed when id is valid entity) | |
flecs::entity | add_flags (flecs::id_t flags) const |
Return id with role added. | |
flecs::entity | remove_flags (flecs::id_t flags) const |
Return id with role removed. | |
flecs::entity | remove_flags () const |
Return id without role. | |
flecs::entity | remove_generation () const |
Return id without role. | |
flecs::entity | type_id () const |
Return component type of id. | |
bool | has_flags (flecs::id_t flags) const |
Test if id has specified role. | |
bool | has_flags () const |
Test if id has any role. | |
flecs::entity | flags () const |
Return id flags set on id. | |
bool | has_relation (flecs::id_t first) const |
Test if id has specified first. | |
flecs::entity | first () const |
Get first element from a pair. | |
flecs::entity | second () const |
Get second element from a pair. | |
flecs::string | str () const |
flecs::string | flags_str () const |
Convert role of id to string. | |
flecs::id_t | raw_id () const |
Return flecs::id_t value. | |
operator flecs::id_t () const | |
flecs::world | world () const |
untyped_component & | member (flecs::entity_t type_id, flecs::entity_t unit, const char *name, int32_t count=0) |
Add member with unit. | |
untyped_component & | member (flecs::entity_t type_id, flecs::entity_t unit, const char *name, int32_t count, size_t offset) |
Add member with unit, count and offset. | |
untyped_component & | member (flecs::entity_t type_id, const char *name, int32_t count=0) |
Add member. | |
untyped_component & | member (flecs::entity_t type_id, const char *name, int32_t count, size_t offset) |
Add member with count and offset. | |
template<typename MemberType > | |
untyped_component & | member (const char *name, int32_t count=0) |
Add member. | |
template<typename MemberType > | |
untyped_component & | member (const char *name, int32_t count, size_t offset) |
Add member. | |
template<typename MemberType > | |
untyped_component & | member (flecs::entity_t unit, const char *name, int32_t count=0) |
Add member with unit. | |
template<typename MemberType > | |
untyped_component & | member (flecs::entity_t unit, const char *name, int32_t count, size_t offset) |
Add member with unit. | |
template<typename MemberType , typename UnitType > | |
untyped_component & | member (const char *name, int32_t count=0) |
Add member with unit. | |
template<typename MemberType , typename UnitType > | |
untyped_component & | member (const char *name, int32_t count, size_t offset) |
Add member with unit. | |
template<typename MemberType , typename ComponentType , typename RealType = typename std::remove_extent<MemberType>::type> | |
untyped_component & | member (const char *name, const MemberType ComponentType::*ptr) |
Add member using pointer-to-member. | |
template<typename MemberType , typename ComponentType , typename RealType = typename std::remove_extent<MemberType>::type> | |
untyped_component & | member (flecs::entity_t unit, const char *name, const MemberType ComponentType::*ptr) |
Add member with unit using pointer-to-member. | |
template<typename UnitType , typename MemberType , typename ComponentType , typename RealType = typename std::remove_extent<MemberType>::type> | |
untyped_component & | member (const char *name, const MemberType ComponentType::*ptr) |
Add member with unit using pointer-to-member. | |
untyped_component & | constant (const char *name, int32_t value) |
Add constant. | |
untyped_component & | bit (const char *name, uint32_t value) |
Add bitmask constant. | |
template<typename Elem > | |
untyped_component & | array (int32_t elem_count) |
Register array metadata for component. | |
untyped_component & | range (double min, double max) |
Add member value range. | |
untyped_component & | warning_range (double min, double max) |
Add member warning range. | |
untyped_component & | error_range (double min, double max) |
Add member error range. | |
Additional Inherited Members | |
Static Public Member Functions inherited from flecs::entity | |
static flecs::entity | null (const flecs::world_t *world) |
Entity id 0. | |
static flecs::entity | null () |
Protected Member Functions inherited from flecs::entity_builder< entity > | |
const entity & | to_base () const |
Protected Attributes inherited from flecs::id | |
flecs::world_t * | world_ |
flecs::id_t | id_ |
Related Symbols inherited from flecs::entity_view | |
const Self & | unit (flecs::entity_t prefix=0, flecs::entity_t base=0, flecs::entity_t over=0, int32_t factor=0, int32_t power=0) const |
Make entity a derived unit. | |
const Self & | unit_prefix (const char *symbol, int32_t factor=0, int32_t power=0) const |
Make entity a derived unit. | |
const Self & | quantity (flecs::entity_t quantity) const |
Add quantity to unit. | |
template<typename Quantity > | |
const Self & | quantity () const |
Make entity a unity prefix. | |
const Self & | quantity () const |
Make entity a quantity. | |
Component class.
Class used to register components and component metadata.
Definition at line 367 of file component.hpp.
|
inline |
Register a component.
If the component was already registered, this operation will return a handle to the existing component.
world | The world for which to register the component. |
name | Optional name (overrides typename). |
allow_tag | If true, empty types will be registered with size 0. |
id | Optional id to register component with. |
Definition at line 377 of file component.hpp.
|
inline |
Register on_add hook.
Definition at line 448 of file component.hpp.
|
inline |
Register on_remove hook.
Definition at line 463 of file component.hpp.
|
inline |
Register on_set hook.
Definition at line 479 of file component.hpp.