23 return flecs::id(iter_->world, iter_->event_id);
33 ecs_assert(row <
static_cast<size_t>(iter_->count),
69 return flecs::table(iter_->real_world, iter_->other_table);
75 iter_->offset, iter_->count);
79template <
typename T,
typename A, if_t< is_const_v<T> >>
83 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
84 _::type_name<T>(), index);
85 return get_field<A>(index);
89template <
typename T,
typename A, if_not_t< is_const_v<T> >>
93 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
94 _::type_name<T>(), index);
97 return get_field<A>(index);
118template <
typename Func>
125 int32_t i = tr->index,
end = i + tr->count;
126 for (; i <
end; i ++) {
129 "field does not match a pair");
131 ecs_pair_second(iter_->real_world,
id));
#define ecs_assert(condition, error_code,...)
Assert.
#define ECS_ACCESS_VIOLATION
Access violation error code.
#define ECS_INVALID_OPERATION
Invalid operation error code.
#define ECS_INVALID_PARAMETER
Invalid parameter error code.
#define ECS_COLUMN_INDEX_OUT_OF_RANGE
Column index out of range error code.
#define ecs_check(condition, error_code,...)
Check.
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
ecs_query_t query_t
Query type.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int8_t index)
Return the field source.
bool ecs_field_is_readonly(const ecs_iter_t *it, int8_t index)
Test whether the field is read-only.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int8_t index)
Return the ID matched for a field.
bool ecs_field_is_set(const ecs_iter_t *it, int8_t index)
Test whether a field is set.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get the value of an iterator variable as an entity.
int32_t ecs_query_find_var(const ecs_query_t *query, const char *name)
Find a variable index.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get the type for a table.
ecs_flags32_t flags
Iterator flags.
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 the ID matched for the field.
flecs::field< A > field(int8_t index) const
Get read-only access to field data.
flecs::entity event() const
Get the event entity associated with the iterator.
flecs::table table() const
Get the table for the current iterator result.
flecs::type type() const
Get the type of the iterated table.
int32_t field_count() const
Number of fields in the iterator.
row_iterator end() const
Get an iterator to the end of the entity range.
flecs::table other_table() const
Get the other table for the current iterator result.
flecs::entity entity(size_t row) const
Obtain a mutable handle to the entity being iterated over.
flecs::id pair(int8_t index) const
Obtain the pair ID matched for the field.
flecs::id event_id() const
Get the event ID associated with the iterator.
flecs::entity get_var(int var_id) const
Get value of variable by ID.
flecs::table_range range() const
Get the table range for the current iterator result.
void targets(int8_t index, const Func &func)
Iterate targets for pair field.
flecs::entity src(int8_t index) const
Obtain the field source (0 if This).
flecs::world world() const
Get the world associated with the iterator.
flecs::entity system() const
Get the system entity associated with the iterator.