29 ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
43 ecs_check(ECS_HAS_ID_FLAG(
id, PAIR), ECS_INVALID_PARAMETER, NULL);
66template <
typename T,
typename A,
67 typename std::enable_if<std::is_const<T>::value,
void>::type*>
70 "cannot .field from .each, use .field_at<const %s>(%d, row) instead",
71 _::type_name<T>(), index);
72 return get_field<A>(index);
75template <
typename T,
typename A,
76 typename std::enable_if<
77 std::is_const<T>::value ==
false,
void>::type*>
80 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
81 _::type_name<T>(), index);
83 ECS_ACCESS_VIOLATION, NULL);
84 return get_field<A>(index);
88 ecs_assert(var_id != -1, ECS_INVALID_PARAMETER, 0);
96 ecs_query_iter_t *qit = &iter_->
priv_.iter.query;
99 ecs_assert(var_id != -1, ECS_INVALID_PARAMETER, name);
103template <
typename Func>
111 for (; i < end; i ++) {
113 ecs_assert(ECS_IS_PAIR(
id), ECS_INVALID_PARAMETER,
114 "field does not match a pair");
#define ecs_assert(condition, error_code,...)
Assert.
#define ecs_check(condition, error_code,...)
Check.
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int8_t index)
Return field source.
bool ecs_field_is_readonly(const ecs_iter_t *it, int8_t index)
Test whether the field is readonly.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int8_t index)
Return id matched for field.
bool ecs_field_is_set(const ecs_iter_t *it, int8_t index)
Test whether field is set.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as entity.
int32_t ecs_query_find_var(const ecs_query_t *query, const char *name)
Find variable index.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
ecs_world_t * real_world
Actual world.
ecs_entity_t event
The event (if applicable)
ecs_flags32_t flags
Iterator flags.
ecs_table_t * table
Current table.
int32_t offset
Offset relative to current table.
ecs_id_t event_id
The (component) id for the event.
ecs_iter_private_t priv_
Private data.
ecs_world_t * world
The world.
ecs_entity_t system
The system (if applicable)
ecs_table_t * other_table
Prev or next table when adding/removing.
const ecs_table_record_t ** trs
Info on where to find field in table.
int32_t count
Number of entities to iterate.
const ecs_entity_t * entities
Entity identifiers.
Queries are lists of constraints (terms) that match entities.
Metadata describing where a component id is stored in a table.
int16_t index
First type index where id occurs in table.
int16_t count
Number of times id occurs in table.
A type is a list of (component) ids.
ecs_id_t * array
Array with ids.
Wrapper class around a field.
Class that wraps around a flecs::id_t.
flecs::id id(int8_t index) const
Obtain id matched for field.
flecs::field< A > field(int8_t index) const
Get readonly access to field data.
int32_t field_count() const
Number of fields in iterator.
flecs::entity entity(size_t row) const
Obtain mutable handle to entity being iterated over.
flecs::id pair(int8_t index) const
Obtain pair id matched for field.
flecs::entity get_var(int var_id) const
Get value of variable by id.
void targets(int8_t index, const Func &func)
Iterate targets for pair field.
flecs::entity src(int8_t index) const
Obtain field source (0 if This).