9#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_7
12#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_5
18#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_7
27#if WITH_MASSENTITY_DEBUG
31struct FMassRequirementAccessDetector;
34#define UE_API MASSENTITY_API
49 struct FEntityBuilder;
54 struct FEntityStorageInitializer;
56 namespace ObserverManager
59 struct FCreationContext;
66#ifndef REQUESTED_MASS_CONCURRENT_RESERVE
67#define REQUESTED_MASS_CONCURRENT_RESERVE 1
70#define WITH_MASS_CONCURRENT_RESERVE (REQUESTED_MASS_CONCURRENT_RESERVE || WITH_EDITOR)
74#if WITH_MASS_CONCURRENT_RESERVE
104 constexpr static int32 NumReservedEntities = 1;
111 ++ScopedProcessingCount;
115 --ScopedProcessingCount;
118 std::atomic<int32>& ScopedProcessingCount;
132 return TEXT(
"FMassEntityManager");
556 (EntityHandle.
Index == 0) ?
TEXT(
"was never initialized") :
TEXT(
"already destroyed"));
570 template<
typename FragmentType>
574 return *((FragmentType*)InternalGetFragmentDataChecked(EntityHandle, FragmentType::StaticStruct()));
577 template<
typename FragmentType>
581 return (FragmentType*)InternalGetFragmentDataPtr(EntityHandle, FragmentType::StaticStruct());
587 ,
TEXT(
"GetFragmentDataStruct called with an invalid fragment type '%s'"), *
GetPathNameSafe(FragmentType));
588 return FStructView(FragmentType,
static_cast<uint8*
>(InternalGetFragmentDataPtr(EntityHandle, FragmentType)));
591 template<
typename ConstSharedFragmentType>
595 const FConstSharedStruct* ConstSharedStruct = InternalGetConstSharedFragmentPtr(EntityHandle, ConstSharedFragmentType::StaticStruct());
599 template<
typename ConstSharedFragmentType>
612 return ConstSharedStruct
617 template<
typename SharedFragmentType>
621 ,
"Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
627 template<
typename SharedFragmentType>
631 ,
"Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
636 template<
typename SharedFragmentType>
657 if constexpr (std::is_same_v<T, FMassFragment>)
661 else if constexpr (std::is_same_v<T, FMassSharedFragment>)
665 else if constexpr (std::is_same_v<T, FMassConstSharedFragment>)
671 static_assert(UE::Mass::TAlwaysFalse<T>,
"Unsupported element type passed to GetElementDataStruct");
710 UE_DEPRECATED(5.5,
"This method will no longer be exposed. Use GetOrCreateConstSharedFragment instead.")
713 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.");
714 return ConstSharedFragmentsContainer.FindOrAdd(
Hash, T::StaticStruct(),
reinterpret_cast<const uint8*
>(&Fragment));
721 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.");
722 return SharedFragmentsContainer.FindOrAdd(
Hash, T::StaticStruct(),
reinterpret_cast<const uint8*
>(&Fragment));
735 template<
typename T,
typename...
TArgs>
738 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.");
744#if WITH_EDITOR || WITH_MASSENTITY_DEBUG
745 template<
typename CallableT>
763 template<
typename T,
typename...
TArgs>
764 UE_DEPRECATED(5.5,
"This method will no longer be exposed. Use GetOrCreateSharedFragment instead.")
767 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.");
797 "Given struct doesn't represent a valid const shared fragment type. Make sure to inherit from FMassConstSharedFragment or one of its child-types.");
830 "Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
832 return GetOrCreateSharedFragmentByHash(
Hash, Fragment);
857 template<
typename T,
typename...
TArgs>
861 "Given struct doesn't represent a valid const shared fragment type. Make sure to inherit from FMassConstSharedFragment or one of its child-types.");
891 template<
typename T,
typename...
TArgs>
895 "Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
916 TEXT(
"Given struct doesn't represent a valid const shared fragment type. Make sure to inherit from FMassConstSharedFragment or one of its child-types."));
936 TEXT(
"Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types."));
976 template<
typename T,
typename...
TArgs>
980 "Given struct doesn't represent a valid const shared fragment type. Make sure to inherit from FMassConstSharedFragment or one of its child-types.");
1023 template<
typename T,
typename...
TArgs>
1027 "Given struct doesn't represent a valid shared fragment type. Make sure to inherit from FMassSharedFragment or one of its child-types.");
1030 return GetOrCreateSharedFragmentByHash(
Hash,
MoveTemp(Fragment));
1033 template<UE::Mass::CSharedFragment T>
1036 template<UE::Mass::CSharedFragment T>
1039 template<UE::Mass::CConstSharedFragment T>
1042 template<UE::Mass::CConstSharedFragment T>
1050 template<UE::Mass::CRelation T>
1087#if WITH_MASSENTITY_DEBUG
1098 UE_DEPRECATED(5.7,
"Using CreateEntityIndexHandle instead.")
1170#if WITH_MASS_CONCURRENT_RESERVE
1176 checkf(
false,
TEXT(
"Attempt to use EntityStorageInterface without initialization"));
1207#if WITH_MASSENTITY_DEBUG
1211 std::atomic<int32> ProcessingScopeCount = 0;
1214 uint32 ArchetypeDataVersion = 0;
1230 template<
typename TSharedStructType>
1231 struct TSharedFragmentsContainer
1235 return TypeToInstanceMap.
Find(Type);
1240 for (TMultiMap<uint32, int32>::TConstKeyIterator It = HashToInstanceIndexMap.CreateConstKeyIterator(
Hash); It; ++It)
1244 if (
Instance.GetScriptStruct() == Type
1252 HashToInstanceIndexMap.Add(
Hash,
Index);
1253 return Instances[
Index];
1256 template<
typename T,
typename...
TArgs>
1262 for (TMultiMap<uint32, int32>::TConstKeyIterator It = HashToInstanceIndexMap.CreateConstKeyIterator(
Hash); It; ++It)
1266 if (
Instance.GetScriptStruct() == T::StaticStruct()
1274 HashToInstanceIndexMap.Add(
Hash,
Index);
1275 return Instances[
Index];
1280 return Instances[
Index];
1306 TSharedFragmentsContainer<FConstSharedStruct> ConstSharedFragmentsContainer;
1307 TSharedFragmentsContainer<FSharedStruct> SharedFragmentsContainer;
1318#if WITH_MASSENTITY_DEBUG
1337 static constexpr int32 NumCommandBuffers = 2;
1339 uint8 OpenedCommandBufferIndex = 0;
1340 std::atomic<bool> bCommandBufferFlushingInProgress =
false;
1341 bool bFirstCommandFlush =
true;
1343 enum class EInitializationState :
uint8
1350 EInitializationState InitializationState = EInitializationState::Uninitialized;
1356 UE_DEPRECATED(5.6,
"This flavor of InternalCreateSimilarArchetype is deprecated due to the introduction of archetype grouping. Use InternalCreateSimilarArchetype with a FArchetypeGroups parameter instead")
1374 template<UE::Mass::CConstSharedFragment T>
1375 UE_DEPRECATED(5.6,
"Using ForEachSharedFragmentConditional for Const Shared Fragments has been deprecated. Use ForEachConstSharedFragmentConditional instead.")
1385#if WITH_MASSENTITY_DEBUG
1389template<UE::Mass::CSharedFragment T>
1396 ExecuteFunction(SharedStruct.Get<T>());
1401template<UE::Mass::CSharedFragment T>
1417template<UE::Mass::CConstSharedFragment T>
1424 ExecuteFunction(SharedStruct.Get<
const T>());
1429template<UE::Mass::CConstSharedFragment T>
1447 return *TypeManager;
1452 return *TypeManager;
1467 return RelationManager;
1470template<UE::Mass::CRelation T>
OODEFFUNC typedef const int const char * function
Definition oodle2.h:710
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FString GetPathNameSafe(const FField *InField, const UObject *StopOuter)
Definition Field.cpp:1150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
EForkProcessRole
Definition Fork.h:22
@ Composition
Definition HairStrandsComposition.cpp:43
#define MASS_INVALID_FRAGMENT_MSG
Definition MassEntityElementTypes.h:16
#define UE_API
Definition MassEntityManager.h:34
EMassFragmentAccess
Definition MassRequirements.h:18
T TNotNull
Definition NotNull.h:307
@ PPF_None
Definition PropertyPortFlags.h:15
decltype(auto) Visit(Func &&Callable, Variants &&... Args)
Definition TVariant.h:271
TConstArrayView< const UScriptStruct * > TConstArrayView< const UScriptStruct * >
Definition TypedElementQueryCapabilities.inl:16
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
UEBinkAudioDecodeInterface * Interface
Definition binka_ue_decode_test.cpp:24
Definition IDelegateInstance.h:14
Definition GCObject.h:128
Definition NameTypes.h:617
Definition UnrealType.h:3087
Definition OutputDevice.h:133
Definition UObjectGlobals.h:2492
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_NODEBUG UE_FORCEINLINE_HINT bool Find(const ElementType &Item, SizeType &Index) const
Definition Array.h:1302
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:1640
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition StaticArray.h:26
U & Get() UE_LIFETIMEBOUND
Definition TVariant.h:146
Definition MassEntityManagerStorage.h:198
Definition MassEntityManagerStorage.h:138
Definition MassEntityManagerStorage.h:53
Definition MassEntityConcepts.h:32
Definition MassEntityConcepts.h:16
Definition MassEntityConcepts.h:29
@ Uninitialized
Definition AnimationAsset.h:50
Definition OverriddenPropertySet.cpp:45
Definition MassArchetypeData.h:21
bool IsA< FMassSharedFragment >(const UStruct *Struct)
Definition MassEntityElementTypes.h:73
bool IsA< FMassFragment >(const UStruct *Struct)
Definition MassEntityElementTypes.h:55
bool IsA< FMassConstSharedFragment >(const UStruct *Struct)
Definition MassEntityElementTypes.h:79
uint32 GetStructInstanceCrc32(const UScriptStruct &ScriptStruct, const uint8 *StructMemory, const uint32 CRC)
Definition StructUtilsTypes.cpp:58
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition SharedStruct.h:538
const uint8 * GetMemory() const
Definition SharedStruct.h:584
Definition StructView.h:217
static FConstStructView Make(const T &Struct)
Definition StructView.h:246
Definition InstancedStruct.h:32
Definition MassEntityTypes.h:74
Definition MassEntityTypes.h:816
Definition MassArchetypeData.h:172
Definition MassArchetypeTypes.h:233
Definition MassArchetypeTypes.h:93
Definition MassArchetypeTypes.h:39
Definition MassEntityTypes.h:297
Definition MassCommandBuffer.h:99
Definition MassDebugger.h:441
Definition MassEntityHandle.h:13
int32 SerialNumber
Definition MassEntityHandle.h:26
int32 Index
Definition MassEntityHandle.h:23
Definition MassEntityManager.h:108
~FScopedProcessing()
Definition MassEntityManager.h:113
FScopedProcessing(std::atomic< int32 > &InProcessingScopeCount)
Definition MassEntityManager.h:109
Definition MassEntityManager.h:96
UE_API bool RemoveSharedFragmentFromEntity(const FMassEntityHandle EntityHandle, const UScriptStruct &SharedFragmentType)
Definition MassEntityManager.cpp:1560
FragmentType * GetFragmentDataPtr(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:578
friend FMassEntityQuery
Definition MassEntityManager.h:97
UE_API FMassArchetypeHandle GetArchetypeForEntityUnsafe(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:539
UE_API void BatchAddSharedFragmentsForEntities(TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, const FMassArchetypeSharedFragmentValues &AddedFragmentValues)
Definition MassEntityManager.cpp:1789
UE_API void SetDebugName(const FString &NewDebugGame)
Definition MassEntityManager.cpp:2132
bool DoesEntityHaveElement(FMassEntityHandle Entity, TNotNull< const UScriptStruct * > ElementType) const
Definition MassEntityManager.cpp:1340
UWorld * GetWorld() const
Definition MassEntityManager.h:1081
void CheckIfEntityIsActive(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:560
ConstSharedFragmentType & GetConstSharedFragmentDataChecked(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:600
UE_API void BuildEntity(FMassEntityHandle EntityHandle, const FMassArchetypeHandle &ArchetypeHandle, const FMassArchetypeSharedFragmentValues &SharedFragmentValues={})
Definition MassEntityManager.cpp:635
virtual UE_API void AddReferencedObjects(FReferenceCollector &Collector) override
Definition MassEntityManager.cpp:103
bool IsProcessing() const
Definition MassEntityManager.h:690
UE_API TSharedRef< FEntityCreationContext > GetOrMakeCreationContext()
Definition MassEntityManager.cpp:2081
UE_API const UE::Mass::FArchetypeGroups & GetGroupsForArchetype(const FMassArchetypeHandle &ArchetypeHandle) const
Definition MassEntityManager.cpp:1003
UE_API void AddFragmentListToEntity(FMassEntityHandle EntityHandle, TConstArrayView< const UScriptStruct * > FragmentList)
Definition MassEntityManager.cpp:1044
UE_API void SetEntityFragmentValues(FMassEntityHandle EntityHandle, TArrayView< const FInstancedStruct > FragmentInstanceList)
Definition MassEntityManager.cpp:1850
UE_API UE::Mass::FArchetypeGroupType FindOrAddArchetypeGroupType(const FName GroupName)
Definition MassEntityManager.cpp:989
const FSharedStruct & GetOrCreateSharedFragment(const UScriptStruct &InScriptStruct, const uint8 *InStructMemory)
Definition MassEntityManager.h:933
UE_API void AddCompositionToEntity_GetDelta(FMassEntityHandle EntityHandle, FMassArchetypeCompositionDescriptor &InOutDescriptor, const FMassArchetypeSharedFragmentValues *AddedSharedFragmentValues=nullptr)
Definition MassEntityManager.cpp:1055
UE_API void BatchChangeFragmentCompositionForEntities(TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, const FMassFragmentBitSet &FragmentsToAdd, const FMassFragmentBitSet &FragmentsToRemove)
Definition MassEntityManager.cpp:1653
bool BatchCreateRelations(TArrayView< FMassEntityHandle > Subjects, TArrayView< FMassEntityHandle > Objects)
Definition MassEntityManager.h:1471
UE_API void GetResourceSizeEx(FResourceSizeEx &CumulativeResourceSize)
Definition MassEntityManager.cpp:81
uint32 GetArchetypeDataVersion() const
Definition MassEntityManager.h:676
void ForEachSharedFragmentConditional(TFunctionRef< bool(T &) > ConditionFunction, TFunctionRef< void(T &) > ExecuteFunction)
Definition MassEntityManager.h:1402
UE_API bool AddSharedFragmentToEntity(const FMassEntityHandle EntityHandle, const FSharedStruct &InSharedFragment)
Definition MassEntityManager.cpp:1510
const FConstSharedStruct & GetOrCreateConstSharedFragmentByHash(const uint32 Hash, const T &Fragment)
Definition MassEntityManager.h:711
FOnNewArchetypeDelegate & GetOnNewArchetypeEvent()
Definition MassEntityManager.h:1076
UE_API bool RemoveConstSharedFragmentFromEntity(const FMassEntityHandle EntityHandle, const UScriptStruct &ConstSharedFragmentType)
Definition MassEntityManager.cpp:1467
TConstArrayView< FSharedStruct > GetSharedFragmentsOfType()
Definition MassEntityManager.h:618
UE_API FMassExecutionContext CreateExecutionContext(const float DeltaSeconds)
Definition MassEntityManager.cpp:1993
ConstSharedFragmentType * GetConstSharedFragmentDataPtr(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:592
UE_API void SetEntityFragmentsValues(FMassEntityHandle EntityHandle, TArrayView< const FInstancedStruct > FragmentInstanceList)
Definition MassEntityManager.cpp:2312
UE_API FMassArchetypeHandle GetOrCreateSuitableArchetype(const FMassArchetypeHandle &ArchetypeHandle, const FMassSharedFragmentBitSet &SharedFragmentBitSet, const FMassConstSharedFragmentBitSet &ConstSharedFragmentBitSet, const FMassArchetypeCreationParams &CreationParams=FMassArchetypeCreationParams())
Definition MassEntityManager.cpp:358
UE_API void BatchChangeTagsForEntities(TConstArrayView< FMassArchetypeEntityCollection > EntityCollections, const FMassTagBitSet &TagsToAdd, const FMassTagBitSet &TagsToRemove)
Definition MassEntityManager.cpp:1603
UE_API void Initialize()
Definition MassEntityManager.cpp:133
UE_API void FlushCommands()
Definition MassEntityManager.cpp:2030
const FConstSharedStruct & GetOrCreateConstSharedFragment(TArgs &&... InArgs)
Definition MassEntityManager.h:858
virtual UE_API ~FMassEntityManager()
Definition MassEntityManager.cpp:73
const FSharedStruct & GetOrCreateSharedFragment(const FConstStructView HashingHelperStruct, TArgs &&... InArgs)
Definition MassEntityManager.h:1024
UE_API void AddFragmentToEntity(FMassEntityHandle EntityHandle, const UScriptStruct *FragmentType)
Definition MassEntityManager.cpp:1014
UE_API void RemoveFragmentFromEntity(FMassEntityHandle EntityHandle, const UScriptStruct *FragmentType)
Definition MassEntityManager.cpp:1223
UE_API FMassArchetypeHandle CreateArchetype(TConstArrayView< const UScriptStruct * > FragmentsAndTagsList, const FMassArchetypeCreationParams &CreationParams=FMassArchetypeCreationParams())
Definition MassEntityManager.cpp:318
FMassEntityManager(const FMassEntityManager &Other)=delete
friend FMassDebugger
Definition MassEntityManager.h:98
TSharedRef< FEntityCreationContext > BatchCreateEntities(const FMassArchetypeHandle &ArchetypeHandle, const int32 Count, TArray< FMassEntityHandle > &InOutEntities)
Definition MassEntityManager.h:309
UE_API void AppendCommands(const TSharedPtr< FMassCommandBuffer > &InOutCommandBuffer)
Definition MassEntityManager.cpp:2070
void AddElementToEntities(TConstArrayView< FMassEntityHandle > Entities, TNotNull< const UScriptStruct * > ElementType)
Definition MassEntityManager.cpp:1355
FStructView GetFragmentDataStruct(FMassEntityHandle EntityHandle, const UScriptStruct *FragmentType) const
Definition MassEntityManager.h:584
FConstStructView GetSharedFragmentDataStruct(FMassEntityHandle EntityHandle, const UScriptStruct *SharedFragmentType) const
Definition MassEntityManager.h:644
void OnRelationTypeRegistered(UE::Mass::FTypeHandle RegisteredTypeHandle, const UE::Mass::FRelationTypeTraits &RelationTypeTraits)
Definition MassEntityManager.cpp:2103
UE_API void ReleaseReservedEntity(FMassEntityHandle EntityHandle)
Definition MassEntityManager.cpp:628
SharedFragmentType * GetSharedFragmentDataPtr(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:628
FragmentType & GetFragmentDataChecked(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:571
UE_API void BatchDestroyEntityChunks(const FMassArchetypeEntityCollection &Collection)
Definition MassEntityManager.cpp:877
UE_API TSharedRef< FEntityCreationContext > BatchBuildEntities(const FMassArchetypeEntityCollectionWithPayload &EncodedEntitiesWithPayload, const FMassFragmentBitSet &FragmentsAffected, const FMassArchetypeSharedFragmentValues &SharedFragmentValues={}, const FMassArchetypeCreationParams &CreationParams=FMassArchetypeCreationParams())
Definition MassEntityManager.cpp:688
UE_API void BatchDestroyEntities(TConstArrayView< FMassEntityHandle > InEntities)
Definition MassEntityManager.cpp:842
UE_API void PostInitialize()
Definition MassEntityManager.cpp:246
void RemoveElementFromEntities(TConstArrayView< FMassEntityHandle > Entities, TNotNull< const UScriptStruct * > ElementType)
Definition MassEntityManager.cpp:1386
UE_API void BatchGroupEntities(const UE::Mass::FArchetypeGroupHandle GroupHandle, TConstArrayView< FMassArchetypeEntityCollection > Collections)
Definition MassEntityManager.cpp:914
UE_API TConstArrayView< FMassEntityHandle > BatchReserveEntities(const int32 Count, TArray< FMassEntityHandle > &InOutEntities)
Definition MassEntityManager.cpp:674
TSharedRef< UE::Mass::ObserverManager::FObserverLock > GetOrMakeObserversLock()
Definition MassEntityManager.h:1460
TSharedRef< FEntityCreationContext > BatchCreateReservedEntities(const FMassArchetypeHandle &ArchetypeHandle, TConstArrayView< FMassEntityHandle > OutEntities)
Definition MassEntityManager.h:296
FMassCommandBuffer & Defer() const
Definition MassEntityManager.h:692
const static UE_API FMassEntityHandle InvalidEntity
Definition MassEntityManager.h:122
UE_API void InternalAppendFragmentsAndTagsToArchetypeCompositionDescriptor(FMassArchetypeCompositionDescriptor &InOutComposition, TConstArrayView< const UScriptStruct * > FragmentsAndTagsList) const
Definition MassEntityManager.cpp:505
UE_API void BatchAddFragmentInstancesForEntities(TConstArrayView< FMassArchetypeEntityCollectionWithPayload > EntityCollections, const FMassFragmentBitSet &FragmentsAffected)
Definition MassEntityManager.cpp:1711
UE_API void OnPostFork(EForkProcessRole Role)
Definition MassEntityManager.cpp:297
UE_API bool IsEntityBuilt(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:1946
void AddElementToEntity(FMassEntityHandle Entity, TNotNull< const UScriptStruct * > ElementType)
Definition MassEntityManager.cpp:1372
const FSharedStruct & GetOrCreateSharedFragment(TArgs &&... InArgs)
Definition MassEntityManager.h:892
const FConstSharedStruct & GetOrCreateConstSharedFragment(const T &Fragment)
Definition MassEntityManager.h:794
const FConstSharedStruct & GetOrCreateConstSharedFragment(const UScriptStruct &InScriptStruct, const uint8 *InStructMemory)
Definition MassEntityManager.h:913
FConstStructView GetConstSharedFragmentDataStruct(FMassEntityHandle EntityHandle, const UScriptStruct *ConstSharedFragmentType) const
Definition MassEntityManager.h:607
UE_API void MoveEntityToAnotherArchetype(FMassEntityHandle EntityHandle, FMassArchetypeHandle NewArchetypeHandle, const FMassArchetypeSharedFragmentValues *SharedFragmentValuesOverride=nullptr)
Definition MassEntityManager.cpp:1827
void ForEachSharedFragment(TFunctionRef< void(T &) > ExecuteFunction)
Definition MassEntityManager.h:1390
virtual FString GetReferencerName() const override
Definition MassEntityManager.h:130
UE_API void RemoveFragmentListFromEntity(FMassEntityHandle EntityHandle, TConstArrayView< const UScriptStruct * > FragmentList)
Definition MassEntityManager.cpp:1228
UObject * GetOwner() const
Definition MassEntityManager.h:1082
UE_API void RemoveTagFromEntity(FMassEntityHandle EntityHandle, const UScriptStruct *TagType)
Definition MassEntityManager.cpp:1315
UE_API void RemoveEntityFromGroupType(FMassEntityHandle EntityHandle, UE::Mass::FArchetypeGroupType GroupType)
Definition MassEntityManager.cpp:961
UE_API FMassArchetypeHandle InternalCreateSimilarArchetype(const TSharedPtr< FMassArchetypeData > &SourceArchetype, const FMassTagBitSet &OverrideTags)
Definition MassEntityManager.cpp:429
UE_API TSharedRef< FEntityCreationContext > BatchCreateReservedEntities(const FMassArchetypeHandle &ArchetypeHandle, const FMassArchetypeSharedFragmentValues &SharedFragmentValues, TConstArrayView< FMassEntityHandle > ReservedEntities)
Definition MassEntityManager.cpp:764
void CheckIfEntityIsValid(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:553
UE_API FMassEntityHandle CreateEntityIndexHandle(const int32 EntityIndex) const
Definition MassEntityManager.cpp:1959
UE::Mass::FRelationManager & GetRelationManager()
Definition MassEntityManager.h:1465
UE_API bool IsEntityReserved(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:1953
DECLARE_MULTICAST_DELEGATE_OneParam(FOnNewArchetypeDelegate, const FMassArchetypeHandle &)
void ForEachConstSharedFragmentConditional(TFunctionRef< bool(const T &) > ConditionFunction, TFunctionRef< void(const T &) > ExecuteFunction)
Definition MassEntityManager.h:1430
static UE_API void ForEachArchetypeFragmentType(const FMassArchetypeHandle &ArchetypeHandle, TFunction< void(const UScriptStruct *)> Function)
Definition MassEntityManager.cpp:550
UE_API void DoEntityCompaction(const double TimeAllowed)
Definition MassEntityManager.cpp:556
UE_API UE::Mass::FEntityBuilder MakeEntityBuilder()
Definition MassEntityManager.cpp:2086
UE_API void SwapTagsForEntity(FMassEntityHandle EntityHandle, const UScriptStruct *FromFragmentType, const UScriptStruct *ToFragmentType)
Definition MassEntityManager.cpp:1262
bool IsDuringEntityCreation() const
Definition MassEntityManager.h:1455
const UE::Mass::FTypeManager & GetTypeManager() const
Definition MassEntityManager.h:1445
UE_API bool IsEntityActive(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:1929
UE_API void AddTagToEntity(FMassEntityHandle EntityHandle, const UScriptStruct *TagType)
Definition MassEntityManager.cpp:1290
UE_API bool AddConstSharedFragmentToEntity(const FMassEntityHandle EntityHandle, const FConstSharedStruct &InConstSharedFragment)
Definition MassEntityManager.cpp:1417
TFunctionRef< void(void *Fragment, const UScriptStruct &FragmentType)> FStructInitializationCallback
Definition MassEntityManager.h:120
UE_API void BatchSetEntityFragmentValues(const FMassArchetypeEntityCollection &SparseEntities, TArrayView< const FInstancedStruct > FragmentInstanceList)
Definition MassEntityManager.cpp:1859
SharedFragmentType & GetSharedFragmentDataChecked(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.h:637
UE_API void AddFragmentInstanceListToEntity(FMassEntityHandle EntityHandle, TConstArrayView< FInstancedStruct > FragmentInstanceList)
Definition MassEntityManager.cpp:1207
UE_API const FMassArchetypeCompositionDescriptor & GetArchetypeComposition(const FMassArchetypeHandle &ArchetypeHandle) const
Definition MassEntityManager.cpp:1148
FConstStructView GetElementDataStruct(FMassEntityHandle EntityHandle, TNotNull< const UScriptStruct * > FragmentType) const
Definition MassEntityManager.h:655
UE_API void Deinitialize()
Definition MassEntityManager.cpp:265
UE_API UE::Mass::FArchetypeGroupHandle GetGroupForEntity(FMassEntityHandle EntityHandle, UE::Mass::FArchetypeGroupType GroupType) const
Definition MassEntityManager.cpp:979
FMassObserverManager & GetObserverManager()
Definition MassEntityManager.h:1074
const FConstSharedStruct & GetOrCreateConstSharedFragment(const FConstStructView HashingHelperStruct, TArgs &&... InArgs)
Definition MassEntityManager.h:977
static UE_API void BatchSetEntityFragmentsValues(const FMassArchetypeEntityCollection &SparseEntities, TArrayView< const FInstancedStruct > FragmentInstanceList)
Definition MassEntityManager.cpp:2317
void ForEachConstSharedFragment(TFunctionRef< void(const T &) > ExecuteFunction)
Definition MassEntityManager.h:1418
UE_API FMassArchetypeHandle GetArchetypeForEntity(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:530
UE_API void GetMatchingArchetypes(const FMassFragmentRequirements &Requirements, TArray< FMassArchetypeHandle > &OutValidArchetypes) const
Definition MassEntityManager.cpp:545
UE_API void RemoveCompositionFromEntity(FMassEntityHandle EntityHandle, const FMassArchetypeCompositionDescriptor &InDescriptor)
Definition MassEntityManager.cpp:1103
UE_API bool IsEntityValid(FMassEntityHandle EntityHandle) const
Definition MassEntityManager.cpp:1939
FScopedProcessing NewProcessingScope()
Definition MassEntityManager.h:683
const FSharedStruct & GetOrCreateSharedFragment(const T &Fragment)
Definition MassEntityManager.h:827
void RemoveElementFromEntity(FMassEntityHandle Entity, TNotNull< const UScriptStruct * > ElementType)
Definition MassEntityManager.cpp:1403
UE_API TSharedRef< FEntityCreationContext > BatchCreateEntities(const FMassArchetypeHandle &ArchetypeHandle, const FMassArchetypeSharedFragmentValues &SharedFragmentValues, const int32 Count, TArray< FMassEntityHandle > &InOutEntities)
Definition MassEntityManager.cpp:777
UE_API FMassEntityHandle ReserveEntity()
Definition MassEntityManager.cpp:621
void OnNewTypeRegistered(UE::Mass::FTypeHandle RegisteredTypeHandle)
Definition MassEntityManager.cpp:2091
Definition MassEntityQuery.h:51
Definition MassExecutionContext.h:29
Definition MassRequirements.h:160
Definition MassObserverManager.h:67
TSharedPtr< FCreationContext > GetCreationContext() const
Definition MassObserverManager.h:327
MASSENTITY_API TSharedRef< FObserverLock > GetOrMakeObserverLock()
Definition MassObserverManager.cpp:740
Definition ResourceSize.h:31
Definition SharedStruct.h:161
Definition StructView.h:24
Definition WeakObjectPtrTemplates.h:25
FORCEINLINE T * Get(bool bEvenIfPendingKill) const
Definition WeakObjectPtrTemplates.h:132
FORCEINLINE bool IsValid(bool bEvenIfPendingKill, bool bThreadsafeTest=false) const
Definition WeakObjectPtrTemplates.h:232
Definition MassArchetypeGroup.h:99
Definition MassArchetypeGroup.h:15
Definition MassArchetypeGroup.h:160
Definition MassEntityBuilder.h:61
Definition MassRelationManager.h:68
Definition MassTypeManager.h:27
Definition MassTypeManager.h:141
static FTypeHandle MakeTypeHandle(TNotNull< const UStruct * > InTypeKey)
Definition MassTypeManager.h:307
Definition MassObserverNotificationTypes.h:404
Definition MassEntityManager.cpp:143
Definition MassEntityRelations.h:105