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

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

#include <Subjective.h>

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

Public Types

enum  { InvalidSlotIndex = FBeltSlot::InvalidIndex }
 

Public Member Functions

const FFingerprintGetFingerprint () const
 Get the active fingerprint of the subjective. More...
 
bool Matches (const FFilter &Filter) 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...
 
void GetDetails (const bool bIncludeDisabled, TArray< UDetail * > &OutDetails) const
 Get the details of the subjective. More...
 
UDetailFindDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 Find the detail by a type. More...
 
void FindDetails (TSubclassOf< UDetail > DetailClass, TArray< UDetail * > &OutDetails, const bool bIncludeDisabled=false) const
 Find the details by their type. More...
 
bool HasDetail (TSubclassOf< UDetail > DetailClass, const bool bIncludeDisabled=false) const
 Check if there is a detail of specific class in the subjective. More...
 
virtual class UBeltGetPreferredBelt () const
 Get the preferred belt of the subjective (if any). More...
 
class UDetailEnableDetail (TSubclassOf< UDetail > DetailClass)
 Enable a detail of a certain type. More...
 
class UDetailAddDetail (TSubclassOf< UDetail > DetailClass, const bool bReuseDisabled=false)
 Add a new active detail or reuse an inactive one. More...
 
EApparatusStatus DisableDetail (TSubclassOf< UDetail > DetailClass, const bool bDisableMultiple=false)
 Disable a certain detail(s) by type. 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...
 
FSubjectHandleGetHandle ()
 Get the subject handle of this subjective. More...
 
const FSubjectHandleGetHandle () const
 Get the subject handle of this subjective. More...
 
virtual uint32 GetHash () const
 Get the hash of the subjective. More...
 

Protected Member Functions

void MarkBooted ()
 Set the subjective as booted. More...
 
void TakeBeltSlot (class UBelt *InBelt, int32 InSlotIndex)
 Set the current belt slot of the subjective (if any). More...
 
UBeltGetBelt () const
 Get the active belt of the subjective (if any). More...
 
virtual TArray< UDetail * > & GetDetailsRef ()
 Direct access for the internal details array. More...
 
virtual const TArray< UDetail * > & GetDetailsRef () const
 Direct access for the internal details array. More...
 
FFingerprintGetFingerprint ()
 Get the internal fingerprint of the subjective. More...
 
struct FBeltSlotGetSlotPtr ()
 Get the current belt slot of the subjective (if any). More...
 

Protected Attributes

TWeakObjectPtr< UBeltBelt = nullptr
 A weak reference to a current subjective's belt (if any). More...
 
int32 SlotIndex = FBeltSlot::InvalidIndex
 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...
 

Friends

struct FFingerprint
 
struct FBeltSlot
 
struct FBeltSlotCache
 
class UDetail
 
class UBelt
 
class UMachine
 
class UApparatusFunctionLibrary
 

Detailed Description

An interface for all sorts of subjects.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidSlotIndex 

Invalid belt slot index.

Member Function Documentation

◆ AddDetail()

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

Add a new active detail or reuse an inactive one.

◆ DisableDetail()

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

Disable a certain detail(s) by type.

You can't remove details, but only disable them.

◆ EnableDetail()

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

Enable a detail of a certain type.

Add it if there is none already, or reuse an inactive one.

◆ FindDetail()

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

Find the detail by a type.

◆ FindDetails()

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

Find the details by their type.

Supports searching by a base type.

◆ GetBelt()

UBelt* ISubjective::GetBelt ( ) const
inlineprotected

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

◆ GetDetails()

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

Get the details of the subjective.

◆ GetDetailsRef() [1/2]

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

Direct access for the internal details array.

Reimplemented in USubjectiveUserWidget, USubjectiveActorComponent, and ASubjectiveActor.

◆ GetDetailsRef() [2/2]

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

Direct access for the internal details array.

Constant version.

Reimplemented in USubjectiveUserWidget, USubjectiveActorComponent, and ASubjectiveActor.

◆ GetFingerprint() [1/2]

FFingerprint& ISubjective::GetFingerprint ( )
inlineprotected

Get the internal fingerprint of the subjective.

◆ GetFingerprint() [2/2]

const FFingerprint& ISubjective::GetFingerprint ( ) const
inline

Get the active fingerprint of the subjective.

Constant version.

◆ GetHandle() [1/2]

FSubjectHandle& ISubjective::GetHandle ( )
inline

Get the subject handle of this subjective.

◆ GetHandle() [2/2]

const FSubjectHandle& ISubjective::GetHandle ( ) const
inline

Get the subject handle of this subjective.

Constant version.

◆ GetHash()

virtual uint32 ISubjective::GetHash ( ) const
inlinevirtual

Get the hash of the subjective.

◆ GetPreferredBelt()

virtual class UBelt* ISubjective::GetPreferredBelt ( ) const
inlinevirtual

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

Reimplemented in USubjectiveUserWidget, USubjectiveActorComponent, and ASubjectiveActor.

◆ 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.

◆ HasDetail()

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

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

Should support examining by a base type.

◆ 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.

◆ IsRegistered()

bool ISubjective::IsRegistered ( ) const
inline

Check if the subjective is registered within the machine.

◆ MarkBooted()

void ISubjective::MarkBooted ( )
inlineprotected

Set the subjective as booted.

◆ 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 Filter) 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.

◆ TakeBeltSlot()

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

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

Parameters
InBeltThe belt must be stored in a GC-managed UPROPERTY.
InSlotIndexThe slot must be referenced and stored by its index in a SlotIndex field.

Friends And Related Function Documentation

◆ FBeltSlot

friend struct FBeltSlot
friend

◆ FBeltSlotCache

friend struct FBeltSlotCache
friend

◆ FFingerprint

friend struct FFingerprint
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

TWeakObjectPtr<UBelt> ISubjective::Belt = nullptr
protected

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

◆ Handle

FSubjectHandle ISubjective::Handle
protected

The subject handle which points to a global subjects registry.

◆ SlotIndex

int32 ISubjective::SlotIndex = FBeltSlot::InvalidIndex
protected

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


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