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

#include <MassEntityView.h>

Public Member Functions

 FMassEntityView ()=default
 
UE_API FMassEntityView (const FMassArchetypeHandle &ArchetypeHandle, FMassEntityHandle Entity)
 
UE_API FMassEntityView (const FMassEntityManager &EntityManager, FMassEntityHandle Entity)
 
FMassEntityHandle GetEntity () const
 
template<typename T >
T & GetFragmentData () const
 
template<typename T >
T * GetFragmentDataPtr () const
 
FStructView GetFragmentDataStruct (const UScriptStruct *FragmentType) const
 
template<typename T >
const T * GetConstSharedFragmentDataPtr () const
 
template<typename T >
const T & GetConstSharedFragmentData () const
 
FConstStructView GetConstSharedFragmentDataStruct (const UScriptStruct *FragmentType) const
 
template<UE::Mass::CSharedFragment T>
T & GetSharedFragmentData () const
 
template<UE::Mass::CSharedFragment T>
T * GetSharedFragmentDataPtr () const
 
template<UE::Mass::CConstSharedFragment T>
T * GetSharedFragmentDataPtr () const
 
template<UE::Mass::CConstSharedFragment T>
T & GetSharedFragmentData () const
 
FStructView GetSharedFragmentDataStruct (const UScriptStruct *FragmentType) const
 
template<typename T >
bool HasTag () const
 
UE_API bool HasTag (const UScriptStruct &TagType) const
 
bool IsSet () const
 
bool IsValid () const
 
bool operator== (const FMassEntityView &Other) const
 

Static Public Member Functions

static UE_API FMassEntityView TryMakeView (const FMassEntityManager &EntityManager, FMassEntityHandle Entity)
 

Protected Member Functions

UE_API voidGetFragmentPtr (const UScriptStruct &FragmentType) const
 
UE_API voidGetFragmentPtrChecked (const UScriptStruct &FragmentType) const
 
UE_API const voidGetConstSharedFragmentPtr (const UScriptStruct &FragmentType) const
 
UE_API const voidGetConstSharedFragmentPtrChecked (const UScriptStruct &FragmentType) const
 
UE_API voidGetSharedFragmentPtr (const UScriptStruct &FragmentType) const
 
UE_API voidGetSharedFragmentPtrChecked (const UScriptStruct &FragmentType) const
 

Detailed Description

The type representing a single entity in a single archetype. It's of a very transient nature so we guarantee it's validity only within the scope it has been created in. Don't store it.

Constructor & Destructor Documentation

◆ FMassEntityView() [1/3]

FMassEntityView::FMassEntityView ( )
default

◆ FMassEntityView() [2/3]

FMassEntityView::FMassEntityView ( const FMassArchetypeHandle ArchetypeHandle,
FMassEntityHandle  Entity 
)

Resolves Entity against ArchetypeHandle. Note that this approach requires the caller to ensure that Entity indeed belongs to ArchetypeHandle. If not the call will fail a check. As a remedy calling the FMassEntityManager-flavored constructor is recommended since it will first find the appropriate archetype for Entity.

◆ FMassEntityView() [3/3]

FMassEntityView::FMassEntityView ( const FMassEntityManager EntityManager,
FMassEntityHandle  Entity 
)

Finds the archetype Entity belongs to and then resolves against it. The caller is responsible for ensuring that the given Entity is in fact a valid ID tied to any of the archetypes

Member Function Documentation

◆ GetConstSharedFragmentData()

template<typename T >
const T & FMassEntityView::GetConstSharedFragmentData ( ) const
inline

will fail a check if the viewed entity doesn't have the given const shared fragment

◆ GetConstSharedFragmentDataPtr()

template<typename T >
const T * FMassEntityView::GetConstSharedFragmentDataPtr ( ) const
inline

if the viewed entity doesn't have the given const shared fragment the function will return null

◆ GetConstSharedFragmentDataStruct()

FConstStructView FMassEntityView::GetConstSharedFragmentDataStruct ( const UScriptStruct FragmentType) const
inline

◆ GetConstSharedFragmentPtr()

const void * FMassEntityView::GetConstSharedFragmentPtr ( const UScriptStruct FragmentType) const
protected

◆ GetConstSharedFragmentPtrChecked()

const void * FMassEntityView::GetConstSharedFragmentPtrChecked ( const UScriptStruct FragmentType) const
protected

◆ GetEntity()

FMassEntityHandle FMassEntityView::GetEntity ( ) const
inline

◆ GetFragmentData()

template<typename T >
T & FMassEntityView::GetFragmentData ( ) const
inline

will fail a check if the viewed entity doesn't have the given fragment

◆ GetFragmentDataPtr()

template<typename T >
T * FMassEntityView::GetFragmentDataPtr ( ) const
inline

if the viewed entity doesn't have the given fragment the function will return null

◆ GetFragmentDataStruct()

FStructView FMassEntityView::GetFragmentDataStruct ( const UScriptStruct FragmentType) const
inline

◆ GetFragmentPtr()

void * FMassEntityView::GetFragmentPtr ( const UScriptStruct FragmentType) const
protected

◆ GetFragmentPtrChecked()

void * FMassEntityView::GetFragmentPtrChecked ( const UScriptStruct FragmentType) const
protected

◆ GetSharedFragmentData() [1/2]

T & FMassEntityView::GetSharedFragmentData ( ) const
inline

will fail a check if the viewed entity doesn't have the given shared fragment

◆ GetSharedFragmentData() [2/2]

T & FMassEntityView::GetSharedFragmentData ( ) const
inline

◆ GetSharedFragmentDataPtr() [1/2]

T * FMassEntityView::GetSharedFragmentDataPtr ( ) const
inline

if the viewed entity doesn't have the given shared fragment the function will return null

◆ GetSharedFragmentDataPtr() [2/2]

T * FMassEntityView::GetSharedFragmentDataPtr ( ) const
inline

◆ GetSharedFragmentDataStruct()

FStructView FMassEntityView::GetSharedFragmentDataStruct ( const UScriptStruct FragmentType) const
inline

◆ GetSharedFragmentPtr()

void * FMassEntityView::GetSharedFragmentPtr ( const UScriptStruct FragmentType) const
protected

◆ GetSharedFragmentPtrChecked()

void * FMassEntityView::GetSharedFragmentPtrChecked ( const UScriptStruct FragmentType) const
protected

◆ HasTag() [1/2]

template<typename T >
bool FMassEntityView::HasTag ( ) const
inline

◆ HasTag() [2/2]

bool FMassEntityView::HasTag ( const UScriptStruct TagType) const

◆ IsSet()

bool FMassEntityView::IsSet ( ) const
inline

◆ IsValid()

bool FMassEntityView::IsValid ( ) const
inline

◆ operator==()

bool FMassEntityView::operator== ( const FMassEntityView Other) const
inline

◆ TryMakeView()

FMassEntityView FMassEntityView::TryMakeView ( const FMassEntityManager EntityManager,
FMassEntityHandle  Entity 
)
static

If the given handle represents a valid entity the function will create a FMassEntityView just like a constructor would. If the entity is not valid the produced view will be "unset".


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