Class EntityQuery

Class Documentation

class legion::core::ecs::EntityQuery

Handle to an entity query. Allows you to acquire a list all of entities with a certain component combination.

Public Functions

EntityQuery(id_type id, QueryRegistry *registry, EcsRegistry *ecsRegistry)
EntityQuery() = default
~EntityQuery()
EntityQuery(EntityQuery &&other)
EntityQuery(const EntityQuery &other)
EntityQuery operator=(EntityQuery &&other)
EntityQuery operator=(const EntityQuery &other)
component_container_base &get(id_type componentTypeId)
template<typename component_type>
inline component_container<component_type> &get()
void submit(id_type componentTypeId)
template<typename component_type>
inline void submit()
void queryEntities()

Update the local copy of the entity list according to the query.

entity_container::const_iterator begin() const

Get begin iterator for entity handles to the queried entities.

entity_container::const_iterator end() const

Get end iterator for entity handles to the queried entities.

inline id_type id()

Get query id.

template<typename archetype>
inline void addArchetype()
template<typename component_type>
inline void addComponentType()

Add component type to query for.

Template Parameters
  • component_type:

template<class archetype, std::size_t N = std::tuple_size<archetype>::value, typename Indicies = std::make_index_sequence<N>>
inline void addArchetype()
template<class archetype, std::size_t... I>
inline void addArchetypeEnumerated(std::index_sequence<I...>)
void addComponentType(id_type componentTypeId)

Add component type to query for.

Parameters
  • componentTypeId:

template<typename component_type>
inline void removeComponentType()

Remove component type to query for.

Template Parameters
  • component_type:

void removeComponentType(id_type componentTypeId)

Remove component type to query for.

Parameters
  • componentTypeId:

entity_handle operator[](size_type index)

Get entity handle at a certain index in the entity list.

size_type size()

Get amount of entities that were found with the queried component types.