Apparatus Version 1.3.0
ECS data-driven workflow for Unreal Engine.
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
UMachine Class Reference

The global mechanism manager. More...

#include <Machine.h>

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

Public Types

enum  { InvalidChunkChainId = -1 , InvalidBeltChainId = -1 }
 

Public Member Functions

 ~UMachine ()
 Destroy the machine object. More...
 
template<typename TAllocator >
EApparatusStatus DoFindMatchingBelts (const FFilter &Filter, TArray< UBelt *, TAllocator > &OutBelts)
 

Static Public Member Functions

static const TSet< TWeakInterfacePtr< ISubjective > > & GetSubjectives ()
 All of the subjectives currently available and registered. More...
 
static FAdjectiveInfoGetAdjective (const int32 Id)
 Get subject information by an identifier. More...
 
static EApparatusStatus FindBeltsMatchingFingerprint (const struct FFingerprint &Fingerprint, TArray< class UBelt * > &OutBelts)
 Get all of the belts matching a fingerprint. More...
 
template<typename TAllocator >
static EApparatusStatus FindMatchingBelts (const struct FFilter &Filter, TArray< class UBelt *, TAllocator > &OutBelts)
 Find all of the belts matching a specific filter. More...
 
template<typename TAllocator >
static EApparatusStatus FindMatchingChunks (const FFilter &Filter, TArray< UChunk *, TAllocator > &OutChunks)
 Find all of the chunks matching a specific filter. More...
 
static EApparatusStatus BootAll ()
 Boot all of the halted subjectives currently present. More...
 
static EApparatusStatus EnchainBelts (const FFilter &Filter, int32 &OutBeltChainId)
 Buffer multiple belts with a filter. More...
 
static EApparatusStatus EnchainChunks (const FFilter &Filter, int32 &OutChunkChainId)
 Enchain multiple traits with a filter. More...
 
static EApparatusStatus HandleDetailsChange (TScriptInterface< ISubjective > Subjective)
 Handle the subjective change. More...
 
static EApparatusStatus RegisterSubjective (TScriptInterface< ISubjective > Subjective)
 Register a subjective within the mechanism. More...
 
static EApparatusStatus UnregisterSubjective (TScriptInterface< ISubjective > Subjective)
 Remove a subjective from the mechanism completely. More...
 
static class UBeltObtainMostSpecificBelt (UObject *BeltOwner, TScriptInterface< ISubjective > Subjective)
 Find or create the most specific belt for a subject. More...
 
static class UMachineObtainInstance ()
 Obtain the global machine instance. More...
 
static bool HasInstance ()
 Check if there is a global machine instance currently. More...
 
static FBeltChainObtainBeltChain (const int32 BeltChainId)
 Obtain a belt chain for a specific identifier. More...
 
static FChunkChainObtainChunkChain (const int32 ChunkChainId)
 Obtain a chunk chain for a specific identifier. More...
 
static EApparatusStatus RegisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Register a mechanical within the mechanism. More...
 
static EApparatusStatus UnregisterMechanical (TScriptInterface< IMechanical > Mechanical)
 Unregister a mechanical from the mechanism. More...
 
static EApparatusStatus UnregisterAllMechanicals ()
 Unregister all of the currently registered mechanicals. More...
 
static class UChunkObtainChunk (const struct FTraitmark &Traitmark, EApparatusStatus &OutStatus, const int32 Capacity=32)
 Find existing or create a new chunk for a traitmark. More...
 
static EApparatusStatus Spawn (struct FSubjectHandle &SubjectHandle)
 Spawn a new subject. More...
 
static EApparatusStatus Despawn (const FSubjectHandle &SubjectHandle)
 Despawn a subject. More...
 
static EApparatusStatus DespawnAll ()
 Despawn all of the subjects currently available. More...
 
static EApparatusStatus Reset ()
 Reset the machine completely, unregistering all of the entities and despawning all of the subjects. More...
 

Friends

class UBelt
 
class UChunk
 
class UApparatusFunctionLibrary
 
struct FChunkIt
 
struct FSubjectHandle
 
struct FChunkChain
 

Detailed Description

The global mechanism manager.

The root object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidChunkChainId 

Invalid chunk chain identifier.

InvalidBeltChainId 

Invalid belt chain identifier.

Constructor & Destructor Documentation

◆ ~UMachine()

UMachine::~UMachine ( )
inline

Destroy the machine object.

This should happen when the machine is no longer needed.

Member Function Documentation

◆ BootAll()

EApparatusStatus UMachine::BootAll ( )
inlinestatic

Boot all of the halted subjectives currently present.

◆ Despawn()

EApparatusStatus UMachine::Despawn ( const FSubjectHandle SubjectHandle)
inlinestatic

Despawn a subject.

If the handle is not viable, nothing is performed and EApparatusStatus::LegalNoop is returned.

Parameters
SubjectHandleThe handle for a subject to despawn.
Returns
The status of the operation.

◆ DespawnAll()

EApparatusStatus UMachine::DespawnAll ( )
inlinestatic

Despawn all of the subjects currently available.

Returns
The status of the operation.

◆ DoFindMatchingBelts()

template<typename TAllocator >
EApparatusStatus UMachine::DoFindMatchingBelts ( const FFilter Filter,
TArray< UBelt *, TAllocator > &  OutBelts 
)
inline

◆ EnchainBelts()

EApparatusStatus UMachine::EnchainBelts ( const FFilter Filter,
int32 &  OutBeltChainId 
)
inlinestatic

Buffer multiple belts with a filter.

◆ EnchainChunks()

EApparatusStatus UMachine::EnchainChunks ( const FFilter Filter,
int32 &  OutChunkChainId 
)
inlinestatic

Enchain multiple traits with a filter.

◆ FindBeltsMatchingFingerprint()

EApparatusStatus UMachine::FindBeltsMatchingFingerprint ( const struct FFingerprint Fingerprint,
TArray< class UBelt * > &  OutBelts 
)
inlinestatic

Get all of the belts matching a fingerprint.

◆ FindMatchingBelts()

template<typename TAllocator >
EApparatusStatus UMachine::FindMatchingBelts ( const struct FFilter Filter,
TArray< class UBelt *, TAllocator > &  OutBelts 
)
inlinestatic

Find all of the belts matching a specific filter.

◆ FindMatchingChunks()

template<typename TAllocator >
EApparatusStatus UMachine::FindMatchingChunks ( const FFilter Filter,
TArray< UChunk *, TAllocator > &  OutChunks 
)
inlinestatic

Find all of the chunks matching a specific filter.

◆ GetAdjective()

static FAdjectiveInfo& UMachine::GetAdjective ( const int32  Id)
inlinestatic

Get subject information by an identifier.

◆ GetSubjectives()

static const TSet<TWeakInterfacePtr<ISubjective> >& UMachine::GetSubjectives ( )
inlinestatic

All of the subjectives currently available and registered.

◆ HandleDetailsChange()

EApparatusStatus UMachine::HandleDetailsChange ( TScriptInterface< ISubjective Subjective)
inlinestatic

Handle the subjective change.

◆ HasInstance()

static bool UMachine::HasInstance ( )
inlinestatic

Check if there is a global machine instance currently.

◆ ObtainBeltChain()

static FBeltChain& UMachine::ObtainBeltChain ( const int32  BeltChainId)
inlinestatic

Obtain a belt chain for a specific identifier.

◆ ObtainChunk()

class UChunk * UMachine::ObtainChunk ( const struct FTraitmark Traitmark,
EApparatusStatus &  OutStatus,
const int32  Capacity = 32 
)
inlinestatic

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.

◆ ObtainChunkChain()

static FChunkChain& UMachine::ObtainChunkChain ( const int32  ChunkChainId)
inlinestatic

Obtain a chunk chain for a specific identifier.

◆ ObtainInstance()

static class UMachine* UMachine::ObtainInstance ( )
inlinestatic

Obtain the global machine instance.

◆ ObtainMostSpecificBelt()

static class UBelt* UMachine::ObtainMostSpecificBelt ( UObject *  BeltOwner,
TScriptInterface< ISubjective Subjective 
)
static

Find or create the most specific belt for a subject.

◆ RegisterMechanical()

EApparatusStatus UMachine::RegisterMechanical ( TScriptInterface< IMechanical Mechanical)
inlinestatic

Register a mechanical within the mechanism.

Parameters
MechanicalA mechanical to register.

◆ RegisterSubjective()

EApparatusStatus UMachine::RegisterSubjective ( TScriptInterface< ISubjective Subjective)
inlinestatic

Register a subjective within the mechanism.

Only an un-booted subjective can be registered.

◆ Reset()

EApparatusStatus UMachine::Reset ( )
inlinestatic

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

Returns
The status of the operation.

◆ Spawn()

EApparatusStatus UMachine::Spawn ( struct FSubjectHandle SubjectHandle)
inlinestatic

Spawn a new subject.

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

◆ UnregisterAllMechanicals()

static EApparatusStatus UMachine::UnregisterAllMechanicals ( )
inlinestatic

Unregister all of the currently registered mechanicals.

◆ UnregisterMechanical()

static EApparatusStatus UMachine::UnregisterMechanical ( TScriptInterface< IMechanical Mechanical)
inlinestatic

Unregister a mechanical from the mechanism.

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

◆ UnregisterSubjective()

EApparatusStatus UMachine::UnregisterSubjective ( TScriptInterface< ISubjective Subjective)
inlinestatic

Remove a subjective from the mechanism completely.

Friends And Related Function Documentation

◆ FChunkChain

friend struct FChunkChain
friend

◆ FChunkIt

friend struct FChunkIt
friend

◆ FSubjectHandle

friend struct FSubjectHandle
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 file: