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

The scoped state manager. More...

#include <Mechanism.h>

Inheritance diagram for UMechanism:
Inheritance graph
[legend]
Collaboration diagram for UMechanism:
Collaboration graph
[legend]

Public Types

enum  { InvalidChainId = FChain::InvalidId , FirstChainId = FChain::FirstId }
 

Public Member Functions

const TSet< TWeakInterfacePtr< ISubjective > > & GetSubjectives ()
 All of the subjectives currently available and registered. More...
 
FAdjectiveInfoGetAdjective (const int32 Id)
 Get subject information by an identifier. More...
 
EApparatusStatus FindBeltsMatchingFingerprint (const struct FFingerprint &Fingerprint, TArray< UBelt * > &OutBelts)
 Get all of the belts matching a fingerprint. More...
 
EApparatusStatus BootAll ()
 Boot all of the halted subjectives currently present in the Mechanism. More...
 
template<typename IterableT , typename ChainT = FChain>
EApparatusStatus EnchainIterables (const FFilter &Filter, int32 &OutChainId)
 Enchain multiple iterables with a filter. More...
 
template<typename ChainT = FChain>
EApparatusStatus Enchain (const FFilter &Filter, int32 &OutChainId)
 Enchain multiple iterable sequences based on a filter. More...
 
template<typename ChainT = FChain>
ChainT * Enchain (const FFilter &Filter, EApparatusStatus &OutStatus)
 Enchain multiple iterable sequences based on a filter, returning the resulting chain pointer and a status via an argument. More...
 
template<typename ChainT = FChain>
ChainT * Enchain (const FFilter &Filter)
 Enchain multiple iterable sequences based on a filter, returning a pointer to the resulting chain. More...
 
FSolidChainEnchainSolid (const FFilter &Filter)
 Enchain multiple iterable sequences based on a filter, returning a pointer to a solid chain. More...
 
EApparatusStatus HandleDetailsChange (TScriptInterface< ISubjective > Subjective)
 Handle the subjective change. More...
 
EApparatusStatus RegisterSubjective (TScriptInterface< ISubjective > Subjective)
 Register a subjective within the mechanism. More...
 
EApparatusStatus UnregisterSubjective (TScriptInterface< ISubjective > Subjective)
 Remove a subjective from the mechanism completely. More...
 
EApparatusStatus UnregisterAllSubjectives ()
 Unregister all of the currently registered subjectives. More...
 
UBeltObtainMostSpecificBelt (UObject *BeltOwner, TScriptInterface< ISubjective > Subjective)
 Find or create the most specific belt for a subject. More...
 
template<typename ChainT = FChain>
ChainT & ObtainChain (const int32 ChainId) const
 Obtain a chain for a specific identifier. More...
 
template<typename ChainT = FChain>
ChainT & ObtainChain () const
 Obtain an unused chain of a specific type. More...
 
EApparatusStatus RegisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Register a mechanical within the mechanism. More...
 
EApparatusStatus UnregisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Unregister a mechanical from the mechanism. More...
 
EApparatusStatus UnregisterAllMechanicals ()
 Unregister all of the currently registered mechanicals. More...
 
UChunkObtainChunk (const struct FTraitmark &Traitmark, EApparatusStatus &OutStatus, const int32 Capacity=32)
 Find existing or create a new chunk for a traitmark. More...
 
UChunkObtainChunk (const struct FTraitmark &Traitmark, const int32 Capacity=32)
 Find existing or create a new chunk for a traitmark. More...
 
EApparatusStatus SpawnSubject (struct FSubjectHandle &SubjectHandle)
 Spawn a new subject within the mechanism. More...
 
FSubjectHandle SpawnSubject ()
 Spawn a new subject within the mechanism, returning the handle to the caller. More...
 
template<typename ... Ts>
FSubjectHandle SpawnSubject (Ts &&... Traits)
 Spawn a new subject with traits, returning the handle. More...
 
FSubjectHandle SpawnSubject (UScriptStruct *TraitType, void *TraitData)
 Spawn a new subject with a typed trait data, returning the handle. More...
 
EApparatusStatus DespawnAllSubjects ()
 Despawn all of the subjects currently available within the mechanism. More...
 
EApparatusStatus Reset ()
 Reset the mechanism completely, unregistering all of the entities and despawning all of the subjects. More...
 
bool IsSolid ()
 Is the mechanism currently in the uniform mode preventing any structural changes to its subjects and subjectives. More...
 
void BeginDestroy () override
 Destroy the mechanism object. More...
 

Friends

class IIterable
 
class UBelt
 
class UChunk
 
class UApparatusFunctionLibrary
 
struct FSubjectInfo
 
struct FSubjectHandleBase
 
template<typename SubjectHandleT >
struct TChunkIt
 
template<typename SubjectHandleT >
struct TBeltIt
 

Detailed Description

The scoped state manager.

An instance of UMechanism is created automatically per UWorld (if needed). Subjects(ives) and mechanics reside here.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidChainId 

Invalid chain identifier.

FirstChainId 

First valid chain identifier.

Member Function Documentation

◆ BeginDestroy()

void UMechanism::BeginDestroy ( )
inlineoverride

Destroy the mechanism object.

This should happen when the mechanism is no longer needed.

◆ BootAll()

EApparatusStatus UMechanism::BootAll ( )
inline

Boot all of the halted subjectives currently present in the Mechanism.

◆ DespawnAllSubjects()

EApparatusStatus UMechanism::DespawnAllSubjects ( )
inline

Despawn all of the subjects currently available within the mechanism.

Returns
The status of the operation.

◆ Enchain() [1/3]

template<typename ChainT = FChain>
ChainT* UMechanism::Enchain ( const FFilter Filter)
inline

Enchain multiple iterable sequences based on a filter, returning a pointer to the resulting chain.

◆ Enchain() [2/3]

template<typename ChainT = FChain>
ChainT* UMechanism::Enchain ( const FFilter Filter,
EApparatusStatus OutStatus 
)
inline

Enchain multiple iterable sequences based on a filter, returning the resulting chain pointer and a status via an argument.

◆ Enchain() [3/3]

template<typename ChainT = FChain>
EApparatusStatus UMechanism::Enchain ( const FFilter Filter,
int32 &  OutChainId 
)
inline

Enchain multiple iterable sequences based on a filter.

◆ EnchainIterables()

template<typename IterableT , typename ChainT = FChain>
EApparatusStatus UMechanism::EnchainIterables ( const FFilter Filter,
int32 &  OutChainId 
)
inline

Enchain multiple iterables with a filter.

Template Parameters
IterableTThe type of iterable to enchain.
ChainTThe type of chain to enchain with.
Parameters
FilterThe filter to enchain with.
OutChainIdThe output chain id receiver.

◆ EnchainSolid()

FSolidChain* UMechanism::EnchainSolid ( const FFilter Filter)
inline

Enchain multiple iterable sequences based on a filter, returning a pointer to a solid chain.

◆ FindBeltsMatchingFingerprint()

EApparatusStatus UMechanism::FindBeltsMatchingFingerprint ( const struct FFingerprint Fingerprint,
TArray< UBelt * > &  OutBelts 
)
inline

Get all of the belts matching a fingerprint.

◆ GetAdjective()

FAdjectiveInfo& UMechanism::GetAdjective ( const int32  Id)
inline

Get subject information by an identifier.

◆ GetSubjectives()

const TSet<TWeakInterfacePtr<ISubjective> >& UMechanism::GetSubjectives ( )
inline

All of the subjectives currently available and registered.

◆ HandleDetailsChange()

EApparatusStatus UMechanism::HandleDetailsChange ( TScriptInterface< ISubjective Subjective)
inline

Handle the subjective change.

◆ IsSolid()

bool UMechanism::IsSolid ( )
inline

Is the mechanism currently in the uniform mode preventing any structural changes to its subjects and subjectives.

◆ ObtainChain() [1/2]

template<typename ChainT = FChain>
ChainT& UMechanism::ObtainChain ( ) const
inline

Obtain an unused chain of a specific type.

◆ ObtainChain() [2/2]

template<typename ChainT = FChain>
ChainT& UMechanism::ObtainChain ( const int32  ChainId) const
inline

Obtain a chain for a specific identifier.

◆ ObtainChunk() [1/2]

UChunk* UMechanism::ObtainChunk ( const struct FTraitmark Traitmark,
const int32  Capacity = 32 
)
inline

Find existing or create a new chunk for a traitmark.

Parameters
TraitmarkA traitmark to ensure for.
CapacityThe desired capacity of the chunk.
Returns
The resulting chunk.

◆ ObtainChunk() [2/2]

UChunk* UMechanism::ObtainChunk ( const struct FTraitmark Traitmark,
EApparatusStatus OutStatus,
const int32  Capacity = 32 
)
inline

Find existing or create a new chunk for a traitmark.

Parameters
TraitmarkA traitmark to ensure for.
OutStatusThe status of the operation.
CapacityThe desired capacity of the chunk.
Returns
The resulting chunk.

◆ ObtainMostSpecificBelt()

UBelt* UMechanism::ObtainMostSpecificBelt ( UObject *  BeltOwner,
TScriptInterface< ISubjective Subjective 
)

Find or create the most specific belt for a subject.

◆ RegisterMechanical()

EApparatusStatus UMechanism::RegisterMechanical ( TScriptInterface< IMechanical Mechanical)
inline

Register a mechanical within the mechanism.

Parameters
MechanicalA mechanical to register.
Returns
The status of the operation.

◆ RegisterSubjective()

EApparatusStatus UMechanism::RegisterSubjective ( TScriptInterface< ISubjective Subjective)
inline

Register a subjective within the mechanism.

Only an un-booted subjective can be registered.

◆ Reset()

EApparatusStatus UMechanism::Reset ( )
inline

Reset the mechanism completely, unregistering all of the entities and despawning all of the subjects.

Returns
The status of the operation.

◆ SpawnSubject() [1/4]

FSubjectHandle UMechanism::SpawnSubject ( )
inline

Spawn a new subject within the mechanism, returning the handle to the caller.

Returns
A subject handle to initialize with the new entity.

◆ SpawnSubject() [2/4]

EApparatusStatus UMechanism::SpawnSubject ( struct FSubjectHandle SubjectHandle)
inline

Spawn a new subject within the mechanism.

Parameters
SubjectHandleA subject handle to initialize with the new entity.
Returns
The status of the operation.

◆ SpawnSubject() [3/4]

template<typename ... Ts>
FSubjectHandle UMechanism::SpawnSubject ( Ts &&...  Traits)
inline

Spawn a new subject with traits, returning the handle.

Template Parameters
TsThe types of traits to spawn with.
Parameters
TraitsThe traits to spawn with.
Returns
A handle for the newly spawned subject.

◆ SpawnSubject() [4/4]

FSubjectHandle UMechanism::SpawnSubject ( UScriptStruct *  TraitType,
void *  TraitData 
)
inline

Spawn a new subject with a typed trait data, returning the handle.

Returns
A subject handle to initialize with the new entity.

◆ UnregisterAllMechanicals()

EApparatusStatus UMechanism::UnregisterAllMechanicals ( )
inline

Unregister all of the currently registered mechanicals.

◆ UnregisterAllSubjectives()

EApparatusStatus UMechanism::UnregisterAllSubjectives ( )
inline

Unregister all of the currently registered subjectives.

◆ UnregisterMechanical()

EApparatusStatus UMechanism::UnregisterMechanical ( TScriptInterface< IMechanical Mechanical)
inline

Unregister a mechanical from the mechanism.

Parameters
MechanicalA mechanical to unregister.
Returns
The status of the operation.

◆ UnregisterSubjective()

EApparatusStatus UMechanism::UnregisterSubjective ( TScriptInterface< ISubjective Subjective)
inline

Remove a subjective from the mechanism completely.

Friends And Related Function Documentation

◆ FSubjectHandleBase

friend struct FSubjectHandleBase
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ IIterable

friend class IIterable
friend

◆ TBeltIt

template<typename SubjectHandleT >
friend struct TBeltIt
friend

◆ TChunkIt

template<typename SubjectHandleT >
friend struct TChunkIt
friend

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UBelt

friend class UBelt
friend

◆ UChunk

friend class UChunk
friend

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