Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
USubjectiveObject Class Reference

An Unreal Engine object as a subject with details. More...

#include <SubjectiveObject.h>

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

Public Member Functions

 USubjectiveObject ()
 Initialize and register a subjective object.
 
- Public Member Functions inherited from ISubjective
AMechanismGetMechanism () const
 Get the mechanism this subjective is currently part of (if registered).
 
template<EParadigm Paradigm = EParadigm::Safe>
TOutcome< Paradigm > SetMechanism (AMechanism *const Mechanism)
 Set the mechanism of the subjective.
 
const TArray< FTraitRecord > & GetTraitRecordsRef () const
 Direct access for the internal traits array.
 
virtual const TArray< UDetail * > & GetDetailsRef () const
 Direct access for the internal details array.
 
const FFingerprintGetFingerprint () const
 Get the active fingerprint of the subjective.
 
bool Matches (const FFilter &InFilter) const
 Check if the subjective matches a supplied filter.
 
bool Matches (const FTraitmark &InTraitmark) const
 Check if the subjective matches a supplied traitmark as a filter.
 
bool Matches (const FDetailmark &InDetailmark) const
 Check if the subjective matches a supplied detailmark as a filter.
 
UBeltGetPreferredBelt () const
 Get the preferred belt of the subjective (if any).
 
const struct FBeltSlotGetSlot () const
 Get the current belt slot of the subjective (if any).
 
bool IsRegistered () const
 Check if the subjective is registered within the machine.
 
int32 GetSlotIndex () const
 Get the current slot index of the subjective.
 
bool IsBooted () const
 Check if the subject is booted.
 
FSubjectHandle GetHandle ()
 Get the subject handle of this subjective.
 
FConstSubjectHandle GetHandle () const
 Get the subject handle of this subjective.
 
template<EParadigm Paradigm = EParadigm::DefaultPortable>
TOutcome< Paradigm > Unregister ()
 Unregister the subjective from its mechanism in a manual fashion.
 
virtual uint32 CalcHash () const
 Calculate the hash of the subjective.
 
void ReceiveHandleDespawned ()
 Called when the subject handle is despawned.
 
virtual void NotifyHandleDespawned ()
 Called when the subject handle is despawned.
 
virtual AActor * GetActor () const
 Get an actor corresponding to the subjective (if any).
 
EFlagmark GetFlagmark () const
 Get the current flagmark of the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, EFlagmarkSetFlagmark (const EFlagmark InFlagmark)
 Set the current flagmark for the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, EFlagmarkSetFlagmarkMasked (const EFlagmark InFlagmark, const EFlagmark InMask=FM_AllUserLevel)
 Set the current flagmark for the subjective in a masked fashion.
 
bool HasFlag (const EFlagmarkBit Flag) const
 Get the current state of a flag for the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, boolSetFlag (const EFlagmarkBit Flag, const bool bState=true)
 Set a flag for the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, boolToggleFlag (const EFlagmarkBit Flag)
 Toggle a flag for the subjective.
 
bool HasTrait (UScriptStruct *const TraitType) const
 Check if the subjective has a certain trait.
 
template<typename T , TTraitTypeSecurity< T > = true>
bool HasTrait () const
 Check if there is a trait of a specific type in the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SetTrait (UScriptStruct *const TraitType, const void *const TraitData)
 Set a trait of the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> SetTrait (const T &Trait)
 Set a trait of the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > GetTrait (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 Get a trait from the subjective by its type.
 
template<EParadigm Paradigm, typename T , TTraitTypeSecurity< T > = true>
TOutcome< Paradigm > GetTrait (T *const OutTrait, const bool bTraitDataInitialized=true) const
 Get a trait from the subjective by its type.
 
template<EParadigm Paradigm, typename T , TTraitTypeSecurity< T > = true>
TOutcome< Paradigm > GetTrait (T &OutTrait, const bool bTraitDataInitialized=true) const
 Get a trait from the subjective by its type.
 
template<EParadigm Paradigm, typename T , TTraitTypeSecurity< T > = true>
TOutcome< Paradigm, TGetTrait () const
 Get a copy of a trait from the subjective by its type.
 
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitTypeSecurity< T > = true>
TOutcome< Paradigm, TGetTrait () const
 Get a copy of a trait from the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcomeIfUnsafe< Paradigm, const void * > GetTraitPtr (UScriptStruct *const TraitType) const
 Get the trait data from the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcomeIfUnsafe< Paradigm, void * > GetTraitPtr (UScriptStruct *const TraitType)
 Get the trait data from a subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >() &&IsUnsafe(Paradigm), const T * > GetTraitPtr () const
 Get the trait data from the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >() &&IsUnsafe(Paradigm), T * > GetTraitPtr ()
 Get the trait data from the subjective by its type.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto GetTraitPtr () const
 Get the trait data from the subjective by its type.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto GetTraitPtr ()
 Get the trait data from the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > ObtainTrait (UScriptStruct *TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true)
 Obtain a trait from the subjective by its type.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> ObtainTrait (T *const OutTrait, const bool bTraitDataInitialized=true)
 Obtain a trait from the subjective.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void, TTraitTypeSecurity< T > = true>
TOutcome< Paradigm > ObtainTrait (T &OutTrait, const bool bTraitDataInitialized=true)
 Obtain a trait from the subjective.
 
template<EParadigm Paradigm, typename T , TTraitTypeSecurity< T > = true>
TOutcome< Paradigm, TObtainTrait ()
 Get a copy of an obtained trait from the subjective.
 
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitTypeSecurity< T > = true>
TOutcome< Paradigm, TObtainTrait ()
 Get a copy of an obtained trait from the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > RemoveTrait (UScriptStruct *const TraitType)
 Remove a trait from the subjective.
 
template<EParadigm Paradigm, typename T , TTraitTypeSecurity< T > = true>
TOutcome< Paradigm > RemoveTrait ()
 Remove a trait from the subjective.
 
template<typename T , EParadigm Paradigm = EParadigm::Default, TTraitTypeSecurity< T > = true>
TOutcome< Paradigm > RemoveTrait ()
 Remove a trait from the subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > RemoveAllTraits ()
 Remove all of the traits from the subjective.
 
void GetDetails (const bool bIncludeDisabled, TArray< UDetail * > &OutDetails) const
 Get all of the details of the subjective.
 
void GetDetails (TArray< UDetail * > &OutDetails, const bool bIncludeDisabled=false) const
 Get all the enabled details of the subjective.
 
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
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, UDetail * > GetDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 Get a detail by its class.
 
template<EParadigm Paradigm, class D >
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > GetDetail (const bool bIncludeDisabled=false) const
 Get a detail by its class.
 
template<class D , EParadigm Paradigm = EParadigm::Default>
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > GetDetail (const bool bIncludeDisabled=false) const
 Get a detail by its class.
 
template<EParadigm Paradigm = EParadigm::Default, typename AllocatorT = FDefaultAllocator>
TOutcome< Paradigm > CollectDetails (TSubclassOf< UDetail > DetailClass, TArray< UDetail *, AllocatorT > &OutDetails, const bool bIncludeDisabled=false) const
 Collect all of the details of a certain class.
 
template<EParadigm Paradigm = EParadigm::Default, typename AllocatorT = FDefaultAllocator>
TOutcome< Paradigm > GetDetails (TSubclassOf< UDetail > DetailClass, TArray< UDetail *, AllocatorT > &OutDetails, const bool bIncludeDisabled=false) const
 Get all of the details of a certain class.
 
template<class D , typename AllocatorT >
std::enable_if< IsDetailClass< D >(), void >::type GetDetails (TArray< D *, AllocatorT > &OutDetails, const bool bIncludeDisabled=false) const
 Get all of the details of a certain class.
 
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.
 
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.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, UDetail * > EnableDetail (const TSubclassOf< UDetail > DetailClass)
 Enable a detail of a certain type.
 
template<EParadigm Paradigm, class D >
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > EnableDetail ()
 Enable a detail of a certain type.
 
template<class D , EParadigm Paradigm = EParadigm::Default>
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > EnableDetail ()
 Enable a detail of a certain type.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm, UDetail * > AddDetail (const TSubclassOf< UDetail > DetailClass, const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one.
 
template<EParadigm Paradigm, class D >
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > AddDetail (const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one.
 
template<class D , EParadigm Paradigm = EParadigm::Default>
TOutcomeIf< Paradigm, IsDetailClass< D >(), D * > AddDetail (const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > DisableDetail (const TSubclassOf< UDetail > DetailClass, const bool bDisableMultiple=false)
 Disable detail(s) by class.
 
template<EParadigm Paradigm, class D >
TOutcomeIf< Paradigm, IsDetailClass< D >()> DisableDetail (const bool bDisableMultiple=false)
 Disable detail(s) by class.
 
template<class D >
auto DisableDetail (const bool bDisableMultiple=false)
 Disable detail(s) by class.
 
virtual bool IsNetworkCapable () const
 Check if the subjective class is capable of networking.
 
uint32 GetNetworkId () const
 Get the unique cross-peer network identifier of the subjective (if any).
 
bool IsServerSide () const
 Check if the subjective is a server-side one.
 
bool IsClientSide () const
 Check if the subjective is a client-side one.
 
UNetConnection * GetConnectionPermit () const
 Get the server-side connection to a client from which it is allowed to push traits to this subjective.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SetConnectionPermit (UNetConnection *const Connection)
 Set the server-side connection to a client from which it is allowed to push traits to this subjective.
 
const FTraitmarkGetTraitmarkPermit () const
 Get the server-side list of traits allowed to be received from clients.
 
const FTraitmarkGetTraitmarkPass () const
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SetTraitmarkPermit (const FTraitmark &InTraitmarkPermit)
 Set the server-side list of traits allowed to be received from clients.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > SetTraitmarkPass (const FTraitmark &InTraitmarkPermit)
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > PushTrait (UScriptStruct *const TraitType, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true) const
 Send an existing trait to a remote peer.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > PushTrait (UScriptStruct *const TraitType, const void *const TraitData, const bool bSetForLocal, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an additional trait to a remote peer.
 
template<EParadigm Paradigm = EParadigm::Default>
TOutcome< Paradigm > PushTrait (UScriptStruct *const TraitType, const void *const TraitData, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an additional trait to a remote peer.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> PushTrait (const T &Trait, const bool bSetForLocal=false, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an extra trait to a remote peer.
 
template<EParadigm Paradigm = EParadigm::Default, typename T = void>
TOutcomeIf< Paradigm, IsTraitType< T >()> PushTrait (const T &Trait, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an extra trait to a remote peer.
 
template<EParadigm Paradigm, typename T >
TOutcomeIf< Paradigm, IsTraitType< T >()> PushTrait (const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an extra trait to a remote peer.
 
template<typename T , EParadigm Paradigm = EParadigm::Default>
auto PushTrait (const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 Send an extra trait to a remote peer.
 

Protected Member Functions

void Serialize (FArchive &Archive) override
 
void BeginDestroy () override
 
- Protected Member Functions inherited from ISubjective
bool MarkBooted ()
 Set the subjective as booted.
 
void TakeBeltSlot (UBelt *const InBelt, const int32 InSlotIndex)
 Set or reset the current belt slot of the subjective.
 
virtual FStandardSubjectivePropertyBlockDoGetStandardPropertyBlock ()
 
virtual FStandardSubjectivePropertyBlockDoGetStandardPropertyBlock () const
 
FStandardSubjectivePropertyBlockGetStandardPropertyBlock ()
 
const FStandardSubjectivePropertyBlockGetStandardPropertyBlock () const
 
virtual FStandardSubjectiveNetworkPropertyBlockDoGetStandardNetworkPropertyBlock ()
 
virtual FStandardSubjectiveNetworkPropertyBlockDoGetStandardNetworkPropertyBlock () const
 
FStandardSubjectiveNetworkPropertyBlockGetStandardNetworkPropertyBlock ()
 
const FStandardSubjectiveNetworkPropertyBlockGetStandardNetworkPropertyBlock () const
 
const EFlagmarkGetFlagmarkPropRef () const
 Get the internal flagmark property reference.
 
EFlagmarkGetFlagmarkPropRef ()
 Get the internal flagmark property reference.
 
auto & GetMechanismOverridePropRef () const
 Get the mechanism override property of the subjective.
 
auto & GetMechanismOverridePropRef ()
 Get the mechanism override property of the subjective.
 
TArray< FTraitRecord > & GetTraitRecordsRef ()
 Direct access for the internal traits array.
 
TArray< UDetail * > & GetDetailsRef ()
 Direct access for the internal details array.
 
void TakeBeltSlot (TYPE_OF_NULLPTR)
 Reset the belt slot.
 
void ClientReceiveNetworkId_Implementation (const uint32 NetworkId)
 Assign a unique network identifier to the subject of the subjective.
 
void ServerRequestNetworkId_Implementation ()
 Request a unique network identifier for the subject of the subjective.
 
void PeerReceiveTrait_Implementation (EPeerRole PeerRole, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Receive a trait on the server or the client.
 
bool PeerReceiveTrait_Validate (EPeerRole PeerRole, UScriptStruct *const TraitType, const TArray< uint8 > &TraitData)
 Validate receiving a trait on the server or the client.
 
virtual TPortableOutcome DoPushTrait (const EParadigm Paradigm, UScriptStruct *const TraitType, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true) const
 
virtual TPortableOutcome DoPushTrait (const EParadigm Paradigm, UScriptStruct *const TraitType, const void *const TraitData, const bool bSetForLocal=false, const EPeerRole PeerRole=EPeerRole::Auto, const bool bReliable=true)
 
virtual void AssignNetworkIdOnClient (const uint32 NetworkId)
 Assign a network identifier on a client.
 
virtual void ObtainNetworkIdFromServer ()
 Obtain a networking subject identifier from the server.
 
void TakeBeltSlot (const int32 InSlotIndex)
 Change the current slot of the subjective, while preserving the belt.
 
UBeltGetBelt () const
 Get the active belt of the subjective (if any).
 
FFingerprintGetFingerprintRef ()
 Get the internal fingerprint of the subjective.
 
const FFingerprintGetFingerprintRef () const
 Get the internal fingerprint of the subjective.
 
struct FBeltSlotGetSlotPtr ()
 Get the current belt slot of the subjective (if any).
 
void DoRegister ()
 Perform an actual registration of the subjective.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm > DoUnregister ()
 Perform an actual de-registration procedure on the subjective.
 
void DoStartSerialization (FArchive &Archive)
 Begin the serialization routine.
 
void DoFinishSerialization (FArchive &Archive)
 End the serialization routine.
 
bool DoesHaveTraitRecord (UScriptStruct *const TraitType) const
 
FTraitmark DoGetTraitRecordsTraitmark () const
 Get the traitmark based on the existing trait records.
 
const FTraitRecord * DoFindTraitRecord (UScriptStruct *const TraitType) const
 
EApparatusStatus DoGetTraitRecord (UScriptStruct *const TraitType, void *const OutTraitData, const bool bTraitDataInitialized=true) const
 
template<typename T >
EApparatusStatus DoGetTraitRecord (T *const OutTraitData, const bool bTraitDataInitialized=true) const
 
template<typename T >
EApparatusStatus DoGetTraitRecord (T &OutTraitData, const bool bTraitDataInitialized=true) const
 
EApparatusStatus DoSetTraitRecord (UScriptStruct *TraitType, const void *TraitData)
 
template<typename T >
EApparatusStatus DoSetTraitRecord (const T &InTrait)
 
template<typename T >
EApparatusStatus DoSetTraitRecord (const T *const InTrait)
 
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.
 

Additional Inherited Members

- Public Types inherited from ISubjective
typedef int32 SlotIndexType
 The type of the slot index.
 
- Static Public Member Functions inherited from ISubjective
static bool IsValidSubjective (const ISubjective *const InSubjective)
 
- Static Public Attributes inherited from ISubjective
static constexpr SlotIndexType InvalidSlotIndex = -1
 Invalid belt slot index.
 
- Static Protected Member Functions inherited from ISubjective
template<EParadigm Paradigm = EParadigm::DefaultInternal, class S = void>
static TOutcome< Paradigm > DoPushTrait (const S *const Subjective, UScriptStruct *const TraitType, EPeerRole PeerRole, const bool bReliable, void(S::*ServerReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ClientReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ServerReceiveTraitUnreliableRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ClientReceiveTraitUnreliableRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData))
 Push a trait to the remote version of the subject.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal, class S = void>
static TOutcome< Paradigm > DoPushTrait (S *const Subjective, UScriptStruct *const TraitType, const void *const TraitData, bool bSetForLocal, EPeerRole PeerRole, const bool bReliable, void(S::*ServerReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ClientReceiveTraitRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ServerReceiveTraitUnreliableRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData), void(S::*ClientReceiveTraitUnreliableRPC)(UScriptStruct *TraitType, const TArray< uint8 > &TraitData))
 Push a trait to the remote version of the subject.
 
- Protected Attributes inherited from ISubjective
UBeltBelt = nullptr
 A reference to a current subjective's belt (if any).
 
SlotIndexType SlotIndex = InvalidSlotIndex
 The index of the belt slot, this subject currently resides in.
 
FSubjectHandle Handle
 The subject handle which points to a global subjects registry.
 
bool bUnregistered = false
 Was the subjective already unregistered via the normal DoUnregister() means.
 
FStandardSubjectivePropertyBlockStandardPropertyBlockCache = nullptr
 
FStandardSubjectiveNetworkPropertyBlockStandardNetworkPropertyBlockCache = nullptr
 

Detailed Description

An Unreal Engine object as a subject with details.

Constructor & Destructor Documentation

◆ USubjectiveObject()

USubjectiveObject::USubjectiveObject ( )
inline

Initialize and register a subjective object.

Member Function Documentation

◆ BeginDestroy()

void USubjectiveObject::BeginDestroy ( )
inlineoverrideprotected

◆ Serialize()

void USubjectiveObject::Serialize ( FArchive &  Archive)
inlineoverrideprotected

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