Karma Engine
Loading...
Searching...
No Matches
ActorIterator.h
1#pragma once
2
3#include "krpch.h"
4
5#include "KarmaUtilities.h"
6
7namespace Karma
8{
9 class AActor;
10
15 class FActorIterator : public TActorIteratorBase<FActorIterator>
16 {
19
20 public:
27 explicit FActorIterator(const UWorld* InWorld, const EActorIteratorFlags InFlags = EActorIteratorFlags(OnlyActiveLevels | SkipPendingKill))
28 : Super(InWorld, AActor::StaticClass(), InFlags)
29 {
30 ++(*this);
31 }
32
40 explicit FActorIterator(const UWorld* InWorld, const TSubclassOf<AActor> InClass, const EActorIteratorFlags InFlags = EActorIteratorFlags(OnlyActiveLevels | SkipPendingKill))
41 : Super(InWorld, InClass, InFlags)
42 {
43 ++(*this);
44 }
45 };
46
50 template <typename ActorType>
51 class TActorIterator : public TActorIteratorBase<TActorIterator<ActorType>>
52 {
55
56 public:
64 explicit TActorIterator(const UWorld* InWorld, TSubclassOf<AActor> InClass = ActorType::StaticClass(), EActorIteratorFlags InFlags = EActorIteratorFlags(EActorIteratorFlags::OnlyActiveLevels | EActorIteratorFlags::SkipPendingKill))
65 : Super(InWorld, InClass, InFlags)
66 {
67 ++(*this);
68 }
69
73 explicit TActorIterator(EActorIteratorType)
74 : Super(EActorIteratorType::End)
75 {
76 }
77
83 FORCEINLINE ActorType* operator*() const
84 {
85 return CastChecked<ActorType>(**static_cast<const Super*>(this));
86 }
87
93 FORCEINLINE ActorType* operator->() const
94 {
95 return **this;
96 }
97 };
98}
Definition Actor.h:22
Definition ActorIterator.h:16
FActorIterator(const UWorld *InWorld, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
Definition ActorIterator.h:27
FActorIterator(const UWorld *InWorld, const TSubclassOf< AActor > InClass, const EActorIteratorFlags InFlags=EActorIteratorFlags(OnlyActiveLevels|SkipPendingKill))
Definition ActorIterator.h:40
Definition KarmaUtilities.h:171
Definition ActorIterator.h:52
TActorIterator(EActorIteratorType)
Definition ActorIterator.h:73
FORCEINLINE ActorType * operator->() const
Definition ActorIterator.h:93
TActorIterator(const UWorld *InWorld, TSubclassOf< AActor > InClass=ActorType::StaticClass(), EActorIteratorFlags InFlags=EActorIteratorFlags(EActorIteratorFlags::OnlyActiveLevels|EActorIteratorFlags::SkipPendingKill))
Definition ActorIterator.h:64
FORCEINLINE ActorType * operator*() const
Definition ActorIterator.h:83
Definition SubClassOf.h:64
Definition World.h:108