ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
Imago::ECS::SurveyHandle< Components >::Iterator Class Reference

Public Member Functions

 Iterator (const std::vector< Entity > *entities, size_t index, const std::array< SparseSetBase *, sizeof...(Components)> *pools)
 Construct a new Iterator object.
Entity operator* () const
 Dereference the iterator to access the current element.
Iterator & operator++ ()
 Advances the Iterator to the next element, skipping indices that represent Entities not in every pool.
bool operator!= (const Iterator &other) const
 Checks whether two iterators point to different positions.

Constructor & Destructor Documentation

◆ Iterator()

template<typename... Components>
Imago::ECS::SurveyHandle< Components >::Iterator::Iterator ( const std::vector< Entity > * entities,
size_t index,
const std::array< SparseSetBase *, sizeof...(Components)> * pools )
inline

Construct a new Iterator object.

Parameters
entitiesthe smallest pool of entitites in the Survey
indexwhere this specific Iterator points to at construction
poolsthe pools in the Survey

Member Function Documentation

◆ operator!=()

template<typename... Components>
bool Imago::ECS::SurveyHandle< Components >::Iterator::operator!= ( const Iterator & other) const
inline

Checks whether two iterators point to different positions.

Parameters
otherIterator to compare against.
Returns
true if the Iterators refer to different positions.
false if the Iterators refer to the same position.

◆ operator*()

template<typename... Components>
Entity Imago::ECS::SurveyHandle< Components >::Iterator::operator* ( ) const
inline

Dereference the iterator to access the current element.

Returns
The Entity that is at the current index

◆ operator++()

template<typename... Components>
Iterator & Imago::ECS::SurveyHandle< Components >::Iterator::operator++ ( )
inline

Advances the Iterator to the next element, skipping indices that represent Entities not in every pool.

Returns
Reference to the Iterator after going to the next element.

The documentation for this class was generated from the following file: