20 int32_t power = 0)
const
41 int32_t power = 0)
const
59 int32_t power = 0)
const
78template <
typename Quantity>
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.
ecs_entity_t entity_t
Entity type.
#define ecs_add_pair(world, subject, first, second)
Add a pair to an entity.
Used with ecs_unit_init().
ecs_entity_t base
Base unit, e.g., "meters" (optional).
ecs_entity_t over
Over unit, e.g., "per second" (optional).
const char * symbol
Unit symbol, e.g., "m", "%", "g".
ecs_entity_t prefix
Prefix indicating order of magnitude relative to the derived unit.
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
ecs_entity_t entity
Existing entity to associate with unit (optional).
Used with ecs_unit_prefix_init().
ecs_entity_t entity
Existing entity to associate with unit prefix (optional).
const char * symbol
Unit prefix symbol, e.g., "K", "M", "Ki".
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
int32_t power
Power to apply to factor (e.g., "1", "3", "-9").
int32_t factor
Factor to apply (e.g., "1000", "1000000", "1024").
const Self & quantity(flecs::entity_t quantity) const
Add a quantity to a unit.
const Self & quantity() const
Make an entity a quantity.
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 an entity a derived unit.
const Self & unit_prefix(const char *symbol, int32_t factor=0, int32_t power=0) const
Make an entity a unit prefix.
const Self & quantity() const
Add a quantity to a unit.
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 an entity a unit.
flecs::string_view symbol() const
Return the entity symbol.
flecs::id_t id_
The raw ID value.