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

An interface for all sorts of subjectives. More...

#include <Subjective.h>

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

Public Types

enum  { InvalidSlotIndex = -1 }
 

Public Member Functions

AMechanismGetMechanism () const
 Get the mechanism this subjective is currently part of (if registered). More...
 
const TArray< FTraitRecord > & GetTraitRecordsRef () const
 Direct access for the internal traits array. More...
 
virtual const TArray< UDetail * > & GetDetailsRef () const
 Direct access for the internal details array. More...
 
const FFingerprintGetFingerprint () const
 Get the active fingerprint of the subjective. More...
 
bool Matches (const FFilter &InFilter) const
 Check if the subjective matches a supplied filter. More...
 
bool Matches (const FTraitmark &InTraitmark) const
 Check if the subjective matches a supplied traitmark as a filter. More...
 
bool Matches (const FDetailmark &InDetailmark) const
 Check if the subjective matches a supplied detailmark as a filter. More...
 
UBeltGetPreferredBelt () const
 Get the preferred belt of the subjective (if any). More...
 
const struct FBeltSlotGetSlot () const
 Get the current belt slot of the subjective (if any). More...
 
bool IsRegistered () const
 Check if the subjective is registered within the machine. More...
 
int32 GetSlotIndex () const
 Get the current slot index of the subjective. More...
 
bool IsBooted () const
 Check if the subject is booted. More...
 
FSubjectHandle GetHandle ()
 Get the subject handle of this subjective. More...
 
FConstSubjectHandle GetHandle () const
 Get the subject handle of this subjective. More...
 
EApparatusStatus Unregister ()
 Unregister the subjective from its mechanism in a manual fashion. More...
 
virtual uint32 CalcHash () const
 Calculate the hash of the subjective. More...
 
void ReceiveHandleDespawned ()
 Called when the subject handle is despawned. More...
 
virtual void HandleDespawned ()
 Called when the subject handle is despawned. More...
 
virtual AActor * GetActor () const
 Get an actor corresponding to the subjective (if any). More...
 
Flagmark
EFlagmark GetFlagmark () const
 Get the current flagmark of the subjective. More...
 
EApparatusStatus SetFlagmark (const EFlagmark InFlagmark)
 Set the current flagmark for the subjective. More...
 
bool HasFlag (const EFlagmarkBit Flag) const
 Get the current state of a flag for the subjective. More...
 
EApparatusStatus SetFlag (const EFlagmarkBit Flag, const bool bState=true)
 Set a flag for the subjective. More...
 
void ToggleFlag (const EFlagmarkBit Flag)
 Toggle a flag for the subjective. More...
 
Traits
bool HasTrait (UScriptStruct *const TraitType) const
 Check if the subjective has a certain trait. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), bool >::type HasTrait () const
 Check if there is a trait of a specific type in the subjective. More...
 
EApparatusStatus SetTrait (UScriptStruct *const TraitType, const void *const TraitData)
 Set a trait of the subjective by its type. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type SetTrait (const T &Trait)
 Set a trait of the subjective. More...
 
EApparatusStatus GetTrait (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait from a subjective by its type. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type GetTrait (T &OutTrait, const bool bTraitDataInitialized=true) const
 Get a trait from a subjective by its type. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), T >::type GetTrait () const
 Get a copy of a trait from a subjective by its type. More...
 
template<EParadigm Paradigm = EParadigm::Safe>
const void * GetTraitPtr (UScriptStruct *const TraitType) const
 Get the trait data from a subjective by its type. More...
 
template<EParadigm Paradigm = EParadigm::Safe>
void * GetTraitPtr (UScriptStruct *const TraitType)
 Get the trait data from a subjective by its type. More...
 
template<typename T , EParadigm Paradigm = EParadigm::Safe>
std::enable_if< IsTraitType< T >()&&(Paradigm<=EParadigm::Unsafe), constT * >::type GetTraitPtr ()
 Get the trait data from a subjective by its type. More...
 
template<typename T , EParadigm Paradigm = EParadigm::Safe>
std::enable_if< IsTraitType< T >()&&(Paradigm<=EParadigm::Unsafe), T * >::type GetTraitPtr ()
 Get the trait data from a subjective by its type. More...
 
EApparatusStatus ObtainTrait (UScriptStruct *TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true)
 Obtain a trait from a subjective by its type. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type ObtainTrait (T &OutTrait, const bool bTraitDataInitialized=true)
 Obtain a trait from a subjective. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), T >::type ObtainTrait ()
 Get a copy of an obtained trait from a subjective. More...
 
EApparatusStatus RemoveTrait (UScriptStruct *const TraitType)
 Remove a trait from the subjective. More...
 
template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type RemoveTrait ()
 Remove a trait from the subjective. More...
 
EApparatusStatus RemoveAllTraits ()
 Remove all of the traits from the subjective. More...
 
Details
void GetDetails (const bool bIncludeDisabled, TArray< UDetail * > &OutDetails) const
 Get all of the details of the subjective. More...
 
void GetDetails (TArray< UDetail * > &OutDetails) const
 Get all the enabled details of the subjective. More...
 
UDetailFindDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 
template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type FindDetail (const bool bIncludeDisabled=false) const
 
UDetailGetDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 Get a detail by its class. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type GetDetail (const bool bIncludeDisabled=false) const
 Get a detail by its class. More...
 
void GetDetails (TSubclassOf< UDetail > DetailClass, TArray< UDetail * > &OutDetails, const bool bIncludeDisabled=false) const
 Get all of the details of a certain class. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), void >::type GetDetails (TArray< D * > &OutDetails, const bool bIncludeDisabled=false) const
 Get details of a certain class. More...
 
void FindDetails (TSubclassOf< UDetail > DetailClass, TArray< UDetail * > &OutDetails, const bool bIncludeDisabled=false) const
 
bool HasDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 Check if there is a detail of a specific class in the subjective. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), bool >::type HasDetail (const bool bIncludeDisabled=false) const
 Check if there is a detail of a specific class in the subjective. More...
 
UDetailEnableDetail (const TSubclassOf< UDetail > DetailClass)
 Enable a detail of a certain type. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type EnableDetail ()
 Enable a detail of a certain type. More...
 
UDetailAddDetail (const TSubclassOf< UDetail > DetailClass, const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type AddDetail (const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one. More...
 
EApparatusStatus DisableDetail (const TSubclassOf< UDetail > DetailClass, const bool bDisableMultiple=false)
 Disable detail(s) by class. More...
 
template<class D >
std::enable_if< IsDetailClass< D >(), EApparatusStatus >::type DisableDetail (const bool bDisableMultiple=false)
 Disable detail(s) by class. More...
 
Networking
virtual bool IsNetworkCapable () const
 Check if the subjective class is capable of networking. More...
 
uint32 GetNetworkId () const
 Get the unique cross-peer network identifier of the subjective (if any). More...
 
bool IsServerSide () const
 Check if the subjective is a server-side one. More...
 
bool IsClientSide () const
 Check if the subjective is a client-side one. More...
 
UNetConnection * GetConnectionPermit () const
 Get the server-side connection to a client from which it is allowed to push traits to this subjective. More...
 
void SetConnectionPermit (UNetConnection *const Connection)
 Set the server-side connection to a client from which it is allowed to push traits to this subjective. More...
 
const FTraitmarkGetTraitmarkPermit () const
 Get the server-side list of traits allowed to be received from clients. More...
 
const FTraitmarkGetTraitmarkPass () const
 
EApparatusStatus SetTraitmarkPermit (const FTraitmark &InTraitmarkPermit)
 Set the server-side list of traits allowed to be received from clients. More...
 
EApparatusStatus SetTraitmarkPass (const FTraitmark &InTraitmarkPermit)
 
void PushTrait (UScriptStruct *const TraitType, const EPeerRole PeerRole=EPeerRole::None)
 Send an existing trait to a remote peer. More...
 
virtual void PushTrait (UScriptStruct *const TraitType, const void *const TraitData, const bool bSetForLocal=false, const EPeerRole PeerRole=EPeerRole::None)
 Send an additional trait to a remote peer. More...
 

Static Public Member Functions

static bool IsValidSubjective (const ISubjective *const InSubjective)
 

Protected Member Functions

bool MarkBooted ()
 Set the subjective as booted. More...
 
void TakeBeltSlot (UBelt *const InBelt, const int32 InSlotIndex)
 Set or reset the current belt slot of the subjective. More...
 
virtual FStandardSubjectivePropertyBlockDoGetStandardPropertyBlock ()
 
virtual FStandardSubjectivePropertyBlockDoGetStandardPropertyBlock () const
 
FStandardSubjectivePropertyBlockGetStandardPropertyBlock ()
 
const FStandardSubjectivePropertyBlockGetStandardPropertyBlock () const
 
virtual FStandardSubjectiveNetworkPropertyBlockDoGetStandardNetworkPropertyBlock ()
 
virtual FStandardSubjectiveNetworkPropertyBlockDoGetStandardNetworkPropertyBlock () const
 
FStandardSubjectiveNetworkPropertyBlockGetStandardNetworkPropertyBlock ()
 
const FStandardSubjectiveNetworkPropertyBlockGetStandardNetworkPropertyBlock () const
 
const int32 & GetFlagmarkPropRef () const
 Get the internal flagmark property reference. More...
 
int32 & GetFlagmarkPropRef ()
 Get the internal flagmark property reference. More...
 
TArray< FTraitRecord > & GetTraitRecordsRef ()
 Direct access for the internal traits array. More...
 
TArray< UDetail * > & GetDetailsRef ()
 Direct access for the internal details array. More...
 
void TakeBeltSlot (std::nullptr_t)
 Reset the belt slot. More...
 
void ClientReceiveNetworkId_Implementation (const uint32 NetworkId)
 Assign a unique network identifier to the subject of the subjective. More...
 
void ServerRequestNetworkId_Implementation ()
 Request a unique network identifier for the subject of the subjective. More...
 
void ReceiveTrait_Implementation (UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a trait on the server or the client. More...
 
virtual void AssignNetworkIdOnClient (const uint32 NetworkId)
 Assign a network identifier on a client. More...
 
virtual void ObtainNetworkIdFromServer ()
 Obtain a networking subject identifier from the server. More...
 
void TakeBeltSlot (const int32 InSlotIndex)
 Change the current slot of the subjective, while preserving the belt. More...
 
UBeltGetBelt () const
 Get the active belt of the subjective (if any). More...
 
FFingerprintGetFingerprintRef ()
 Get the internal fingerprint of the subjective. More...
 
const FFingerprintGetFingerprintRef () const
 Get the internal fingerprint of the subjective. More...
 
struct FBeltSlotGetSlotPtr ()
 Get the current belt slot of the subjective (if any). More...
 
void DoRegister ()
 Perform an actual registration of the subjective. More...
 
EApparatusStatus DoUnregister ()
 Perform an actual de-registration procedure on the subjective. More...
 
void DoStartSerialization (FArchive &Archive)
 Begin the serialization routine. More...
 
void DoFinishSerialization (FArchive &Archive)
 End the serialization routine. More...
 
bool DoesHaveTraitRecord (UScriptStruct *const TraitType) const
 
const FTraitRecord * DoFindTraitRecord (UScriptStruct *const TraitType) const
 
EApparatusStatus DoGetTraitRecord (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 
EApparatusStatus DoSetTraitRecord (UScriptStruct *TraitType, const void *const TraitData)
 
const FTraitRecord & DoObtainTraitRecord (UScriptStruct *const TraitType)
 
EApparatusStatus DoObtainTraitRecord (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true)
 
EApparatusStatus DoRemoveTraitRecord (UScriptStruct *const TraitType)
 
EApparatusStatus DoRemoveAllTraitRecords ()
 
virtual bool ShouldBeReplicated () const
 Check if the entity be replicated. More...
 
template<class S >
void DoPushTrait (S *const Subjective, UScriptStruct *const TraitType, const void *const TraitData, bool bSetForLocal, EPeerRole PeerRole, void(S::*ServerReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ClientReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData))
 Push a trait to the remote version of the subject. More...
 

Protected Attributes

UBeltBelt = nullptr
 A reference to a current subjective's belt (if any). More...
 
int32 SlotIndex = InvalidSlotIndex
 The index of the belt slot, this subject currently resides in. More...
 
FSubjectHandle Handle
 The subject handle which points to a global subjects registry. More...
 
bool bUnregistered = false
 Was the subjective already unregistered via the normal DoUnregister() means. More...
 
FStandardSubjectivePropertyBlockStandardPropertyBlockCache = nullptr
 
FStandardSubjectiveNetworkPropertyBlockStandardNetworkPropertyBlockCache = nullptr
 

Friends

struct FFingerprint
 
struct FBeltSlot
 
struct FBeltSlotCache
 
struct FSubjectInfo
 
class UDetail
 
class UBelt
 
class AMechanism
 
class UMachine
 
class UApparatusFunctionLibrary
 
class ISolidSubjective
 

Detailed Description

An interface for all sorts of subjectives.

All of the subjectives are essentially subjects design-wise and inherit all of their functionality internally.

Note
The current semantic for the constant subjectives is basically being solid in terms of iterating on them.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidSlotIndex 

Invalid belt slot index.

Member Function Documentation

◆ AddDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type ISubjective::AddDetail ( const bool  bReuseDisabled = false)
inline

Add a new active detail or reuse an inactive one.

Templated version.

Template Parameters
DA class of detail to add.
Parameters
bReuseDisabledShould disabled details be reused instead of adding a new one?
Returns
The newly added detail.

◆ AddDetail() [2/2]

UDetail * ISubjective::AddDetail ( const TSubclassOf< UDetail DetailClass,
const bool  bReuseDisabled = false 
)
inline

Add a new active detail or reuse an inactive one.

Parameters
DetailClassA class of detail to add.
bReuseDisabledShould disabled details be reused instead of adding a new one?
Returns
The newly added detail.

◆ AssignNetworkIdOnClient()

virtual void ISubjective::AssignNetworkIdOnClient ( const uint32  NetworkId)
inlineprotectedvirtual

Assign a network identifier on a client.

Should be implemented via a client RPC.

Reimplemented in ASubjectiveActor, and USubjectiveActorComponent.

◆ CalcHash()

virtual uint32 ISubjective::CalcHash ( ) const
inlinevirtual

Calculate the hash of the subjective.

Reimplemented in ISolidSubjective.

◆ ClientReceiveNetworkId_Implementation()

void ISubjective::ClientReceiveNetworkId_Implementation ( const uint32  NetworkId)
protected

Assign a unique network identifier to the subject of the subjective.

The standard implementation for the RPC.

◆ DisableDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), EApparatusStatus >::type ISubjective::DisableDetail ( const bool  bDisableMultiple = false)
inline

Disable detail(s) by class.

Templated version.

Details can't be removed from subjectives. They can only be disabled.

◆ DisableDetail() [2/2]

EApparatusStatus ISubjective::DisableDetail ( const TSubclassOf< UDetail DetailClass,
const bool  bDisableMultiple = false 
)
inline

Disable detail(s) by class.

Details can't be removed from subjectives. They can only be disabled.

Parameters
DetailClassA class of detail(s) to disable.
bDisableMultipleShould all matching details be disabled instead of first one?
Returns
The status of the operation.

◆ DoesHaveTraitRecord()

bool ISubjective::DoesHaveTraitRecord ( UScriptStruct *const  TraitType) const
inlineprotected

◆ DoFindTraitRecord()

const FTraitRecord * ISubjective::DoFindTraitRecord ( UScriptStruct *const  TraitType) const
inlineprotected

◆ DoFinishSerialization()

void ISubjective::DoFinishSerialization ( FArchive &  Archive)
protected

End the serialization routine.

◆ DoGetStandardNetworkPropertyBlock() [1/2]

virtual FStandardSubjectiveNetworkPropertyBlock * ISubjective::DoGetStandardNetworkPropertyBlock ( )
inlineprotectedvirtual

◆ DoGetStandardNetworkPropertyBlock() [2/2]

virtual FStandardSubjectiveNetworkPropertyBlock * ISubjective::DoGetStandardNetworkPropertyBlock ( ) const
inlineprotectedvirtual

◆ DoGetStandardPropertyBlock() [1/2]

virtual FStandardSubjectivePropertyBlock * ISubjective::DoGetStandardPropertyBlock ( )
inlineprotectedvirtual

◆ DoGetStandardPropertyBlock() [2/2]

virtual FStandardSubjectivePropertyBlock * ISubjective::DoGetStandardPropertyBlock ( ) const
inlineprotectedvirtual

◆ DoGetTraitRecord()

EApparatusStatus ISubjective::DoGetTraitRecord ( UScriptStruct *const  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
) const
inlineprotected

◆ DoObtainTraitRecord() [1/2]

const FTraitRecord & ISubjective::DoObtainTraitRecord ( UScriptStruct *const  TraitType)
inlineprotected

◆ DoObtainTraitRecord() [2/2]

EApparatusStatus ISubjective::DoObtainTraitRecord ( UScriptStruct *const  TraitType,
void *const  OutTraitData,
const bool  bTraitDataInitialized = true 
)
inlineprotected

◆ DoPushTrait()

template<class S >
void ISubjective::DoPushTrait ( S *const  Subjective,
UScriptStruct *const  TraitType,
const void *const  TraitData,
bool  bSetForLocal,
EPeerRole  PeerRole,
void(S::*)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData)  ServerReceiveTraitRPC,
void(S::*)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData)  ClientReceiveTraitRPC 
)
inlineprotected

Push a trait to the remote version of the subject.

Standard implementation.

Parameters
SubjectiveThe subjective to use.
TraitTypeThe type of the trait to push.
TraitDataThe trait data to push.
bSetForLocalShould the trait also be set for the local version of the subject.
PeerRoleThe peer role specification. If left as EPeerRole::None, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.
ServerReceiveTraitRPCThe RPC to receive the trait on a server.
ClientReceiveTraitRPCThe RPC to receive the trait on a client.

◆ DoRegister()

void ISubjective::DoRegister ( )
protected

Perform an actual registration of the subjective.

Calls the UMechanism::RegisterSubjective() method in turn.

◆ DoRemoveAllTraitRecords()

EApparatusStatus ISubjective::DoRemoveAllTraitRecords ( )
inlineprotected

◆ DoRemoveTraitRecord()

EApparatusStatus ISubjective::DoRemoveTraitRecord ( UScriptStruct *const  TraitType)
inlineprotected

◆ DoSetTraitRecord()

EApparatusStatus ISubjective::DoSetTraitRecord ( UScriptStruct *  TraitType,
const void *const  TraitData 
)
inlineprotected

◆ DoStartSerialization()

void ISubjective::DoStartSerialization ( FArchive &  Archive)
protected

Begin the serialization routine.

◆ DoUnregister()

EApparatusStatus ISubjective::DoUnregister ( )
protected

Perform an actual de-registration procedure on the subjective.

◆ EnableDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type ISubjective::EnableDetail ( )
inline

Enable a detail of a certain type.

Templated version.

Adds the detail if there is none of the class already, or reuses an inactive one, enabling it.

Template Parameters
DA class of detail to enable.
Returns
The enabled detail.

◆ EnableDetail() [2/2]

UDetail * ISubjective::EnableDetail ( const TSubclassOf< UDetail DetailClass)
inline

Enable a detail of a certain type.

Adds the detail if there is none of the class already, or reuses an inactive one, enabling it.

Parameters
DetailClassA class of detail to enable.
Returns
The enabled detail.

◆ FindDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type ISubjective::FindDetail ( const bool  bIncludeDisabled = false) const
inline
Deprecated:
Find a detail by its class. Templated version.

Supports searching by a base class.

Template Parameters
DThe class of the detail to search for.
Parameters
bIncludeDisabledShould disabled details be included?
Returns
A detail of the specified class if found, nullptr otherwise.

◆ FindDetail() [2/2]

UDetail * ISubjective::FindDetail ( TSubclassOf< UDetail DetailClass,
const bool  bIncludeDisabled = false 
) const
inline
Deprecated:
Find a detail by its class.

Supports searching by a base class.

Parameters
DetailClassThe class of the detail to search for.
bIncludeDisabledShould disabled details be included?
Returns
A detail of the specified class if found, nullptr otherwise.

◆ FindDetails()

void ISubjective::FindDetails ( TSubclassOf< UDetail DetailClass,
TArray< UDetail * > &  OutDetails,
const bool  bIncludeDisabled = false 
) const
inline
Deprecated:
Find the details by their class.

Supports searching by a base class.

◆ GetActor()

virtual AActor * ISubjective::GetActor ( ) const
inlinevirtual

Get an actor corresponding to the subjective (if any).

Must be overridden in the descendants if they can derive an actor from itselves.

The default implementation just returns nullptr.

Returns
An actor this subjective belongs to.
nullptr if the subject doesn't belong to any actor.

Reimplemented in ISolidSubjective, ASubjectiveActor, and USubjectiveActorComponent.

◆ GetBelt()

UBelt * ISubjective::GetBelt ( ) const
inlineprotected

Get the active belt of the subjective (if any).

◆ GetConnectionPermit()

UNetConnection * ISubjective::GetConnectionPermit ( ) const
inline

Get the server-side connection to a client from which it is allowed to push traits to this subjective.

Returns
The active connection pass.

◆ GetDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), D * >::type ISubjective::GetDetail ( const bool  bIncludeDisabled = false) const
inline

Get a detail by its class.

Templated version.

Supports searching by a base class.

Template Parameters
DThe type of the detail to get.
Parameters
bIncludeDisabledShould disabled details be included?
Returns
A detail of the specified type.
nullptr If there is no such detail in the subjective.

◆ GetDetail() [2/2]

UDetail * ISubjective::GetDetail ( TSubclassOf< UDetail DetailClass,
const bool  bIncludeDisabled = false 
) const
inline

Get a detail by its class.

Supports searching by a base class.

Parameters
DetailClassThe class of the detail to search for.
bIncludeDisabledShould disabled details be considered?
Returns
A detail of the specified class.
nullptr If there is no such detail within the subjective.

◆ GetDetails() [1/4]

void ISubjective::GetDetails ( const bool  bIncludeDisabled,
TArray< UDetail * > &  OutDetails 
) const
inline

Get all of the details of the subjective.

Parameters
bIncludeDisabledShould disabled details be included?
OutDetailsAn array to store the details in.

◆ GetDetails() [2/4]

template<class D >
std::enable_if< IsDetailClass< D >(), void >::type ISubjective::GetDetails ( TArray< D * > &  OutDetails,
const bool  bIncludeDisabled = false 
) const
inline

Get details of a certain class.

Templated version.

Supports searching by a base class.

Template Parameters
DThe class of the details to collect.
Parameters
OutDetailsThe output array to store the details in.
bIncludeDisabledShould disabled details be collected.

◆ GetDetails() [3/4]

void ISubjective::GetDetails ( TArray< UDetail * > &  OutDetails) const
inline

Get all the enabled details of the subjective.

Parameters
OutDetailsAn array to store the details in.

◆ GetDetails() [4/4]

void ISubjective::GetDetails ( TSubclassOf< UDetail DetailClass,
TArray< UDetail * > &  OutDetails,
const bool  bIncludeDisabled = false 
) const
inline

Get all of the details of a certain class.

Supports searching by a base class.

Parameters
DetailClassThe class of the details to collect.
OutDetailsThe output array to store the details in.
bIncludeDisabledShould disabled details be collected.

◆ GetDetailsRef() [1/2]

TArray< UDetail * > & ISubjective::GetDetailsRef ( )
inlineprotected

Direct access for the internal details array.

◆ GetDetailsRef() [2/2]

virtual const TArray< UDetail * > & ISubjective::GetDetailsRef ( ) const
inlinevirtual

Direct access for the internal details array.

Constant version.

◆ GetFingerprint()

const FFingerprint & ISubjective::GetFingerprint ( ) const
inline

Get the active fingerprint of the subjective.

Constant version.

◆ GetFingerprintRef() [1/2]

FFingerprint & ISubjective::GetFingerprintRef ( )
inlineprotected

Get the internal fingerprint of the subjective.

◆ GetFingerprintRef() [2/2]

const FFingerprint & ISubjective::GetFingerprintRef ( ) const
inlineprotected

Get the internal fingerprint of the subjective.

Constant version.

◆ GetFlagmark()

EFlagmark ISubjective::GetFlagmark ( ) const
inline

Get the current flagmark of the subjective.

◆ GetFlagmarkPropRef() [1/2]

int32 & ISubjective::GetFlagmarkPropRef ( )
inlineprotected

Get the internal flagmark property reference.

◆ GetFlagmarkPropRef() [2/2]

const int32 & ISubjective::GetFlagmarkPropRef ( ) const
inlineprotected

Get the internal flagmark property reference.

Constant version.

◆ GetHandle() [1/2]

FSubjectHandle ISubjective::GetHandle ( )
inline

Get the subject handle of this subjective.

◆ GetHandle() [2/2]

FConstSubjectHandle ISubjective::GetHandle ( ) const
inline

Get the subject handle of this subjective.

Constant version.

◆ GetMechanism()

AMechanism * ISubjective::GetMechanism ( ) const
inline

Get the mechanism this subjective is currently part of (if registered).

◆ GetNetworkId()

uint32 ISubjective::GetNetworkId ( ) const
inline

Get the unique cross-peer network identifier of the subjective (if any).

◆ GetPreferredBelt()

UBelt * ISubjective::GetPreferredBelt ( ) const
inline

Get the preferred belt of the subjective (if any).

◆ GetSlot()

const struct FBeltSlot * ISubjective::GetSlot ( ) const
inline

Get the current belt slot of the subjective (if any).

Constant version.

Returns
The active belt slot of the subject or nullptr, if the subject is not (yet) part of any belt.

◆ GetSlotIndex()

int32 ISubjective::GetSlotIndex ( ) const
inline

Get the current slot index of the subjective.

◆ GetSlotPtr()

struct FBeltSlot * ISubjective::GetSlotPtr ( )
inlineprotected

Get the current belt slot of the subjective (if any).

Returns
The active belt slot of the subject or nullptr, if the subject is not (yet) part of any belt.

◆ GetStandardNetworkPropertyBlock() [1/2]

FStandardSubjectiveNetworkPropertyBlock & ISubjective::GetStandardNetworkPropertyBlock ( )
inlineprotected

◆ GetStandardNetworkPropertyBlock() [2/2]

const FStandardSubjectiveNetworkPropertyBlock & ISubjective::GetStandardNetworkPropertyBlock ( ) const
inlineprotected

◆ GetStandardPropertyBlock() [1/2]

FStandardSubjectivePropertyBlock & ISubjective::GetStandardPropertyBlock ( )
inlineprotected

◆ GetStandardPropertyBlock() [2/2]

const FStandardSubjectivePropertyBlock & ISubjective::GetStandardPropertyBlock ( ) const
inlineprotected

◆ GetTrait() [1/3]

template<typename T >
std::enable_if< IsTraitType< T >(), T >::type ISubjective::GetTrait ( ) const
inline

Get a copy of a trait from a subjective by its type.

Templated version.

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

◆ GetTrait() [2/3]

template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type ISubjective::GetTrait ( T OutTrait,
const bool  bTraitDataInitialized = true 
) const
inline

Get a trait from a subjective by its type.

Templated version.

If the trait is missing within the subject, the output data is unchanged and EApparatusStatus::NotFound is returned.

Template Parameters
TThe type of the trait to get.
Parameters
[out]OutTraitThe trait receiver.
[in]bTraitDataInitializedIs the OutTrait actually initialized?
Returns
The status of the operation.
EApparatusStatus::Noop If there is no such trait in the subject.

◆ GetTrait() [3/3]

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

Get a trait from a subjective by its type.

If the trait is missing within the subject, the behavior is undefined and an assertion may be raised.

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

◆ GetTraitmarkPass()

const FTraitmark & ISubjective::GetTraitmarkPass ( ) const
inline

◆ GetTraitmarkPermit()

const FTraitmark & ISubjective::GetTraitmarkPermit ( ) const
inline

Get the server-side list of traits allowed to be received from clients.

Can only be queried on a server-side subjective version.

Returns
The current traitmark pass whitelist.

◆ GetTraitPtr() [1/4]

template<typename T , EParadigm Paradigm = EParadigm::Safe>
std::enable_if< IsTraitType< T >()&&(Paradigm<=EParadigm::Unsafe), constT * >::type ISubjective::GetTraitPtr ( )
inline

Get the trait data from a subjective by its type.

Templated constant version.

If the trait is missing within the subject, a nullptr is returned.

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

◆ GetTraitPtr() [2/4]

template<typename T , EParadigm Paradigm = EParadigm::Safe>
std::enable_if< IsTraitType< T >()&&(Paradigm<=EParadigm::Unsafe), T * >::type ISubjective::GetTraitPtr ( )
inline

Get the trait data from a subjective by its type.

Templated version.

If the trait is missing within the subject, a nullptr is returned.

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

◆ GetTraitPtr() [3/4]

template<EParadigm Paradigm = EParadigm::Safe>
void * ISubjective::GetTraitPtr ( UScriptStruct *const  TraitType)
inline

Get the trait data from a subjective by its type.

If the trait is missing within the subject, a nullptr is returned.

Parameters
TraitTypeThe type of the trait to get. Must not be a nullptr.
Returns
A pointer to the trait's data.
nullptr If there is no such trait in the subjective.

◆ GetTraitPtr() [4/4]

template<EParadigm Paradigm = EParadigm::Safe>
const void * ISubjective::GetTraitPtr ( UScriptStruct *const  TraitType) const
inline

Get the trait data from a subjective by its type.

Constant version.

If the trait is missing within the subject, a nullptr is returned.

Parameters
TraitTypeThe type of the trait to get. Must not be a nullptr.
Returns
A pointer to the trait's data.
nullptr If there is no such trait in the subjective.

◆ GetTraitRecordsRef() [1/2]

TArray< FTraitRecord > & ISubjective::GetTraitRecordsRef ( )
inlineprotected

Direct access for the internal traits array.

Mutable version.

◆ GetTraitRecordsRef() [2/2]

const TArray< FTraitRecord > & ISubjective::GetTraitRecordsRef ( ) const
inline

Direct access for the internal traits array.

Constant version.

◆ HandleDespawned()

virtual void ISubjective::HandleDespawned ( )
inlinevirtual

Called when the subject handle is despawned.

This method should basically self-destruct the subjective or finalize it somehow.

This method should never fail or raise any assertions.

If the self-destruction is not possible or not available for the subjective class, just silently exit the routine.

By default the top-level implementation of the method calls the respective blueprint event and exits silently.

Reimplemented in ASubjectiveActor, USubjectiveActorComponent, and USubjectiveUserWidget.

◆ HasDetail() [1/2]

template<class D >
std::enable_if< IsDetailClass< D >(), bool >::type ISubjective::HasDetail ( const bool  bIncludeDisabled = false) const
inline

Check if there is a detail of a specific class in the subjective.

Templated version.

Supports examining by a base class.

Template Parameters
DThe class of the detail to test for.
Parameters
bIncludeDisabledShould disabled details be considered?
Returns
The state of examination.

◆ HasDetail() [2/2]

bool ISubjective::HasDetail ( TSubclassOf< UDetail DetailClass,
const bool  bIncludeDisabled = false 
) const
inline

Check if there is a detail of a specific class in the subjective.

Supports examining by a base class.

Parameters
DetailClassThe class of the detail to test for.
bIncludeDisabledShould disabled details be considered?
Returns
The state of examination.

◆ HasFlag()

bool ISubjective::HasFlag ( const EFlagmarkBit  Flag) const
inline

Get the current state of a flag for the subjective.

Parameters
FlagThe flag to get the state of.
Returns
The state of the flag.

◆ HasTrait() [1/2]

template<typename T >
std::enable_if< IsTraitType< T >(), bool >::type ISubjective::HasTrait ( ) const
inline

Check if there is a trait of a specific type in the subjective.

Templated version.

◆ HasTrait() [2/2]

bool ISubjective::HasTrait ( UScriptStruct *const  TraitType) const
inline

Check if the subjective has a certain trait.

◆ IsBooted()

bool ISubjective::IsBooted ( ) const
inline

Check if the subject is booted.

The subject must be booted (initialized) by the booting mechanics prior to being processed by the ticking mechanics.

◆ IsClientSide()

bool ISubjective::IsClientSide ( ) const
inline

Check if the subjective is a client-side one.

◆ IsNetworkCapable()

virtual bool ISubjective::IsNetworkCapable ( ) const
inlinevirtual

Check if the subjective class is capable of networking.

This method should be overriden by the interface implementors to explicitly indicate that they have some mandatory properties for the functionality.

Reimplemented in ISolidSubjective, ASubjectiveActor, and USubjectiveActorComponent.

◆ IsRegistered()

bool ISubjective::IsRegistered ( ) const
inline

Check if the subjective is registered within the machine.

◆ IsServerSide()

bool ISubjective::IsServerSide ( ) const
inline

Check if the subjective is a server-side one.

◆ IsValidSubjective()

static bool ISubjective::IsValidSubjective ( const ISubjective *const  InSubjective)
inlinestatic

◆ MarkBooted()

bool ISubjective::MarkBooted ( )
inlineprotected

Set the subjective as booted.

Returns
The previous state of the booted flag.

◆ Matches() [1/3]

bool ISubjective::Matches ( const FDetailmark InDetailmark) const
inline

Check if the subjective matches a supplied detailmark as a filter.

◆ Matches() [2/3]

bool ISubjective::Matches ( const FFilter InFilter) const
inline

Check if the subjective matches a supplied filter.

◆ Matches() [3/3]

bool ISubjective::Matches ( const FTraitmark InTraitmark) const
inline

Check if the subjective matches a supplied traitmark as a filter.

◆ ObtainNetworkIdFromServer()

virtual void ISubjective::ObtainNetworkIdFromServer ( )
inlineprotectedvirtual

Obtain a networking subject identifier from the server.

Should be implemented via a client RPC.

Reimplemented in ASubjectiveActor, and USubjectiveActorComponent.

◆ ObtainTrait() [1/3]

template<typename T >
std::enable_if< IsTraitType< T >(), T >::type ISubjective::ObtainTrait ( )
inline

Get a copy of an obtained trait from a subjective.

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

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

◆ ObtainTrait() [2/3]

template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type ISubjective::ObtainTrait ( T OutTrait,
const bool  bTraitDataInitialized = true 
)
inline

Obtain a trait from a subjective.

Templated version.

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

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

◆ ObtainTrait() [3/3]

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

Obtain a trait from a subjective by its type.

If the trait is missing within the subject, the output data is unchanged and EApparatusStatus::NotFound is returned.

Parameters
[in]TraitTypeThe type of the trait to obtain.
[out]OutTraitDataThe trait data receiver.
[in]bTraitDataInitializedIs the TraitData buffer actually initialized?
Returns
The status of the operation.

◆ PushTrait() [1/2]

void ISubjective::PushTrait ( UScriptStruct *const  TraitType,
const EPeerRole  PeerRole = EPeerRole::None 
)
inline

Send an existing trait to a remote peer.

On a client the trait can only be send from a current connection's owned actor, i.e. a pawn or a player controller.

Parameters
TraitTypeThe type of the trait to send. Must not be a nullptr.
PeerRoleThe peer role specification. If left as EPeerRole::None, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.

◆ PushTrait() [2/2]

virtual void ISubjective::PushTrait ( UScriptStruct *const  TraitType,
const void *const  TraitData,
const bool  bSetForLocal = false,
const EPeerRole  PeerRole = EPeerRole::None 
)
inlinevirtual

Send an additional trait to a remote peer.

On a client the trait can only be sent from a current connection's owned actor, i.e. a pawn or a player controller.

Parameters
TraitTypeThe type of the trait to send. Must not be a nullptr.
TraitDataThe data of the trait to send. Must not be a nullptr.
bSetForLocalShould the trait be also set for the local version of the subject.
PeerRoleThe peer role specification. If left as EPeerRole::None, the peer role is tried to be derived automatically. This may be ambiguous on a listen server, so you can provide one explicitly.

Reimplemented in ISolidSubjective, ASubjectiveActor, and USubjectiveActorComponent.

◆ ReceiveHandleDespawned()

void ISubjective::ReceiveHandleDespawned ( )

Called when the subject handle is despawned.

This method should basically self-destruct the subjective or finalize it somehow.

◆ ReceiveTrait_Implementation()

void ISubjective::ReceiveTrait_Implementation ( UScriptStruct *const  TraitType,
const TArray< uint8 > &  TraitData 
)
protected

Receive a trait on the server or the client.

The standard implementation for the RPC.

◆ RemoveAllTraits()

EApparatusStatus ISubjective::RemoveAllTraits ( )
inline

Remove all of the traits from the subjective.

Returns
The status of the operation.

◆ RemoveTrait() [1/2]

template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type ISubjective::RemoveTrait ( )
inline

Remove a trait from the subjective.

Templated version.

If there is no such trait in the subjective, 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 ISubjective::RemoveTrait ( UScriptStruct *const  TraitType)
inline

Remove a trait from the subjective.

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

Parameters
TraitTypeThe type of the trait to remove. Must not be a nullptr.
Returns
The status of the operation.

◆ ServerRequestNetworkId_Implementation()

void ISubjective::ServerRequestNetworkId_Implementation ( )
protected

Request a unique network identifier for the subject of the subjective.

The standard implementation for the RPC.

◆ SetConnectionPermit()

void ISubjective::SetConnectionPermit ( UNetConnection *const  Connection)
inline

Set the server-side connection to a client from which it is allowed to push traits to this subjective.

Parameters
[in]ConnectionThe connection pass to set to.

◆ SetFlag()

EApparatusStatus ISubjective::SetFlag ( const EFlagmarkBit  Flag,
const bool  bState = true 
)
inline

Set a flag for the subjective.

Parameters
FlagThe flag to set. Must not be a system-level one.
bStateThe state of the flag to set.
Returns
The status of the operation.

◆ SetFlagmark()

EApparatusStatus ISubjective::SetFlagmark ( const EFlagmark  InFlagmark)
inline

Set the current flagmark for the subjective.

Parameters
InFlagmarkThe flagmark to set.
Returns
The status of the operation.

◆ SetTrait() [1/2]

template<typename T >
std::enable_if< IsTraitType< T >(), EApparatusStatus >::type ISubjective::SetTrait ( const T Trait)
inline

Set a trait of the subjective.

Templated version.

If the trait is not currently within the subjective, 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 ISubjective::SetTrait ( UScriptStruct *const  TraitType,
const void *const  TraitData 
)
inline

Set a trait of the subjective by its type.

If the trait is not currently within the subjective, 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.

◆ SetTraitmarkPass()

EApparatusStatus ISubjective::SetTraitmarkPass ( const FTraitmark InTraitmarkPermit)
inline

◆ SetTraitmarkPermit()

EApparatusStatus ISubjective::SetTraitmarkPermit ( const FTraitmark InTraitmarkPermit)
inline

Set the server-side list of traits allowed to be received from clients.

Can only be set for a server-side subjective version.

Parameters
InTraitmarkPermitThe new traitmark to be used as a whitelist.
Returns
The status of the operation.

◆ ShouldBeReplicated()

virtual bool ISubjective::ShouldBeReplicated ( ) const
inlineprotectedvirtual

Check if the entity be replicated.

Should be overriden in the descendants to explicitly state the the network functionality is needed on the subjective.

Reimplemented in ASubjectiveActor, and USubjectiveActorComponent.

◆ TakeBeltSlot() [1/3]

void ISubjective::TakeBeltSlot ( const int32  InSlotIndex)
inlineprotected

Change the current slot of the subjective, while preserving the belt.

This is a simple internal fields setter with minimal logic.

Parameters
InSlotIndexThe slot index to set.

◆ TakeBeltSlot() [2/3]

void ISubjective::TakeBeltSlot ( std::nullptr_t  )
inlineprotected

Reset the belt slot.

◆ TakeBeltSlot() [3/3]

void ISubjective::TakeBeltSlot ( UBelt *const  InBelt,
const int32  InSlotIndex 
)
inlineprotected

Set or reset the current belt slot of the subjective.

This is a simple internal fields setter with a minimal logic. You may use this method to reset the slot.

Parameters
InBeltThe belt to set. May be a nullptr in order to reset the slot.
InSlotIndexThe slot index to set. May be a InvalidSlotIndex if the first argument is nullptr.

◆ ToggleFlag()

void ISubjective::ToggleFlag ( const EFlagmarkBit  Flag)
inline

Toggle a flag for the subjective.

Parameters
FlagThe flag to toggle. Must not be a system-level one.

◆ Unregister()

EApparatusStatus ISubjective::Unregister ( )

Unregister the subjective from its mechanism in a manual fashion.

If the subjective is already registered, nothing is performed.

Returns
The status of the operation.

Friends And Related Function Documentation

◆ AMechanism

friend class AMechanism
friend

◆ FBeltSlot

friend struct FBeltSlot
friend

◆ FBeltSlotCache

friend struct FBeltSlotCache
friend

◆ FFingerprint

friend struct FFingerprint
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ ISolidSubjective

friend class ISolidSubjective
friend

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UBelt

friend class UBelt
friend

◆ UDetail

friend class UDetail
friend

◆ UMachine

friend class UMachine
friend

Member Data Documentation

◆ Belt

UBelt* ISubjective::Belt = nullptr
protected

A reference to a current subjective's belt (if any).

If is equal to nullptr, the subjective is not a part of any belt.

◆ bUnregistered

bool ISubjective::bUnregistered = false
protected

Was the subjective already unregistered via the normal DoUnregister() means.

◆ Handle

FSubjectHandle ISubjective::Handle
protected

The subject handle which points to a global subjects registry.

◆ SlotIndex

int32 ISubjective::SlotIndex = InvalidSlotIndex
protected

The index of the belt slot, this subject currently resides in.

◆ StandardNetworkPropertyBlockCache

FStandardSubjectiveNetworkPropertyBlock* ISubjective::StandardNetworkPropertyBlockCache = nullptr
mutableprotected

◆ StandardPropertyBlockCache

FStandardSubjectivePropertyBlock* ISubjective::StandardPropertyBlockCache = nullptr
mutableprotected

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