UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MassExecutionContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5
6#include "MassEntityHandle.h"
7#include "MassEntityTypes.h"
8#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_6
10#endif // UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_6
11#include "MassEntityQuery.h"
12#include "MassArchetypeTypes.h"
13#include "MassSubsystemAccess.h"
14#include "MassProcessor.h"
15
16
17#define CHECK_IF_VALID(View, Type) \
18 checkf(View \
19 , TEXT("Requested fragment type not bound, type %s. Make sure it has been listed as required."), *GetNameSafe(Type))
20
21#define CHECK_IF_READWRITE(View) \
22 checkf(View == nullptr || View->Requirement.AccessMode == EMassFragmentAccess::ReadWrite \
23 , TEXT("Requested fragment type not bound for writing, type %s. Make sure it has been listed as required in ReadWrite mode.") \
24 , View ? *GetNameSafe(View->Requirement.StructType) : TEXT("[Not found]"))
25
26struct FMassEntityQuery;
27
29{
30private:
31
32 template< typename ViewType >
33 struct TFragmentView
34 {
36 ViewType FragmentView;
37
38 TFragmentView() {}
39 explicit TFragmentView(const FMassFragmentRequirementDescription& InRequirement) : Requirement(InRequirement) {}
40
41 bool operator==(const UScriptStruct* FragmentType) const { return Requirement.StructType == FragmentType; }
42 };
43 using FFragmentView = TFragmentView<TArrayView<FMassFragment>>;
45
46 using FChunkFragmentView = TFragmentView<FStructView>;
48
49 using FConstSharedFragmentView = TFragmentView<FConstStructView>;
51
52 using FSharedFragmentView = TFragmentView<FStructView>;
54
55 FMassSubsystemAccess SubsystemAccess;
56
57 // mz@todo make this shared ptr thread-safe and never auto-flush in MT environment.
58 TSharedPtr<FMassCommandBuffer> DeferredCommandBuffer;
59 TArrayView<FMassEntityHandle> EntityListView;
60
63 FMassArchetypeEntityCollection EntityCollection;
64
66 FInstancedStruct AuxData;
67 float DeltaTimeSeconds = 0.0f;
68 int32 ChunkSerialModificationNumber = -1;
69 FMassArchetypeCompositionDescriptor CurrentArchetypeCompositionDescriptor;
70#if WITH_MASSENTITY_DEBUG
71 FColor DebugColor;
72#endif // WITH_MASSENTITY_DEBUG
73
75
76 struct FQueryTransientRuntime
77 {
79 FMassExternalSubsystemBitSet ConstSubsystemsBitSet;
80 FMassExternalSubsystemBitSet MutableSubsystemsBitSet;
81#if WITH_MASSENTITY_DEBUG
83 static constexpr uint32 MaxFragmentBreakpointCount = 8;
85
86 bool bCheckProcessorBreaks = false;
88#endif // WITH_MASSENTITY_DEBUG
89
91 uint32 IteratorSerialNumber = 0;
92
94 static FQueryTransientRuntime& GetDummyInstance();
95 };
96
99
101 uint32 IteratorSerialNumberGenerator = 0;
102
103#if WITH_MASSENTITY_DEBUG
105
107 // js@todo make this more generic
109#endif // WITH_MASSENTITY_DEBUG
110
113 bool bFlushDeferredCommands = true;
114
115 TArrayView<FFragmentView> GetMutableRequirements() { return FragmentViews; }
116 TArrayView<FChunkFragmentView> GetMutableChunkRequirements() { return ChunkFragmentViews; }
117 TArrayView<FConstSharedFragmentView> GetMutableConstSharedRequirements() { return ConstSharedFragmentViews; }
118 TArrayView<FSharedFragmentView> GetMutableSharedRequirements() { return SharedFragmentViews; }
119
121 {
123 }
124
126 {
128 }
129
131
132 friend FMassArchetypeData;
133
138 FMassExecutionContext& operator=(const FMassExecutionContext& Other) = default;
139
140public:
146
149
152
153#if WITH_MASSENTITY_DEBUG
154 const FString& DebugGetExecutionDesc() const { return DebugExecutionDescription; }
155 void DebugSetExecutionDesc(const FString& Description) { DebugExecutionDescription = Description; }
156 void DebugSetExecutionDesc(FString&& Description) { DebugExecutionDescription = MoveTemp(Description); }
157
158 UMassProcessor* DebugGetProcessor() const { return DebugProcessor.Get(); }
160#endif
161
163 void PopQuery(const FMassEntityQuery& InQuery);
164 const FMassEntityQuery& GetCurrentQuery() const;
165 bool IsCurrentQuery(const FMassEntityQuery& Query) const;
168
174 {
175 inline int32 operator*() const
176 {
177 return EntityIndex;
178 }
179
180 inline bool operator!=(const int& Other) const
181 {
182 return EntityIndex != Other;
183 }
184
185 inline operator int32() const
186 {
187 return EntityIndex;
188 }
189
190 inline operator bool() const
191 {
192 return SerialNumber && EntityIndex < NumEntities;
193 }
194
195 inline bool operator<(const int32 Other) const
196 {
197 return SerialNumber && EntityIndex != INDEX_NONE && EntityIndex < Other;
198 }
199
201 {
202 ++EntityIndex;
203#if WITH_MASSENTITY_DEBUG
204 if (UNLIKELY(QueryRuntime.bCheckProcessorBreaks || QueryRuntime.BreakFragmentsCount != 0)
205 && EntityIndex < NumEntities)
206 {
208 }
209#endif //WITH_MASSENTITY_DEBUG
210 return *this;
211 }
212
213 inline void operator++(int)
214 {
215 ++(*this);
216 }
217
219 {
220 return MoveTemp(*this);
221 }
222
224 {
226 End.EntityIndex = NumEntities;
227 return End;
228 }
229
232
240
241 private:
245
246#if WITH_MASSENTITY_DEBUG
248#endif
249
250 const FMassExecutionContext& ExecutionContext;
251 const FQueryTransientRuntime& QueryRuntime;
252 int32 EntityIndex = INDEX_NONE;
253 const int32 NumEntities = INDEX_NONE;
254 const uint32 SerialNumber = 0;
255 };
256
262
271
274
275 float GetDeltaTimeSeconds() const;
276
278
279 TSharedPtr<FMassCommandBuffer> GetSharedDeferredCommandBuffer() const { return DeferredCommandBuffer; }
280 FMassCommandBuffer& Defer() const { checkSlow(DeferredCommandBuffer.IsValid()); return *DeferredCommandBuffer.Get(); }
281
282 TConstArrayView<FMassEntityHandle> GetEntities() const { return EntityListView; }
283 int32 GetNumEntities() const { return EntityListView.Num(); }
284
286 {
287 return EntityListView[Index];
288 }
289
297
298 bool DoesArchetypeHaveFragment(const UScriptStruct& FragmentType) const
299 {
300 return CurrentArchetypeCompositionDescriptor.GetFragments().Contains(FragmentType);
301 }
302
303 template<typename T>
305 {
307 return CurrentArchetypeCompositionDescriptor.GetFragments().Contains<T>();
308 }
309
311 {
312 return CurrentArchetypeCompositionDescriptor.GetTags().Contains(TagType);
313 }
314
315 template<typename T>
317 {
318 static_assert(UE::Mass::CTag<T>, "Given struct is not of a valid tag type.");
319 return CurrentArchetypeCompositionDescriptor.GetTags().Contains<T>();
320 }
321
322#if WITH_MASSENTITY_DEBUG
324 {
325 return DebugColor;
326 }
327#endif // WITH_MASSENTITY_DEBUG
328
330 void SetCurrentChunkSerialModificationNumber(const int32 SerialModificationNumber) { ChunkSerialModificationNumber = SerialModificationNumber; }
331 int32 GetChunkSerialModificationNumber() const { return ChunkSerialModificationNumber; }
332
333 template<typename T>
335 {
336 static_assert(UE::Mass::CChunkFragment<T>, "Given struct doesn't represent a valid chunk fragment type. Make sure to inherit from FMassChunkFragment or one of its child-types.");
337
338 const UScriptStruct* Type = T::StaticStruct();
339 FChunkFragmentView* FoundChunkFragmentData = ChunkFragmentViews.FindByPredicate([Type](const FChunkFragmentView& Element) { return Element.Requirement.StructType == Type; } );
341 return FoundChunkFragmentData ? FoundChunkFragmentData->FragmentView.GetPtr<T>() : static_cast<T*>(nullptr);
342 }
343
344 template<typename T>
346 {
348 CHECK_IF_VALID(ChunkFragment, T::StaticStruct());
349 return *ChunkFragment;
350 }
351
352 template<typename T>
353 const T* GetChunkFragmentPtr() const
354 {
355 static_assert(UE::Mass::CChunkFragment<T>, "Given struct doesn't represent a valid chunk fragment type. Make sure to inherit from FMassChunkFragment or one of its child-types.");
356
357 const UScriptStruct* Type = T::StaticStruct();
358 const FChunkFragmentView* FoundChunkFragmentData = ChunkFragmentViews.FindByPredicate([Type](const FChunkFragmentView& Element) { return Element.Requirement.StructType == Type; } );
359 return FoundChunkFragmentData ? FoundChunkFragmentData->FragmentView.GetPtr<T>() : static_cast<const T*>(nullptr);
360 }
361
362 template<typename T>
363 const T& GetChunkFragment() const
364 {
366 CHECK_IF_VALID(ChunkFragment, T::StaticStruct());
367 return *ChunkFragment;
368 }
369
372 {
373 const FConstSharedFragmentView* FoundSharedFragmentData = ConstSharedFragmentViews.FindByPredicate([&SharedFragmentType](const FConstSharedFragmentView& Element) { return Element.Requirement.StructType == &SharedFragmentType; });
374 return FoundSharedFragmentData ? FoundSharedFragmentData->FragmentView.GetMemory() : nullptr;
375 }
376
377 template<typename T>
379 {
380 static_assert(UE::Mass::CConstSharedFragment<T>, "Given struct doesn't represent a valid const shared fragment type. Make sure to inherit from FMassConstSharedFragment or one of its child-types.");
381
382 const FConstSharedFragmentView* FoundSharedFragmentData = ConstSharedFragmentViews.FindByPredicate([](const FConstSharedFragmentView& Element) { return Element.Requirement.StructType == T::StaticStruct(); });
383 return FoundSharedFragmentData ? FoundSharedFragmentData->FragmentView.GetPtr<const T>() : static_cast<const T*>(nullptr);
384 }
385
386 template<typename T>
387 const T& GetConstSharedFragment() const
388 {
390 CHECK_IF_VALID(SharedFragment, T::StaticStruct());
391 return *SharedFragment;
392 }
393
394 template<typename T>
396 {
397 static_assert(UE::Mass::CSharedFragment<T>, "Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
398
399 FSharedFragmentView* FoundSharedFragmentData = SharedFragmentViews.FindByPredicate([](const FSharedFragmentView& Element) { return Element.Requirement.StructType == T::StaticStruct(); });
401 return FoundSharedFragmentData ? FoundSharedFragmentData->FragmentView.GetPtr<T>() : static_cast<T*>(nullptr);
402 }
403
404 template<typename T>
405 const T* GetSharedFragmentPtr() const
406 {
407 static_assert(UE::Mass::CSharedFragment<T>, "Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
408
409 const FSharedFragmentView* FoundSharedFragmentData = SharedFragmentViews.FindByPredicate([](const FSharedFragmentView& Element) { return Element.Requirement.StructType == T::StaticStruct(); });
410 return FoundSharedFragmentData ? FoundSharedFragmentData->FragmentView.GetPtr<T>() : static_cast<const T*>(nullptr);
411 }
412
413 template<typename T>
420
421 template<typename T>
422 const T& GetSharedFragment() const
423 {
425 CHECK_IF_VALID(SharedFragment, T::StaticStruct());
426 return *SharedFragment;
427 }
428
429 /* Fragments related operations */
430 template<typename TFragment>
432 {
433 const UScriptStruct* FragmentType = TFragment::StaticStruct();
434 const FFragmentView* View = FragmentViews.FindByPredicate([FragmentType](const FFragmentView& Element) { return Element.Requirement.StructType == FragmentType; });
435 CHECK_IF_VALID(View, FragmentType);
436 CHECK_IF_READWRITE(View);
437 return MakeArrayView<TFragment>((TFragment*)View->FragmentView.GetData(), View->FragmentView.Num());
438 }
439
440 template<typename TFragment>
442 {
443 const UScriptStruct* FragmentType = TFragment::StaticStruct();
444 const FFragmentView* View = FragmentViews.FindByPredicate([FragmentType](const FFragmentView& Element) { return Element.Requirement.StructType == FragmentType; });
445 CHECK_IF_VALID(View, TFragment::StaticStruct());
446 return TConstArrayView<TFragment>((const TFragment*)View->FragmentView.GetData(), View->FragmentView.Num());
447 }
448
450 {
451 const FFragmentView* View = FragmentViews.FindByPredicate([FragmentType](const FFragmentView& Element) { return Element.Requirement.StructType == FragmentType; });
452 CHECK_IF_VALID(View, FragmentType);
453 return TConstArrayView<FMassFragment>((const FMassFragment*)View->FragmentView.GetData(), View->FragmentView.Num());;
454 }
455
457 {
458 const FFragmentView* View = FragmentViews.FindByPredicate([FragmentType](const FFragmentView& Element) { return Element.Requirement.StructType == FragmentType; });
459 CHECK_IF_VALID(View, FragmentType);
460 CHECK_IF_READWRITE(View);
461 return View->FragmentView;
462 }
463
464 template<typename TFragmentBase>
466 {
467 check(FragmentType->IsChildOf(TFragmentBase::StaticStruct()));
469 return TConstArrayView<TFragmentBase>(reinterpret_cast<const TFragmentBase*>(View.GetData()), View.Num());
470 }
471
472 template<typename TFragmentBase>
474 {
475 check(FragmentType->IsChildOf(TFragmentBase::StaticStruct()));
477 return TArrayView<TFragmentBase>(reinterpret_cast<TFragmentBase*>(View.GetData()), View.Num());;
478 }
479
482 {
483 return SubsystemAccess.GetMutableSubsystem<T>();
484 }
485
488 {
489 return SubsystemAccess.GetMutableSubsystemChecked<T>();
490 }
491
493 const T* GetSubsystem()
494 {
495 return SubsystemAccess.GetSubsystem<T>();
496 }
497
500 {
501 return SubsystemAccess.GetSubsystemChecked<T>();
502 }
503
509
515
518 {
519 return SubsystemAccess.GetSubsystem<T>(SubsystemClass);
520 }
521
524 {
525 return SubsystemAccess.GetSubsystemChecked<T>(SubsystemClass);
526 }
527
529 const FMassArchetypeEntityCollection& GetEntityCollection() const { return EntityCollection; }
530
531 const FInstancedStruct& GetAuxData() const { return AuxData; }
532 FInstancedStruct& GetMutableAuxData() { return AuxData; }
533
534 template<typename TFragment>
536 {
537 const UScriptStruct* FragmentType = GetAuxData().GetScriptStruct();
538 return FragmentType != nullptr && FragmentType == TFragment::StaticStruct();
539 }
540
542
543 void ClearExecutionData();
545 {
546 CurrentArchetypeCompositionDescriptor = Descriptor;
547 }
548
549#if WITH_MASSENTITY_DEBUG
550 void DebugSetColor(FColor InColor)
551 {
552 DebugColor = InColor;
553 }
554#endif // WITH_MASSENTITY_DEBUG
555
566
567protected:
572
573 void SetFragmentRequirements(const FMassFragmentRequirements& FragmentRequirements);
574
576 {
577 for (FFragmentView& View : FragmentViews)
578 {
579 View.FragmentView = TArrayView<FMassFragment>();
580 }
581 for (FChunkFragmentView& View : ChunkFragmentViews)
582 {
583 View.FragmentView.Reset();
584 }
585 for (FConstSharedFragmentView& View : ConstSharedFragmentViews)
586 {
587 View.FragmentView.Reset();
588 }
589 for (FSharedFragmentView& View : SharedFragmentViews)
590 {
591 View.FragmentView.Reset();
592 }
593 }
594};
595
596//-----------------------------------------------------------------------------
597// Inlines
598//-----------------------------------------------------------------------------
600{
601 return EntityManager.Get();
602}
603
605{
606 return EntityManager;
607}
608
613
618
620{
621 EntityCollection.Reset();
622}
623
625{
626 AuxData = InAuxData;
627}
628
630{
631 return DeltaTimeSeconds;
632}
633
639
641{
642 return ExecutionType;
643}
644
646{
647 check(QueriesStack.Num());
648 return *QueriesStack.Last().Query;
649}
650
652{
653 return QueriesStack.Num() && QueriesStack.Last().Query == &Query;
654}
655
661
667
668#undef CHECK_IF_VALID
669#undef CHECK_IF_READWRITE
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UNLIKELY(x)
Definition Platform.h:857
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define MASS_INVALID_FRAGMENT_MSG
Definition MassEntityElementTypes.h:16
EMassExecutionContextType
Definition MassEntityTypes.h:612
#define CHECK_IF_VALID(View, Type)
Definition MassExecutionContext.h:17
#define CHECK_IF_READWRITE(View)
Definition MassExecutionContext.h:21
T TNotNull
Definition NotNull.h:307
const bool
Definition NetworkReplayStreaming.h:178
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ArrayView.h:139
UE_FORCEINLINE_HINT constexpr ElementType * GetData() const
Definition ArrayView.h:295
UE_FORCEINLINE_HINT constexpr SizeType Num() const
Definition ArrayView.h:380
Definition Array.h:670
ElementType * FindByPredicate(Predicate Pred)
Definition Array.h:1471
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
Definition AndroidPlatformMisc.h:14
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT ObjectType * Get() const
Definition SharedPointer.h:1065
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SharedPointer.h:153
Definition StaticArray.h:26
Definition SubclassOf.h:30
Definition MassProcessor.h:78
Definition Class.h:1720
Definition World.h:918
Definition MassEntityConcepts.h:26
Definition MassEntityConcepts.h:32
Definition MassEntityConcepts.h:16
Definition MassEntityConcepts.h:29
Definition MassEntityConcepts.h:23
@ Description
Definition PathFollowingComponent.h:177
U16 Index
Definition radfft.cpp:71
Definition Color.h:486
Definition InstancedStruct.h:32
const UScriptStruct * GetScriptStruct() const
Definition InstancedStruct.h:169
Definition MassEntityTypes.h:74
const FMassFragmentBitSet & GetFragments() const
Definition MassEntityTypes.h:907
const FMassTagBitSet & GetTags() const
Definition MassEntityTypes.h:912
Definition MassArchetypeData.h:172
Definition MassArchetypeTypes.h:93
void Reset()
Definition MassArchetypeTypes.h:189
Definition MassCommandBuffer.h:99
Definition MassEntityHandle.h:13
Definition MassEntityManager.h:96
Definition MassEntityQuery.h:51
Definition MassExecutionContext.h:174
FEntityIterator(FEntityIterator &&)=default
FEntityIterator & operator++()
Definition MassExecutionContext.h:200
bool operator!=(const int &Other) const
Definition MassExecutionContext.h:180
FEntityIterator & operator=(FEntityIterator &&)=delete
FEntityIterator & operator=(const FEntityIterator &)=delete
void operator++(int)
Definition MassExecutionContext.h:213
bool operator<(const int32 Other) const
Definition MassExecutionContext.h:195
FEntityIterator end() const
Definition MassExecutionContext.h:223
MASSENTITY_API FEntityIterator()
Definition MassExecutionContext.cpp:206
FEntityIterator(const FEntityIterator &)=delete
int32 operator*() const
Definition MassExecutionContext.h:175
FEntityIterator && begin()
Definition MassExecutionContext.h:218
Definition MassExecutionContext.h:29
const FMassEntityQuery & GetCurrentQuery() const
Definition MassExecutionContext.h:645
void ClearExecutionData()
Definition MassExecutionContext.cpp:52
void ApplyFragmentRequirements(const FMassEntityQuery &RequestingQuery)
Definition MassExecutionContext.h:656
const T & GetSubsystemChecked(const TSubclassOf< USubsystem > SubsystemClass)
Definition MassExecutionContext.h:523
FInstancedStruct & GetMutableAuxData()
Definition MassExecutionContext.h:532
const T * GetChunkFragmentPtr() const
Definition MassExecutionContext.h:353
void SetDeferredCommandBuffer(const TSharedPtr< FMassCommandBuffer > &InDeferredCommandBuffer)
Definition MassExecutionContext.h:614
TArrayView< TFragment > GetMutableFragmentView()
Definition MassExecutionContext.h:431
const T & GetSubsystemChecked()
Definition MassExecutionContext.h:499
TConstArrayView< FMassFragment > GetFragmentView(const UScriptStruct *FragmentType) const
Definition MassExecutionContext.h:449
T & GetMutableSharedFragment()
Definition MassExecutionContext.h:414
TArrayView< TFragmentBase > GetMutableFragmentView(TNotNull< const UScriptStruct * > FragmentType)
Definition MassExecutionContext.h:473
T * GetMutableSubsystem()
Definition MassExecutionContext.h:481
const FMassArchetypeEntityCollection & GetEntityCollection() const
Definition MassExecutionContext.h:529
bool DoesArchetypeHaveFragment() const
Definition MassExecutionContext.h:304
T & GetMutableChunkFragment()
Definition MassExecutionContext.h:345
const T * GetSubsystem(const TSubclassOf< USubsystem > SubsystemClass)
Definition MassExecutionContext.h:517
TConstArrayView< FMassEntityHandle > GetEntities() const
Definition MassExecutionContext.h:282
FMassExecutionContext(FMassExecutionContext &&Other)=default
void SetCurrentArchetypeCompositionDescriptor(const FMassArchetypeCompositionDescriptor &Descriptor)
Definition MassExecutionContext.h:544
int32 GetChunkSerialModificationNumber() const
Definition MassExecutionContext.h:331
float GetDeltaTimeSeconds() const
Definition MassExecutionContext.h:629
void ForEachEntityInChunk(const FMassEntityExecuteFunction &EntityExecuteFunction)
Definition MassExecutionContext.h:290
bool DoesArchetypeHaveTag(const UScriptStruct &TagType) const
Definition MassExecutionContext.h:310
bool DoesArchetypeHaveTag() const
Definition MassExecutionContext.h:316
int32 GetNumEntities() const
Definition MassExecutionContext.h:283
void SetSubsystemRequirements(const FMassSubsystemRequirements &SubsystemRequirements)
Definition MassExecutionContext.h:568
const T & GetConstSharedFragment() const
Definition MassExecutionContext.h:387
FMassEntityHandle GetEntity(const int32 Index) const
Definition MassExecutionContext.h:285
void SetFragmentRequirements(const FMassFragmentRequirements &FragmentRequirements)
Definition MassExecutionContext.cpp:84
TConstArrayView< TFragmentBase > GetFragmentView(TNotNull< const UScriptStruct * > FragmentType) const
Definition MassExecutionContext.h:465
void PushQuery(FMassEntityQuery &InQuery)
Definition MassExecutionContext.cpp:128
MASSENTITY_API void FlushDeferred()
Definition MassExecutionContext.cpp:44
const T * GetSharedFragmentPtr() const
Definition MassExecutionContext.h:405
const T & GetSharedFragment() const
Definition MassExecutionContext.h:422
void SetCurrentChunkSerialModificationNumber(const int32 SerialModificationNumber)
Definition MassExecutionContext.h:330
bool IsCurrentQuery(const FMassEntityQuery &Query) const
Definition MassExecutionContext.h:651
MASSENTITY_API UWorld * GetWorld()
Definition MassExecutionContext.cpp:123
EMassExecutionContextType GetExecutionType() const
Definition MassExecutionContext.h:640
T * GetMutableSharedFragmentPtr()
Definition MassExecutionContext.h:395
const T & GetChunkFragment() const
Definition MassExecutionContext.h:363
FMassEntityManager & GetEntityManagerChecked() const
Definition MassExecutionContext.h:599
void ClearFragmentViews()
Definition MassExecutionContext.h:575
void ClearEntityCollection()
Definition MassExecutionContext.h:619
TConstArrayView< TFragment > GetFragmentView() const
Definition MassExecutionContext.h:441
void PopQuery(const FMassEntityQuery &InQuery)
Definition MassExecutionContext.cpp:167
TArrayView< FMassFragment > GetMutableFragmentView(const UScriptStruct *FragmentType)
Definition MassExecutionContext.h:456
void SetExecutionType(EMassExecutionContextType InExecutionType)
Definition MassExecutionContext.h:634
static MASSENTITY_API FMassExecutionContext & GetDummyInstance()
Definition MassExecutionContext.cpp:187
bool ValidateAuxDataType() const
Definition MassExecutionContext.h:535
TSharedPtr< FMassCommandBuffer > GetSharedDeferredCommandBuffer() const
Definition MassExecutionContext.h:279
const T * GetConstSharedFragmentPtr() const
Definition MassExecutionContext.h:378
FMassCommandBuffer & Defer() const
Definition MassExecutionContext.h:280
T * GetMutableSubsystem(const TSubclassOf< USubsystem > SubsystemClass)
Definition MassExecutionContext.h:505
bool DoesArchetypeHaveFragment(const UScriptStruct &FragmentType) const
Definition MassExecutionContext.h:298
const void * GetConstSharedFragmentPtr(const UScriptStruct &SharedFragmentType) const
Definition MassExecutionContext.h:371
bool CacheSubsystemRequirements(const FMassSubsystemRequirements &SubsystemRequirements)
Definition MassExecutionContext.cpp:66
MASSENTITY_API ~FMassExecutionContext()
Definition MassExecutionContext.cpp:39
const TSharedRef< FMassEntityManager > & GetSharedEntityManager()
Definition MassExecutionContext.h:604
MASSENTITY_API void SetEntityCollection(const FMassArchetypeEntityCollection &InEntityCollection)
Definition MassExecutionContext.cpp:71
void SetFlushDeferredCommands(const bool bNewFlushDeferredCommands)
Definition MassExecutionContext.h:609
T & GetMutableSubsystemChecked(const TSubclassOf< USubsystem > SubsystemClass)
Definition MassExecutionContext.h:511
MASSENTITY_API FEntityIterator CreateEntityIterator()
Definition MassExecutionContext.cpp:177
const FInstancedStruct & GetAuxData() const
Definition MassExecutionContext.h:531
T * GetMutableChunkFragmentPtr()
Definition MassExecutionContext.h:334
void SetAuxData(const FInstancedStruct &InAuxData)
Definition MassExecutionContext.h:624
const T * GetSubsystem()
Definition MassExecutionContext.h:493
T & GetMutableSubsystemChecked()
Definition MassExecutionContext.h:487
Definition MassRequirements.h:51
const UScriptStruct * StructType
Definition MassRequirements.h:63
Definition MassRequirements.h:160
Definition MassEntityElementTypes.h:10
Definition MassSubsystemAccess.h:23
void SetSubsystemRequirementBits(const FMassExternalSubsystemBitSet &InConstSubsystemsBitSet, const FMassExternalSubsystemBitSet &InMutableSubsystemsBitSet)
Definition MassSubsystemAccess.h:126
const T * GetSubsystem()
Definition MassSubsystemAccess.h:51
const T & GetSubsystemChecked()
Definition MassSubsystemAccess.h:63
MASSENTITY_API void SetSubsystemRequirements(const FMassSubsystemRequirements &SubsystemRequirements)
Definition MassSubsystemAccess.cpp:115
void GetSubsystemRequirementBits(FMassExternalSubsystemBitSet &OutConstSubsystemsBitSet, FMassExternalSubsystemBitSet &OutMutableSubsystemsBitSet)
Definition MassSubsystemAccess.h:120
T * GetMutableSubsystem()
Definition MassSubsystemAccess.h:30
T & GetMutableSubsystemChecked()
Definition MassSubsystemAccess.h:43
Definition MassRequirements.h:72
Definition WeakObjectPtrTemplates.h:25