Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
FBeltSlot Struct Reference

The belt slot, containing the details. More...

#include <BeltSlot.h>

Public Types

enum  { InvalidIndex = ISubjective::InvalidSlotIndex , InvalidComboIndex = -1 , InvalidDetailIndex = -1 }
 

Public Member Functions

 FBeltSlot ()
 The default invalid/uninitialized slot constructor.
 
bool IsLocked () const
 Check if the belt slot is currently locked.
 
UBeltGetOwner () const
 Get the owning belt of the slot.
 
int32 GetIndex () const
 Get the index of the slot in the belt.
 
bool IsStale () const
 Check if the slot is marked to be removed.
 
bool IsSkipped (const FFilter &InFilter) const
 Check if a slot should be skipped during the iterating.
 
bool IsViable () const
 Check if the slot is viable, i.e.
 
bool IsViable (const FFilter &InFilter) const
 Check if the slot is viable, i.e.
 
EApparatusStatus SetRemoved (const bool bInRemoved=true)
 Set the slot as to be removed (or not).
 
FSubjectHandle GetSubject () const
 Get the subject of the slot.
 
ISubjectiveGetSubjective () const
 Get the subjective of the slot.
 
void ResetDetails () const
 Clear all of the cached details in the slot, while actually maintaining a link to subjective itself (if any).
 
 ~FBeltSlot ()
 Deinitialize the belt slot.
 
bool IsDetailAvailableAtLine (const int32 DetailIndex)
 Check if a detail exists at the specified index.
 
bool IsComboValid (const TArray< int32 > &DetailsIndices, const int32 ComboIndex) const
 Check if a combo is valid, i.e.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm, UDetail * > DetailAtLine (const TArray< int32 > &DetailsIndices, const int32 ComboIndex, const int32 DetailLineIndex) const
 Get the detail at a specified index according to the combination supplied.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm, UDetail * > GetDetailHinted (const TArray< int32 > &DetailsIndices, const int32 ComboIndex, const TSubclassOf< UDetail > DetailClass, const int32 DetailIndexHint) const
 Get the detail at a specified index hinted according to the combination supplied.
 
template<EParadigm Paradigm, typename D >
TOutcome< Paradigm, D * > GetDetailHinted (const TArray< int32 > &DetailsIndices, const int32 ComboIndex, const int32 DetailIndexHint) const
 Get the detail at a specified index hinted according to the combination supplied.
 
template<typename D , EParadigm Paradigm = EParadigm::DefaultInternal>
auto GetDetailHinted (const TArray< int32 > &DetailsIndices, const int32 ComboIndex, const int32 DetailIndexHint) const
 Get the detail at a specified index hinted according to the combination supplied.
 
template<EParadigm Paradigm = EParadigm::DefaultInternal>
TOutcome< Paradigm, UDetail * > GetDetail (const TArray< int32 > &DetailsIndices, const int32 ComboIndex, const TSubclassOf< UDetail > DetailClass) const
 Get the detail of a specific class according to the combination supplied.
 
template<EParadigm Paradigm, class D >
TOutcome< Paradigm, D * > GetDetail (const TArray< int32 > &DetailsIndices, const int32 ComboIndex) const
 Get the detail of a specific class according to the combination supplied.
 
template<class D , EParadigm Paradigm = EParadigm::DefaultInternal>
auto GetDetail (const TArray< int32 > &DetailsIndices, const int32 ComboIndex) const
 Get the detail of a specific class according to the combination supplied.
 
bool FetchDetails ()
 Fetch the details from the current subjective.
 
void Expand ()
 Expand the slot according to a belt's detailmark.
 
const FDetailmarkGetDetailmark () const
 The active detailmark of the slot,.
 
 operator bool () const
 Is this slot actually valid?
 
bool operator== (const FBeltSlot &Other) const
 Compare two belt slots for equality.
 
bool operator!= (const FBeltSlot &Other) const
 Compare two belt slots for inequality.
 
EApparatusStatus Set (const FBeltSlot &InSlot)
 Set the slot as another one from the same belt.
 
FBeltSlotoperator= (const FBeltSlot &InSlot)
 Set the slot as another one from the same belt.
 
bool HasAnyDetails () const
 Check if there are any details available within the caches.
 
bool HasLockedDetails () const
 Check if the slot has any locked details within itself.
 

Friends

class USubjectiveActorComponent
 
class UBelt
 
template<typename SubjectHandleT >
struct TBeltIt
 
class TArray< FBeltSlot >
 

Detailed Description

The belt slot, containing the details.

A faster cache is used for details.

Note
The class should be considered an internal functionality and not be used directly.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidIndex 

Invalid belt slot index.

InvalidComboIndex 

Invalid combination index.

InvalidDetailIndex 

Invalid detail index.

Constructor & Destructor Documentation

◆ FBeltSlot()

FBeltSlot::FBeltSlot ( )
inline

The default invalid/uninitialized slot constructor.

◆ ~FBeltSlot()

FBeltSlot::~FBeltSlot ( )
inline

Deinitialize the belt slot.

Member Function Documentation

◆ DetailAtLine()

template<EParadigm Paradigm>
TOutcome< Paradigm, UDetail * > FBeltSlot::DetailAtLine ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex,
const int32  DetailLineIndex 
) const
inline

Get the detail at a specified index according to the combination supplied.

Parameters
DetailsIndicesThe indices of the details to consider.
ComboIndexThe index of the combination to examine.
DetailLineIndexThe index of the detail to get. Must also exist within the details indices array.
Returns
The detail at specified offset within the indices.

◆ Expand()

void FBeltSlot::Expand ( )
inline

Expand the slot according to a belt's detailmark.

◆ FetchDetails()

bool FBeltSlot::FetchDetails ( )

Fetch the details from the current subjective.

This never expands the belt itself, but can expand the slot according to the belt's detailmark.

◆ GetDetail() [1/3]

template<EParadigm Paradigm, class D >
TOutcome< Paradigm, D * > FBeltSlot::GetDetail ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex 
) const
inline

Get the detail of a specific class according to the combination supplied.

Statically typed version.

◆ GetDetail() [2/3]

template<class D , EParadigm Paradigm = EParadigm::DefaultInternal>
auto FBeltSlot::GetDetail ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex 
) const
inline

Get the detail of a specific class according to the combination supplied.

Statically typed version.

◆ GetDetail() [3/3]

template<EParadigm Paradigm>
TOutcome< Paradigm, UDetail * > FBeltSlot::GetDetail ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex,
const TSubclassOf< UDetail DetailClass 
) const
inline

Get the detail of a specific class according to the combination supplied.

◆ GetDetailHinted() [1/3]

template<EParadigm Paradigm, typename D >
TOutcome< Paradigm, D * > FBeltSlot::GetDetailHinted ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex,
const int32  DetailIndexHint 
) const
inline

Get the detail at a specified index hinted according to the combination supplied.

Statically typed version.

Template Parameters
ParadigmThe paradigm to work under.
DThe class of the detail to get.
Parameters
DetailsIndicesThe indices of the details to consider.
ComboIndexThe index of the combination to examine.
DetailIndexHintThe hinting index of the detail relative to the belt's detailmark. Should also exist within the details indices array. May be a FBeltSlot::InvalidDetailIndex to suppress the hinting.
Returns
The detail of the specified type.

◆ GetDetailHinted() [2/3]

template<typename D , EParadigm Paradigm = EParadigm::DefaultInternal>
auto FBeltSlot::GetDetailHinted ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex,
const int32  DetailIndexHint 
) const
inline

Get the detail at a specified index hinted according to the combination supplied.

Statically typed default paradigm version.

Template Parameters
DThe class of the detail to get.
ParadigmThe paradigm to work under.
Parameters
DetailsIndicesThe indices of the details to consider.
ComboIndexThe index of the combination to examine.
DetailIndexHintThe hinting index of the detail relative to the belt's detailmark. Should also exist within the details indices array. May be a FBeltSlot::InvalidDetailIndex to suppress the hinting.
Returns
The detail of the specified type.

◆ GetDetailHinted() [3/3]

template<EParadigm Paradigm>
TOutcome< Paradigm, UDetail * > FBeltSlot::GetDetailHinted ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex,
const TSubclassOf< UDetail DetailClass,
const int32  DetailIndexHint 
) const
inline

Get the detail at a specified index hinted according to the combination supplied.

Parameters
DetailsIndicesThe indices of the details to consider.
ComboIndexThe index of the combination.
DetailClassThe class of the detail to get.
DetailIndexHintThe hinting index of the detail to get. Relative to the belt's detailmark. Should also exist within the details indices array. May be a FBeltSlot::InvalidDetailIndex to suppress the hinting.
Returns
The detail of the specified type.

◆ GetDetailmark()

const FDetailmark & FBeltSlot::GetDetailmark ( ) const
inline

The active detailmark of the slot,.

It is the same as its owning belt's unless the belt is locked in which case it's of the locking filter.

◆ GetIndex()

int32 FBeltSlot::GetIndex ( ) const
inline

Get the index of the slot in the belt.

Returns
An index of the slot within its belt.

◆ GetOwner()

UBelt * FBeltSlot::GetOwner ( ) const
inline

Get the owning belt of the slot.

◆ GetSubject()

FSubjectHandle FBeltSlot::GetSubject ( ) const
inline

Get the subject of the slot.

◆ GetSubjective()

ISubjective * FBeltSlot::GetSubjective ( ) const
inline

Get the subjective of the slot.

◆ HasAnyDetails()

bool FBeltSlot::HasAnyDetails ( ) const
inline

Check if there are any details available within the caches.

◆ HasLockedDetails()

bool FBeltSlot::HasLockedDetails ( ) const
inline

Check if the slot has any locked details within itself.

◆ IsComboValid()

bool FBeltSlot::IsComboValid ( const TArray< int32 > &  DetailsIndices,
const int32  ComboIndex 
) const

Check if a combo is valid, i.e.

has all the necessary details.

Parameters
DetailsIndicesThe indices of the needed details to check for.
ComboIndexThe index of the combination to examine.
Returns
The state of examination.
false if this combo should be skipped.

◆ IsDetailAvailableAtLine()

bool FBeltSlot::IsDetailAvailableAtLine ( const int32  DetailIndex)
inline

Check if a detail exists at the specified index.

Parameters
DetailIndexThe index of the detail to check for availability.
Returns
The state of examination.

◆ IsLocked()

bool FBeltSlot::IsLocked ( ) const
inline

Check if the belt slot is currently locked.

The slot is locked if its belt is locked and its index is within the range of currently iterable slots.

◆ IsSkipped()

bool FBeltSlot::IsSkipped ( const FFilter InFilter) const
inline

Check if a slot should be skipped during the iterating.

Note
You should also check your calculated combinations count during the iterating process.
Parameters
InFilterThe filter to check compatibility with.
Returns
The state of examination.

◆ IsStale()

bool FBeltSlot::IsStale ( ) const
inline

Check if the slot is marked to be removed.

Also returns true, if the subjective is disposed.

◆ IsViable() [1/2]

bool FBeltSlot::IsViable ( ) const
inline

Check if the slot is viable, i.e.

meaningful for consideration.

◆ IsViable() [2/2]

bool FBeltSlot::IsViable ( const FFilter InFilter) const
inline

Check if the slot is viable, i.e.

meaningful for consideration within a certain filter.

◆ operator bool()

FBeltSlot::operator bool ( ) const
inline

Is this slot actually valid?

◆ operator!=()

bool FBeltSlot::operator!= ( const FBeltSlot Other) const
inline

Compare two belt slots for inequality.

◆ operator=()

FBeltSlot & FBeltSlot::operator= ( const FBeltSlot InSlot)
inline

Set the slot as another one from the same belt.

Parameters
InSlotThe slot to set as.

◆ operator==()

bool FBeltSlot::operator== ( const FBeltSlot Other) const
inline

Compare two belt slots for equality.

◆ ResetDetails()

void FBeltSlot::ResetDetails ( ) const
inline

Clear all of the cached details in the slot, while actually maintaining a link to subjective itself (if any).

Performs no memory deallocations.

◆ Set()

EApparatusStatus FBeltSlot::Set ( const FBeltSlot InSlot)
inline

Set the slot as another one from the same belt.

Parameters
InSlotThe slot to set as.
Returns
The status of the operation.

◆ SetRemoved()

EApparatusStatus FBeltSlot::SetRemoved ( const bool  bInRemoved = true)

Set the slot as to be removed (or not).

If the slot is locked at the moment, it is marked to be removed and is added to a list (for deferred removal) . Otherwise, it's instantly cleared.

Friends And Related Function Documentation

◆ TArray< FBeltSlot >

friend class TArray< FBeltSlot >
friend

◆ TBeltIt

template<typename SubjectHandleT >
friend struct TBeltIt
friend

◆ UBelt

friend class UBelt
friend

◆ USubjectiveActorComponent

friend class USubjectiveActorComponent
friend

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