UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMassArchetypeEntityCollection Struct Reference

#include <MassArchetypeTypes.h>

Classes

struct  FArchetypeEntityRange
 

Public Types

enum  EDuplicatesHandling { NoDuplicates , FoldDuplicates }
 
enum  EInitializationType { GatherAll , DoNothing }
 
using FEntityRangeArray = TArray< FArchetypeEntityRange >
 
using FConstEntityRangeArrayView = TConstArrayView< FArchetypeEntityRange >
 

Public Member Functions

 FMassArchetypeEntityCollection ()=default
 
UE_API FMassArchetypeEntityCollection (const FMassArchetypeHandle &InArchetype, TConstArrayView< FMassEntityHandle > InEntities, EDuplicatesHandling DuplicatesHandling)
 
UE_API FMassArchetypeEntityCollection (const FMassArchetypeHandle &InArchetype, const FMassEntityHandle EntityHandle)
 
UE_API FMassArchetypeEntityCollection (FMassArchetypeHandle &&InArchetype, const FMassEntityHandle EntityHandle)
 
UE_API FMassArchetypeEntityCollection (const FMassArchetypeHandle &InArchetypeHandle, const EInitializationType Initialization=EInitializationType::GatherAll)
 
UE_API FMassArchetypeEntityCollection (TSharedPtr< FMassArchetypeData > &InArchetype, const EInitializationType Initialization=EInitializationType::GatherAll)
 
 FMassArchetypeEntityCollection (const FMassArchetypeHandle &InArchetypeHandle, FEntityRangeArray &&InEntityRanges)
 
FConstEntityRangeArrayView GetRanges () const
 
FMassArchetypeHandle GetArchetype () const
 
bool IsEmpty () const
 
bool IsUpToDate () const
 
bool IsSet () const
 
void Reset ()
 
UE_API bool IsSame (const FMassArchetypeEntityCollection &Other) const
 
bool IsSameArchetype (const FMassArchetypeEntityCollection &Other) const
 
template<typename T >
requires std::is_same_v<typename TDecay<T>::Type, FMassArchetypeEntityCollection>
void Append (T &&Other)
 
UE_API bool ExportEntityHandles (TArray< FMassEntityHandle > &InOutHandles) const
 

Static Public Member Functions

static UE_API bool DoesContainOverlappingRanges (FConstEntityRangeArrayView Ranges)
 

Protected Member Functions

UE_API void BuildEntityRanges (TStridedView< const int32 > TrueIndices)
 

Static Protected Member Functions

static UE_API FArchetypeEntityRange CreateRangeForEntity (const FMassArchetypeHandle &InArchetype, const FMassEntityHandle EntityHandle)
 

Friends

struct FMassArchetypeEntityCollectionWithPayload
 

Detailed Description

A struct that converts an arbitrary array of entities of given Archetype into a sequence of continuous entity chunks. The goal is to have the user create an instance of this struct once and run through a bunch of systems. The runtime code usually uses FMassArchetypeChunkIterator to iterate on the chunk collection.

Member Typedef Documentation

◆ FConstEntityRangeArrayView

◆ FEntityRangeArray

Member Enumeration Documentation

◆ EDuplicatesHandling

Enumerator
NoDuplicates 
FoldDuplicates 

◆ EInitializationType

Enumerator
GatherAll 
DoNothing 

Constructor & Destructor Documentation

◆ FMassArchetypeEntityCollection() [1/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( )
default

◆ FMassArchetypeEntityCollection() [2/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( const FMassArchetypeHandle InArchetype,
TConstArrayView< FMassEntityHandle InEntities,
EDuplicatesHandling  DuplicatesHandling 
)

◆ FMassArchetypeEntityCollection() [3/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( const FMassArchetypeHandle InArchetype,
const FMassEntityHandle  EntityHandle 
)

optimized, special case for a single-entity

◆ FMassArchetypeEntityCollection() [4/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( FMassArchetypeHandle &&  InArchetype,
const FMassEntityHandle  EntityHandle 
)

◆ FMassArchetypeEntityCollection() [5/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( const FMassArchetypeHandle InArchetypeHandle,
const EInitializationType  Initialization = EInitializationType::GatherAll 
)
explicit

◆ FMassArchetypeEntityCollection() [6/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( TSharedPtr< FMassArchetypeData > &  InArchetype,
const EInitializationType  Initialization = EInitializationType::GatherAll 
)
explicit

◆ FMassArchetypeEntityCollection() [7/7]

FMassArchetypeEntityCollection::FMassArchetypeEntityCollection ( const FMassArchetypeHandle InArchetypeHandle,
FEntityRangeArray &&  InEntityRanges 
)
inline

Member Function Documentation

◆ Append()

template<typename T >
requires std::is_same_v<typename TDecay<T>::Type, FMassArchetypeEntityCollection>
void FMassArchetypeEntityCollection::Append ( T &&  Other)

Appends ranges of the given FMassArchetypeEntityCollection instance. Note that it can be safely done only when both collections host entities of the same archetype, and both were created with the same version of said archetype. Additionally, we don't expect the operation to produce overlapping entity ranges and this assumption is only verified in debug builds (i.e. use it only when you're certain no range overlaps are possible).

◆ BuildEntityRanges()

void FMassArchetypeEntityCollection::BuildEntityRanges ( TStridedView< const int32 TrueIndices)
protected

◆ CreateRangeForEntity()

FORCEINLINE FMassArchetypeEntityCollection::FArchetypeEntityRange FMassArchetypeEntityCollection::CreateRangeForEntity ( const FMassArchetypeHandle InArchetype,
const FMassEntityHandle  EntityHandle 
)
staticprotected

◆ DoesContainOverlappingRanges()

bool FMassArchetypeEntityCollection::DoesContainOverlappingRanges ( FConstEntityRangeArrayView  Ranges)
static

◆ ExportEntityHandles()

bool FMassArchetypeEntityCollection::ExportEntityHandles ( TArray< FMassEntityHandle > &  InOutHandles) const

Converts stored entity ranges to FMassEntityHandles and appends them to InOutHandles. Note that the operation is only supported for already created entities (i.e. not "reserved")

Returns
whether any entity handles have been actually exported

◆ GetArchetype()

FMassArchetypeHandle FMassArchetypeEntityCollection::GetArchetype ( ) const
inline

◆ GetRanges()

FMassArchetypeEntityCollection::FConstEntityRangeArrayView FMassArchetypeEntityCollection::GetRanges ( ) const
inline

◆ IsEmpty()

bool FMassArchetypeEntityCollection::IsEmpty ( ) const
inline

◆ IsSame()

bool FMassArchetypeEntityCollection::IsSame ( const FMassArchetypeEntityCollection Other) const

The comparison function that checks if Other is identical to this. Intended for diagnostics/debugging.

◆ IsSameArchetype()

bool FMassArchetypeEntityCollection::IsSameArchetype ( const FMassArchetypeEntityCollection Other) const
inline

◆ IsSet()

bool FMassArchetypeEntityCollection::IsSet ( ) const
inline

◆ IsUpToDate()

bool FMassArchetypeEntityCollection::IsUpToDate ( ) const
inline

◆ Reset()

void FMassArchetypeEntityCollection::Reset ( )
inline

Friends And Related Symbol Documentation

◆ FMassArchetypeEntityCollectionWithPayload


The documentation for this struct was generated from the following files: