Apparatus Version 1.8
ECS data-oriented workflow for Unreal Engine.
Public Types | Public Member Functions | Friends | List of all members
FSubjectInfo Struct Reference

The internal state for the main subject entity. More...

#include <SubjectInfo.h>

Public Types

enum  {
  InvalidId = 0 , FirstId = 1 , InvalidIndex = -1 , InvalidGeneration = 0 ,
  FirstGeneration = 1 , GenerationMax = TNumericLimits<int32>::Max()
}
 

Public Member Functions

bool IsValid () const
 Check if this an information block about some spawned subject. More...
 
UChunkGetChunk () const
 Get the chunk this subject resides in. More...
 
UMechanismGetMechanism () const
 Get the mechanism the subject resides in. More...
 
bool IsSolid () const
 Check if the subject is in a solid state now. More...
 
const FFingerprintGetFingerprint () const
 Get the active fingerprint of the subject. More...
 
FSubjectHandle GetHandle ()
 Get the subject handle corresponding to this information structure. More...
 
EApparatusStatus GetHandle (FSubjectHandle &OutSubject)
 Get a constant subject handle from the subject information. More...
 
EApparatusStatus GetHandle (FSolidSubjectHandle &OutSubject)
 Get a uniform handle from the subject information. More...
 
FConstSubjectHandle GetHandle () const
 Get the subject handle corresponding to this information structure. More...
 
FSolidSubjectHandle GetSolidHandle ()
 Get the uniform subject handle corresponding to this information structure. More...
 
EApparatusStatus GetHandle (FConstSubjectHandle &OutSubject) const
 Get a constant subject handle from the subject information. More...
 
TScriptInterface< ISubjectiveGetSubjective () const
 Get the subjective associated with a subject (if any). More...
 
EApparatusStatus SetTrait (UScriptStruct *TraitType, const void *const TraitData)
 Set a trait of the subject by its type. More...
 
template<typename T >
EApparatusStatus SetTrait (const T &Trait)
 Set a trait of the subject. More...
 
void * GetTraitPtr (UScriptStruct *const TraitType)
 Get a trait data pointer from a subject by its type. More...
 
const void * GetTraitPtr (UScriptStruct *const TraitType) const
 Get a read-only trait data pointer from a subject by its type. More...
 
template<typename T >
T * GetTraitPtr ()
 Get a trait data pointer from a subject by its type. More...
 
template<typename T >
const T * GetTraitPtr () const
 Get a read-only trait data pointer from a subject by its type. More...
 
template<typename T >
T & GetTraitRef ()
 Get a trait reference from a subject by its type. More...
 
template<typename T >
const T & GetTraitRef () const
 Get a read-only trait reference from a subject by its type. More...
 
EApparatusStatus GetTrait (UScriptStruct *const TraitType, void *const TraitData, const bool bTraitDataInitialized=true) const
 Get a trait from a subject by its type. More...
 
template<typename T >
EApparatusStatus GetTrait (T &OutTrait, const bool bTraitDataInitialized=true) const
 Get a trait from a subject by its type. More...
 
template<typename T >
GetTrait () const
 Get a trait copy from a subject by its type. More...
 
EApparatusStatus ObtainTrait (UScriptStruct *const TraitType, void *const TraitData, const bool bTraitDataInitialized=true)
 Obtain a trait from a subject by its type. More...
 
template<typename T >
EApparatusStatus ObtainTrait (T &OutTrait, const bool bTraitDataInitialized=true)
 Obtain a trait from a subject. More...
 
template<typename T >
ObtainTrait ()
 Obtain a trait from a subject. More...
 
EApparatusStatus RemoveTrait (UScriptStruct *TraitType)
 Remove a trait from the subject. More...
 
template<typename T >
EApparatusStatus RemoveTrait ()
 Remove a trait from the subject. More...
 
EApparatusStatus CopyTraitsTo (FSubjectInfo *const Destination) const
 Copy the traits to some other subject. More...
 
EApparatusStatus Despawn ()
 Destroy the subject. More...
 

Friends

struct FSubjectHandleBase
 
struct FSubjectHandle
 
struct FSolidSubjectHandle
 
struct FConstSubjectHandle
 
class UChunk
 
template<typename SubjectHandleT >
struct TChunkIt
 
template<typename SubjectHandleT >
struct TBeltIt
 
template<typename ChunkItT , typename BeltItT >
struct TChain
 
class UMachine
 
class UMechanism
 
class ISubjective
 

Detailed Description

The internal state for the main subject entity.

Subjects are not used directly but instead are referenced through FSubjectHandle and FSolidSubjectHandle.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidId 

Invalid subject identifier.

FirstId 

First valid subject identifier.

InvalidIndex 

Invalid subject index.

InvalidGeneration 

Invalid subject generation.

FirstGeneration 

The first valid generation.

GenerationMax 

The maximum valid generation.

Member Function Documentation

◆ CopyTraitsTo()

EApparatusStatus FSubjectInfo::CopyTraitsTo ( FSubjectInfo *const  Destination) const
inline

Copy the traits to some other subject.

The existing traits of the destination subject are not removed but the new ones are added and/or override the existing matching.

Parameters
DestinationThe destination subject to copy to.
Returns
The status of the operation.

◆ Despawn()

EApparatusStatus FSubjectInfo::Despawn ( )
inline

Destroy the subject.

Returns
The status of the operation.

◆ GetChunk()

UChunk* FSubjectInfo::GetChunk ( ) const
inline

Get the chunk this subject resides in.

◆ GetFingerprint()

const FFingerprint& FSubjectInfo::GetFingerprint ( ) const
inline

Get the active fingerprint of the subject.

◆ GetHandle() [1/5]

FSubjectHandle FSubjectInfo::GetHandle ( )
inline

Get the subject handle corresponding to this information structure.

Returns
The subject handle.

◆ GetHandle() [2/5]

FConstSubjectHandle FSubjectInfo::GetHandle ( ) const
inline

Get the subject handle corresponding to this information structure.

Constant version.

Returns
The subject handle.

◆ GetHandle() [3/5]

EApparatusStatus FSubjectInfo::GetHandle ( FConstSubjectHandle OutSubject) const
inline

Get a constant subject handle from the subject information.

Constant version.

Parameters
OutSubjectThe constant subject handle to initialize.
Returns
The status of the operation.

◆ GetHandle() [4/5]

EApparatusStatus FSubjectInfo::GetHandle ( FSolidSubjectHandle OutSubject)
inline

Get a uniform handle from the subject information.

Parameters
OutSubjectThe uniform subject handle to initialize.
Returns
The status of the operation.

◆ GetHandle() [5/5]

EApparatusStatus FSubjectInfo::GetHandle ( FSubjectHandle OutSubject)
inline

Get a constant subject handle from the subject information.

Parameters
OutSubjectThe subject handle to initialize.
Returns
The status of the operation.

◆ GetMechanism()

UMechanism * FSubjectInfo::GetMechanism ( ) const
inline

Get the mechanism the subject resides in.

◆ GetSolidHandle()

FSolidSubjectHandle FSubjectInfo::GetSolidHandle ( )
inline

Get the uniform subject handle corresponding to this information structure.

Constant version.

Returns
The uniform subject handle.

◆ GetSubjective()

TScriptInterface<ISubjective> FSubjectInfo::GetSubjective ( ) const
inline

Get the subjective associated with a subject (if any).

◆ GetTrait() [1/3]

template<typename T >
T FSubjectInfo::GetTrait ( ) const
inline

Get a trait copy from a subject by its type.

Templated version.

Template Parameters
TThe type of the trait to get.
Returns
A copy of the trait.

◆ GetTrait() [2/3]

template<typename T >
EApparatusStatus FSubjectInfo::GetTrait ( T &  OutTrait,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait from a subject by its type.

Templated version.

Template Parameters
TThe type of the trait to get.
Parameters
OutTraitThe trait receiver.
bTraitDataInitializedIs the OutTrait actually initialized?
Returns
The status of the operation.

◆ GetTrait() [3/3]

EApparatusStatus FSubjectInfo::GetTrait ( UScriptStruct *const  TraitType,
void *const  TraitData,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait from a subject by its type.

Parameters
TraitTypeThe type of the trait to get.
TraitDataThe trait data receiver.
bTraitDataInitializedIs the TraitData buffer actually initialized?
Returns
The status of the operation.

◆ GetTraitPtr() [1/4]

template<typename T >
T* FSubjectInfo::GetTraitPtr ( )
inline

Get a trait data pointer from a subject by its type.

Templated version.

Template Parameters
TThe type of the trait to get.
Returns
A pointer to the trait data.

◆ GetTraitPtr() [2/4]

template<typename T >
const T* FSubjectInfo::GetTraitPtr ( ) const
inline

Get a read-only trait data pointer from a subject by its type.

Templated version.

Template Parameters
TThe type of the trait to get.
Returns
A pointer to the read-only trait data.

◆ GetTraitPtr() [3/4]

void * FSubjectInfo::GetTraitPtr ( UScriptStruct *const  TraitType)
inline

Get a trait data pointer from a subject by its type.

Parameters
TraitTypeThe type of the trait to get.
Returns
A pointer to the trait data.

◆ GetTraitPtr() [4/4]

const void * FSubjectInfo::GetTraitPtr ( UScriptStruct *const  TraitType) const
inline

Get a read-only trait data pointer from a subject by its type.

Parameters
TraitTypeThe type of the trait to get.
Returns
A pointer to the read-only trait data.

◆ GetTraitRef() [1/2]

template<typename T >
T& FSubjectInfo::GetTraitRef ( )
inline

Get a trait reference from a subject by its type.

Templated version.

Template Parameters
TThe type of the trait to get.
Returns
A reference to the trait data.

◆ GetTraitRef() [2/2]

template<typename T >
const T& FSubjectInfo::GetTraitRef ( ) const
inline

Get a read-only trait reference from a subject by its type.

Constant templated version.

Template Parameters
TThe type of the trait to get.
Returns
A reference to the read-only trait data.

◆ IsSolid()

bool FSubjectInfo::IsSolid ( ) const
inline

Check if the subject is in a solid state now.

◆ IsValid()

bool FSubjectInfo::IsValid ( ) const
inline

Check if this an information block about some spawned subject.

◆ ObtainTrait() [1/3]

template<typename T >
T FSubjectInfo::ObtainTrait ( )
inline

Obtain a trait from a subject.

Templated version.

If the trait is not currently within the subject, it gets created anew and returned.

Template Parameters
TThe type of the trait to obtain.
Returns
A trait copy.

◆ ObtainTrait() [2/3]

template<typename T >
EApparatusStatus FSubjectInfo::ObtainTrait ( T &  OutTrait,
const bool  bTraitDataInitialized = true 
)
inline

Obtain a trait from a subject.

Templated version.

If the trait is not currently within the subject, it gets created anew and the default value gets copied to the receiver.

Template Parameters
TThe type of the trait to obtain.
Parameters
OutTraitThe trait receiver.
bTraitDataInitializedIs the OutTrait actually initialized?
Returns
The status of the operation.

◆ ObtainTrait() [3/3]

EApparatusStatus FSubjectInfo::ObtainTrait ( UScriptStruct *const  TraitType,
void *const  TraitData,
const bool  bTraitDataInitialized = true 
)
inline

Obtain a trait from a subject by its type.

If the trait is not currently within the subject, it gets created anewand the default value gets copied to the receiver.

Parameters
TraitTypeThe type of the trait to obtain.
TraitDataThe trait data receiver.
bTraitDataInitializedIs the TraitData buffer actually initialized?
Returns
The status of the operation.

◆ RemoveTrait() [1/2]

template<typename T >
EApparatusStatus FSubjectInfo::RemoveTrait ( )
inline

Remove a trait from the subject.

Templated version.

If there is no such trait in the subject, nothing is performed and EApparatusStatus::Noop is returned.

Template Parameters
TThe type of the trait to remove.
Returns
The status of the operation.

◆ RemoveTrait() [2/2]

EApparatusStatus FSubjectInfo::RemoveTrait ( UScriptStruct *  TraitType)
inline

Remove a trait from the subject.

If there is no such trait in the subject, nothing is performed and EApparatusStatus::Noop is returned.

Parameters
TraitTypeThe type of the trait to remove.
Returns
The status of the operation.

◆ SetTrait() [1/2]

template<typename T >
EApparatusStatus FSubjectInfo::SetTrait ( const T &  Trait)
inline

Set a trait of the subject.

Templated version.

If the trait is not currently within the subject, it gets created anew and set accordingly.

Template Parameters
TA type of the trait to add.
Parameters
TraitA trait to initialize with.
Returns
The status of the operation.

◆ SetTrait() [2/2]

EApparatusStatus FSubjectInfo::SetTrait ( UScriptStruct *  TraitType,
const void *const  TraitData 
)
inline

Set a trait of the subject by its type.

If the trait is not currently within the subject, it gets created anew and set accordingly

Parameters
TraitTypeThe type of the trait to add.
TraitDataThe trait data to initialize with.
Returns
The status of the operation.

Friends And Related Function Documentation

◆ FConstSubjectHandle

friend struct FConstSubjectHandle
friend

◆ FSolidSubjectHandle

friend struct FSolidSubjectHandle
friend

◆ FSubjectHandle

friend struct FSubjectHandle
friend

◆ FSubjectHandleBase

friend struct FSubjectHandleBase
friend

◆ ISubjective

friend class ISubjective
friend

◆ TBeltIt

template<typename SubjectHandleT >
friend struct TBeltIt
friend

◆ TChain

template<typename ChunkItT , typename BeltItT >
friend struct TChain
friend

◆ TChunkIt

template<typename SubjectHandleT >
friend struct TChunkIt
friend

◆ UChunk

friend class UChunk
friend

◆ UMachine

friend class UMachine
friend

◆ UMechanism

friend class UMechanism
friend

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