KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
ActorIterator.h
Go to the documentation of this file.
10#pragma once
11
12#include "KarmaUtilities.h"
13
14namespace Karma
15{
16 class AActor;
17
24 class FActorIterator : public TActorIteratorBase<FActorIterator>
25 {
32
39
40 public:
50 : Super(InWorld, AActor::StaticClass(), InFlags)
51 {
52 ++(*this);
53 }
54
66 : Super(InWorld, InClass, InFlags)
67 {
68 ++(*this);
69 }
70 };
71
83 template <typename ActorType>
84 class TActorIterator : public TActorIteratorBase<TActorIterator<ActorType>>
85 {
88
89 public:
101 : Super(InWorld, InClass, InFlags)
102 {
103 ++(*this);
104 }
105
112 : Super(EActorIteratorType::End)
113 {
114 }
115
122 FORCEINLINE ActorType* operator*() const
123 {
124 return CastChecked<ActorType>(**static_cast<const Super*>(this));
125 }
126
133 FORCEINLINE ActorType* operator->() const
134 {
135 return **this;
136 }
137 };
138}
#define FORCEINLINE
Typical inlining macro for clarity.
Definition Core.h:170
This file contains various classes and functions for various Karma's utilities.
EActorIteratorFlags
Iteration flags, specifies which types of levels and actors should be iterated.
Definition KarmaUtilities.h:227
@ SkipPendingKill
Skip pending kill actors.
Definition KarmaUtilities.h:235
@ OnlyActiveLevels
Only iterate active levels.
Definition KarmaUtilities.h:243
EActorIteratorType
Type enum, used to represent the special End iterator.
Definition KarmaUtilities.h:250
FORCEINLINE T * CastChecked(const U &Src, ECastCheckedType::Type CheckType=ECastCheckedType::NullChecked)
Definition UObjectGlobals.h:706
Actor is the base class for an object that can be placed or spawned in a level.
Definition Actor.h:35
FActorIterator(const UWorld *InWorld, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
A Constructor.
Definition ActorIterator.h:49
FActorIterator(const UWorld *InWorld, const TSubclassOf< AActor > InClass, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
A Constructor.
Definition ActorIterator.h:65
TActorIteratorBase(EActorIteratorType)
Definition KarmaUtilities.h:275
TActorIterator(EActorIteratorType)
Constructor for creating an end iterator.
Definition ActorIterator.h:111
FORCEINLINE ActorType * operator->() const
Returns the current suitable actor pointed at by the Iterator.
Definition ActorIterator.h:133
TActorIterator(const UWorld *InWorld, TSubclassOf< AActor > InClass=ActorType::StaticClass(), EActorIteratorFlags InFlags=EActorIteratorFlags(EActorIteratorFlags::OnlyActiveLevels|EActorIteratorFlags::SkipPendingKill))
A Constructor.
Definition ActorIterator.h:100
FORCEINLINE ActorType * operator*() const
Returns the current suitable actor pointed at by the Iterator.
Definition ActorIterator.h:122
Template to allow TClassType's to be passed around with type safety.
Definition SubClassOf.h:117
The World is the top level object representing a map or a sandbox in which Actors and Components will...
Definition World.h:148