Nui Engine
A game engine framework
Loading...
Searching...
No Matches
Nui::ECS::Internal::EntityIterator Class Reference

Iterator class to allow easy iteration over entities. More...

#include <Entity.h>

Public Member Functions

 EntityIterator (Context *context, U64 index, bool isEnd, bool includePendingDestroy)
 Initializes the iterator with necessary information.
 
bool IsEnd () const noexcept
 Checks if the iterator is at the end.
 
U64 GetIndex () const noexcept
 Gets the index of the current entity in the iteration.
 
bool IncludePendingDestroy () const noexcept
 Whether the iterator should include pending destruction entities.
 
ContextGetContext () const noexcept
 Gets the ECS context associated with the iterator.
 
EntityGetEntity () const noexcept
 Gets the current entity held by the iterator.
 
Entityoperator* () const noexcept
 Gets the current entity held by the iterator.
 
bool operator== (const EntityIterator &other) const
 Checks if two iterators are equal.
 
bool operator!= (const EntityIterator &other) const
 Checks if two iterators are not equal.
 
EntityIteratoroperator++ ()
 Moves the iterator to the next entity and skips over entities based on input criteria.
 

Detailed Description

Iterator class to allow easy iteration over entities.

Constructor & Destructor Documentation

◆ EntityIterator()

Nui::ECS::Internal::EntityIterator::EntityIterator ( Context * context,
U64 index,
bool isEnd,
bool includePendingDestroy )
inline

Initializes the iterator with necessary information.

Parameters
contextPointer to the ECS Context
indexStarting index for iteration
isEndFlag indicating if the iterator is at the end
includePendingDestroyFlag indicating if the iterator should include pending destruction entities

Member Function Documentation

◆ GetContext()

Context * Nui::ECS::Internal::EntityIterator::GetContext ( ) const
inlinenoexcept

Gets the ECS context associated with the iterator.

Returns
Pointer to the ECS context

◆ GetEntity()

Entity * Nui::ECS::Internal::EntityIterator::GetEntity ( ) const
inlinenoexcept

Gets the current entity held by the iterator.

Returns
Pointer to the current entity

◆ GetIndex()

U64 Nui::ECS::Internal::EntityIterator::GetIndex ( ) const
inlinenoexcept

Gets the index of the current entity in the iteration.

Returns
Index of the current entity

◆ IncludePendingDestroy()

bool Nui::ECS::Internal::EntityIterator::IncludePendingDestroy ( ) const
inlinenoexcept

Whether the iterator should include pending destruction entities.

Returns
True if the iterator should include pending destruction entities

◆ IsEnd()

bool Nui::ECS::Internal::EntityIterator::IsEnd ( ) const
inlinenoexcept

Checks if the iterator is at the end.

Returns
True if the iterator is at the end

◆ operator!=()

bool Nui::ECS::Internal::EntityIterator::operator!= ( const EntityIterator & other) const
inline

Checks if two iterators are not equal.

Parameters
otherOther iterator
Returns
True if the iterators are not equal

◆ operator*()

Entity * Nui::ECS::Internal::EntityIterator::operator* ( ) const
inlinenoexcept

Gets the current entity held by the iterator.

Returns
Pointer to the current entity

◆ operator++()

Internal::EntityIterator & Nui::ECS::Internal::EntityIterator::operator++ ( )
inline

Moves the iterator to the next entity and skips over entities based on input criteria.

Returns
Reference to the iterator

◆ operator==()

bool Nui::ECS::Internal::EntityIterator::operator== ( const EntityIterator & other) const
inline

Checks if two iterators are equal.

Parameters
otherOther iterator
Returns
True if the iterators are equal

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