KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::TActorIteratorBase< Derived > Class Template Reference

Template class used to filter actors by certain characteristics. More...

#include <KarmaUtilities.h>

Public Member Functions

void operator++ ()
 Iterates to next suitable actor.
 
FORCEINLINE AActoroperator* () const
 Returns the current suitable actor pointed at by the Iterator.
 
FORCEINLINE AActoroperator-> () const
 Returns the current suitable actor pointed at by the Iterator.
 
FORCEINLINE operator bool () const
 Returns whether the iterator has reached the end and no longer points to a suitable actor.
 
void ClearCurrent ()
 Clears the current Actor in the array (setting it to NULL).
 
int32 GetProgressNumerator () const
 Returns the number of actors considered thus far. Can be used in combination with GetProgressDenominator to gauge progress iterating over all actors.
 
FORCEINLINE bool CanIterateLevel (const ULevel *Level) const
 Used to examine whether this level is valid for iteration or not. This function should be redefined (thus hiding this one) in a derived class if it wants special level filtering.
 
FORCEINLINE bool IsActorSuitable (const AActor *Actor) const
 Determines whether this is a valid actor or not. This function should be redefined (thus hiding this one) in a derived class if it wants special actor filtering.
 

Protected Member Functions

 TActorIteratorBase (EActorIteratorType)
 A constructor.
 
 TActorIteratorBase (const UWorld *InWorld, TSubclassOf< AActor > InClass, const EActorIteratorFlags InFlags)
 Constructor for setting m_State (FActorIteratorState) with the supplied InWorld and InClass.
 

Detailed Description

template<typename Derived>
class Karma::TActorIteratorBase< Derived >

Template class used to filter actors by certain characteristics.

Constructor & Destructor Documentation

◆ TActorIteratorBase() [1/2]

template<typename Derived>
Karma::TActorIteratorBase< Derived >::TActorIteratorBase ( EActorIteratorType )
inlineprotected

A constructor.

Parameters
EActorIteratorTypeSpecify the iterator flag from EActorIteratorFlags
Note
Hide the constructors as construction on this class should only be done by subclasses
Since
Karma 1.0.0

◆ TActorIteratorBase() [2/2]

template<typename Derived>
Karma::TActorIteratorBase< Derived >::TActorIteratorBase ( const UWorld * InWorld,
TSubclassOf< AActor > InClass,
const EActorIteratorFlags InFlags )
inlineprotected

Constructor for setting m_State (FActorIteratorState) with the supplied InWorld and InClass.

Parameters
InWorldThe UWorld we would like to do the iteration within
InClassThe class type we are iterating, kept for filtering
InFlagsSpecify the iterator flag from EActorIteratorFlags
Since
Karma 1.0.0

Member Function Documentation

◆ CanIterateLevel()

template<typename Derived>
FORCEINLINE bool Karma::TActorIteratorBase< Derived >::CanIterateLevel ( const ULevel * Level) const
inline

Used to examine whether this level is valid for iteration or not. This function should be redefined (thus hiding this one) in a derived class if it wants special level filtering.

Parameters
Levelthe level to check for iteration
Returns
true if the level can be iterated, false otherwise
Since
Karma 1.0.0

◆ ClearCurrent()

template<typename Derived>
void Karma::TActorIteratorBase< Derived >::ClearCurrent ( )
inline

Clears the current Actor in the array (setting it to NULL).

Since
Karma 1.0.0

◆ GetProgressNumerator()

template<typename Derived>
int32 Karma::TActorIteratorBase< Derived >::GetProgressNumerator ( ) const
inline

Returns the number of actors considered thus far. Can be used in combination with GetProgressDenominator to gauge progress iterating over all actors.

Returns
number of actors considered thus far.
Since
Karma 1.0.0

◆ IsActorSuitable()

template<typename Derived>
FORCEINLINE bool Karma::TActorIteratorBase< Derived >::IsActorSuitable ( const AActor * Actor) const
inline

Determines whether this is a valid actor or not. This function should be redefined (thus hiding this one) in a derived class if it wants special actor filtering.

Parameters
ActorActor to check
Returns
true
Since
Karma 1.0.0

◆ operator bool()

template<typename Derived>
FORCEINLINE Karma::TActorIteratorBase< Derived >::operator bool ( ) const
inlineexplicit

Returns whether the iterator has reached the end and no longer points to a suitable actor.

Returns
true if iterator points to a suitable actor, false if it has reached the end
Since
Karma 1.0.0

◆ operator*()

template<typename Derived>
FORCEINLINE AActor * Karma::TActorIteratorBase< Derived >::operator* ( ) const
inline

Returns the current suitable actor pointed at by the Iterator.

Returns
Current suitable actor
Since
Karma 1.0.0

◆ operator++()

template<typename Derived>
void Karma::TActorIteratorBase< Derived >::operator++ ( )
inline

Iterates to next suitable actor.

The pseudo code is chalked out in the wiki page https://github.com/ravimohan1991/KarmaEngine/wiki/Karma's-Actor-Iteration-Process

Since
Karma 1.0.0

◆ operator->()

template<typename Derived>
FORCEINLINE AActor * Karma::TActorIteratorBase< Derived >::operator-> ( ) const
inline

Returns the current suitable actor pointed at by the Iterator.

Returns
Current suitable actor
Since
Karma 1.0.0

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