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 "krpch.h"
13
14#include "KarmaUtilities.h"
15
16namespace Karma
17{
18 class AActor;
19
26 class FActorIterator : public TActorIteratorBase<FActorIterator>
27 {
34
41
42 public:
52 : Super(InWorld, AActor::StaticClass(), InFlags)
53 {
54 ++(*this);
55 }
56
68 : Super(InWorld, InClass, InFlags)
69 {
70 ++(*this);
71 }
72 };
73
85 template <typename ActorType>
86 class TActorIterator : public TActorIteratorBase<TActorIterator<ActorType>>
87 {
90
91 public:
103 : Super(InWorld, InClass, InFlags)
104 {
105 ++(*this);
106 }
107
114 : Super(EActorIteratorType::End)
115 {
116 }
117
124 FORCEINLINE ActorType* operator*() const
125 {
126 return CastChecked<ActorType>(**static_cast<const Super*>(this));
127 }
128
135 FORCEINLINE ActorType* operator->() const
136 {
137 return **this;
138 }
139 };
140}
#define FORCEINLINE
Typical inlining macro for clarity.
Definition Core.h:157
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:228
@ SkipPendingKill
Skip pending kill actors.
Definition KarmaUtilities.h:236
@ OnlyActiveLevels
Only iterate active levels.
Definition KarmaUtilities.h:244
EActorIteratorType
Type enum, used to represent the special End iterator.
Definition KarmaUtilities.h:251
FORCEINLINE T * CastChecked(const U &Src, ECastCheckedType::Type CheckType=ECastCheckedType::NullChecked)
Definition UObjectGlobals.h:704
Actor is the base class for an object that can be placed or spawned in a level.
Definition Actor.h:34
FActorIterator(const UWorld *InWorld, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
A Constructor.
Definition ActorIterator.h:51
FActorIterator(const UWorld *InWorld, const TSubclassOf< AActor > InClass, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
A Constructor.
Definition ActorIterator.h:67
TActorIteratorBase(EActorIteratorType)
Definition KarmaUtilities.h:276
TActorIterator(EActorIteratorType)
Constructor for creating an end iterator.
Definition ActorIterator.h:113
FORCEINLINE ActorType * operator->() const
Returns the current suitable actor pointed at by the Iterator.
Definition ActorIterator.h:135
TActorIterator(const UWorld *InWorld, TSubclassOf< AActor > InClass=ActorType::StaticClass(), EActorIteratorFlags InFlags=EActorIteratorFlags(EActorIteratorFlags::OnlyActiveLevels|EActorIteratorFlags::SkipPendingKill))
A Constructor.
Definition ActorIterator.h:102
FORCEINLINE ActorType * operator*() const
Returns the current suitable actor pointed at by the Iterator.
Definition ActorIterator.h:124
Template to allow TClassType's to be passed around with type safety.
Definition SubClassOf.h:119
The World is the top level object representing a map or a sandbox in which Actors and Components will...
Definition World.h:150