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

The global state manager. More...

#include <Machine.h>

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

Public Types

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

Public Member Functions

EApparatusStatus CopyTraits (const FSubjectHandle &SrcSubjectHandle, const FSubjectHandle &DstSubjectHandle)
 Copy an existing subject traits to another one. More...
 
void BeginDestroy () override
 Destroy the machine object. More...
 

Static Public Member Functions

static int32 ObtainTraitId (const UScriptStruct *TraitType)
 Obtain a trait's unique identifier. More...
 
static int32 RegisteredTraitsNum ()
 Get the total number of registered traits so far. More...
 
static const FBitMaskObtainTraitMask (const UScriptStruct *TraitType)
 Obtain the cached mask for a trait type. More...
 
template<class T >
static const FBitMaskObtainTraitMask ()
 Obtain the mask of a trait. More...
 
static int32 ObtainDetailId (const TSubclassOf< UDetail > DetailClass)
 Obtain a detail's unique identifier. More...
 
static int32 RegisteredDetailsNum ()
 Get the total number of registered details so far. More...
 
static const FBitMaskObtainDetailMask (const TSubclassOf< UDetail > DetailClass)
 Obtain the cached mask of a detail type. More...
 
static const FBitMaskObtainExcludedDetailMask (const TSubclassOf< UDetail > DetailClass)
 Obtain the excluded mask of a detail class. More...
 
static const FBitMaskObtainDetailMask (const UDetail *Detail)
 Obtain the cached mask of a detail's class. More...
 
static const FBitMaskObtainExcludedDetailMask (const UDetail *Detail)
 Obtain the excluded mask of a details's class. More...
 
template<class T >
static const FBitMaskObtainDetailMask ()
 Obtain the mask of a detail class. More...
 
template<class T >
static const FBitMaskObtainExcludedDetailMask ()
 Obtain the excluding mask of a detail class. More...
 
static UMachineObtainInstance ()
 Obtain the global machine instance. More...
 
static UMechanismObtainMechanism (UWorld *const InWorld)
 Obtain a mechanism instance for a world. More...
 
static bool HasInstance ()
 Check if there is a global machine instance currently. More...
 
static EApparatusStatus DespawnSubject (const FSubjectHandle &SubjectHandle)
 Despawn a subject. More...
 
static EApparatusStatus DespawnAllSubjects ()
 Despawn all the available subjects. More...
 
static EApparatusStatus Reset ()
 Reset the machine completely, unregistering all of the entities. More...
 

Friends

class IIterable
 
class ISubjective
 
class IMechanical
 
class UBelt
 
class UChunk
 
class UMechanism
 
class UApparatusFunctionLibrary
 
struct FSubjectInfo
 
struct FSubjectHandleBase
 
template<typename SubjectHandleT >
struct TChunkIt
 
template<typename SubjectHandleT >
struct TBeltIt
 
template<typename ChunkItT , typename BeltItT >
struct TChain
 

Detailed Description

The global state manager.

This is the root Apparatus object. It is created automatically and persists until it's no longer needed.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidChainId 

Invalid chain identifier.

FirstChainId 

First valid chain identifier.

Member Function Documentation

◆ BeginDestroy()

void UMachine::BeginDestroy ( )
inlineoverride

Destroy the machine object.

This should happen when the machine is no longer needed.

◆ CopyTraits()

EApparatusStatus UMachine::CopyTraits ( const FSubjectHandle SrcSubjectHandle,
const FSubjectHandle DstSubjectHandle 
)
inline

Copy an existing subject traits to another one.

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

Parameters
SrcSubjectHandleThe source subject handle to copy from.
DstSubjectHandleThe destination subject handle to copy to.

◆ DespawnAllSubjects()

static EApparatusStatus UMachine::DespawnAllSubjects ( )
inlinestatic

Despawn all the available subjects.

Returns
The status of the operation.

◆ DespawnSubject()

static EApparatusStatus UMachine::DespawnSubject ( const FSubjectHandle SubjectHandle)
inlinestatic

Despawn a subject.

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

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

◆ HasInstance()

static bool UMachine::HasInstance ( )
inlinestatic

Check if there is a global machine instance currently.

◆ ObtainDetailId()

static int32 UMachine::ObtainDetailId ( const TSubclassOf< UDetail DetailClass)
inlinestatic

Obtain a detail's unique identifier.

◆ ObtainDetailMask() [1/3]

template<class T >
static const FBitMask& UMachine::ObtainDetailMask ( )
inlinestatic

Obtain the mask of a detail class.

◆ ObtainDetailMask() [2/3]

static const FBitMask& UMachine::ObtainDetailMask ( const TSubclassOf< UDetail DetailClass)
inlinestatic

Obtain the cached mask of a detail type.

◆ ObtainDetailMask() [3/3]

static const FBitMask& UMachine::ObtainDetailMask ( const UDetail Detail)
inlinestatic

Obtain the cached mask of a detail's class.

◆ ObtainExcludedDetailMask() [1/3]

template<class T >
static const FBitMask& UMachine::ObtainExcludedDetailMask ( )
inlinestatic

Obtain the excluding mask of a detail class.

◆ ObtainExcludedDetailMask() [2/3]

static const FBitMask& UMachine::ObtainExcludedDetailMask ( const TSubclassOf< UDetail DetailClass)
inlinestatic

Obtain the excluded mask of a detail class.

◆ ObtainExcludedDetailMask() [3/3]

static const FBitMask& UMachine::ObtainExcludedDetailMask ( const UDetail Detail)
inlinestatic

Obtain the excluded mask of a details's class.

◆ ObtainInstance()

static UMachine* UMachine::ObtainInstance ( )
inlinestatic

Obtain the global machine instance.

The returned instance doesn't actually gets retained and will be a subject to garbage collection, unless retained if needed.

◆ ObtainMechanism()

static UMechanism* UMachine::ObtainMechanism ( UWorld *const  InWorld)
inlinestatic

Obtain a mechanism instance for a world.

Parameters
InWorldA world to obtain a mechanism for.
Returns
The resulting mechanism.

◆ ObtainTraitId()

static int32 UMachine::ObtainTraitId ( const UScriptStruct *  TraitType)
inlinestatic

Obtain a trait's unique identifier.

◆ ObtainTraitMask() [1/2]

template<class T >
static const FBitMask& UMachine::ObtainTraitMask ( )
inlinestatic

Obtain the mask of a trait.

◆ ObtainTraitMask() [2/2]

static const FBitMask& UMachine::ObtainTraitMask ( const UScriptStruct *  TraitType)
inlinestatic

Obtain the cached mask for a trait type.

◆ RegisteredDetailsNum()

static int32 UMachine::RegisteredDetailsNum ( )
inlinestatic

Get the total number of registered details so far.

◆ RegisteredTraitsNum()

static int32 UMachine::RegisteredTraitsNum ( )
inlinestatic

Get the total number of registered traits so far.

◆ Reset()

EApparatusStatus UMachine::Reset ( )
inlinestatic

Reset the machine completely, unregistering all of the entities.

Returns
The status of the operation.

Friends And Related Function Documentation

◆ FSubjectHandleBase

friend struct FSubjectHandleBase
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ IIterable

friend class IIterable
friend

◆ IMechanical

friend class IMechanical
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

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UBelt

friend class UBelt
friend

◆ UChunk

friend class UChunk
friend

◆ UMechanism

friend class UMechanism
friend

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