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

The trait-only fingerprint part. More...

#include <Traitmark.h>

Collaboration diagram for FTraitmark:
Collaboration graph
[legend]

Public Types

enum  { InvalidTraitId = -1 }
 

Public Member Functions

EBootFilter GetBootState () const
 Get the active boot state. More...
 
EApparatusStatus SetBootState (const EBootFilter InBootState)
 Set the new active boot state. More...
 
EApparatusStatus SetBooted (bool bState=true)
 Set the new active boot state. More...
 
bool IsBooted () const
 Check if the traitmark corresponds to a booted entity. More...
 
const TArray< UScriptStruct * > & GetTraits () const
 Get the traits of the traitmark. More...
 
int32 TraitsNum () const
 The number of traits in the traitmark. More...
 
const FBitMaskGetTraitsMask () const
 Get the traits mask of the traitmark. More...
 
UScriptStruct * TraitAt (const int32 Index) const
 Get a trait type by its index. More...
 
UScriptStruct * operator[] (int32 Index) const
 Get a trait type by its index. More...
 
 operator bool () const
 Check if a traitmark is viable and has any actual effect. More...
 
int32 IndexOf (const UScriptStruct *TraitType) const
 Get the index of a specific trait type. More...
 
template<typename TAllocator >
EApparatusStatus FindMappingFrom (const TArray< UScriptStruct * > &Traitmark, TArray< int32, TAllocator > &OutMapping) const
 Get an indexing mapping from another traitmark defined by an array of traits. More...
 
template<typename TAllocator >
EApparatusStatus FindMappingFrom (const FTraitmark &Traitmark, TArray< int32, TAllocator > &OutMapping) const
 Get an indexing mapping from another traitmark's traits. More...
 
template<typename TAllocator >
EApparatusStatus FindMappingTo (const TArray< UScriptStruct * > &Traitmark, TArray< int32, TAllocator > &OutMapping) const
 Get an indexing mapping to an another traitmark defined by an array of traits. More...
 
template<typename TAllocator >
EApparatusStatus FindMappingTo (const FTraitmark &Traitmark, TArray< int32, TAllocator > &OutMapping) const
 Get an indexing traits mapping to another traitmark. More...
 
bool Contains (const UScriptStruct *TraitType) const
 Check if the traitmark includes a trait type. More...
 
template<typename T >
bool Contains () const
 Check if the traitmark includes a trait type. More...
 
bool Matches (const struct FFilter &Filter) const
 Check if the traitmark matches a filter. More...
 
bool Matches (const struct FTraitmark &Traitmark) const
 Check if the traitmark matches another traitmark acting as a filter. More...
 
EApparatusStatus Set (const TArray< UScriptStruct * > &InTraits, const EBootFilter InBootState=EBootFilter::None)
 Set a traitmark to an array of traits and a boot state. More...
 
EApparatusStatus Set (FTraitmark &&InTraitmark)
 Move a traitmark to this traitmark. More...
 
EApparatusStatus Set (const FTraitmark &InTraitmark)
 Set a traitmark equal to another traitmark. More...
 
FTraitmarkoperator= (FTraitmark &&InTraitmark)
 Move a traitmark. More...
 
FTraitmarkoperator= (const FTraitmark &InTraitmark)
 Set a traitmark equal to another traitmark. More...
 
EApparatusStatus Add (std::initializer_list< UScriptStruct * > TraitTypes)
 Add trait types to a fingerprint. More...
 
EApparatusStatus Add (const EBootFilter InBootState)
 Add a boot state specification. More...
 
EApparatusStatus Add (const FTraitmark &Traitmark, const EBootFilter InBootState=EBootFilter::None)
 Add a traitmark. More...
 
EApparatusStatus Add (UScriptStruct *TraitType)
 Add a trait type. More...
 
EApparatusStatus Add (const TArray< UScriptStruct * > &InTraits, const EBootFilter InBootState=EBootFilter::None)
 Add an array of traits and a boot state specification. More...
 
template<typename T >
EApparatusStatus Add (const EBootFilter InBootState=EBootFilter::None)
 Add a generic trait type. More...
 
FTraitmarkoperator+= (std::initializer_list< UScriptStruct * > TraitTypes)
 Add variadic trait types. More...
 
FTraitmarkoperator+= (const TArray< UScriptStruct * > &TraitTypes)
 Add an array of trait types. More...
 
FTraitmarkoperator+= (UScriptStruct *TraitType)
 Add a single trait type. More...
 
EApparatusStatus Remove (UScriptStruct *TraitType)
 Remove a trait type from the traitmark specification. More...
 
FTraitmarkoperator-= (UScriptStruct *TraitType)
 Remove a trait type from the traitmark. More...
 
template<typename T >
EApparatusStatus Remove ()
 Remove a type from a traitmark. More...
 
EApparatusStatus Reset ()
 Clear the traitmark without any deallocations. More...
 
FString ToString () const
 Convert a traitmark to a string. More...
 
 FTraitmark (const EBootFilter InBootState=EBootFilter::None)
 
 FTraitmark (FTraitmark &&Traitmark)
 
 FTraitmark (const FTraitmark &Traitmark)
 
 FTraitmark (const FTraitmark &Traitmark, const EBootFilter InBootState)
 
 FTraitmark (UScriptStruct *TraitType, const EBootFilter InBootState=EBootFilter::None)
 Initialize a new traitmark with a single detail type. More...
 
template<typename TAllocator >
 FTraitmark (const TArray< UScriptStruct *, TAllocator > &InTraits, const EBootFilter InBootState=EBootFilter::None)
 

Static Public Member Functions

static int32 GetTraitId (const UScriptStruct *TraitType)
 Get a trait's unique identifier. More...
 
static const FBitMaskGetTraitMask (const UScriptStruct *TraitType)
 Get the cached mask for a trait type. More...
 
template<class T >
static const FBitMaskGetTraitMask ()
 Get the mask of a trait. More...
 

Static Public Attributes

static const struct FTraitmark Zero = FTraitmark()
 An empty traitmark constant. More...
 
static const struct FTraitmark Halted = FTraitmark(EBootFilter::Halted)
 The default traitmark for newly spanwed subjects. More...
 

Friends

struct FFingerprint
 
struct FFilter
 
class UChunk
 
struct FSubjectHandle
 
class UBelt
 
class AMechanism
 
class UApparatusFunctionLibrary
 

Detailed Description

The trait-only fingerprint part.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidTraitId 

Invalid trait identifier.

Constructor & Destructor Documentation

◆ FTraitmark() [1/6]

FTraitmark::FTraitmark ( const EBootFilter  InBootState = EBootFilter::None)
inline

◆ FTraitmark() [2/6]

FTraitmark::FTraitmark ( FTraitmark &&  Traitmark)
inline

◆ FTraitmark() [3/6]

FTraitmark::FTraitmark ( const FTraitmark Traitmark)
inline

◆ FTraitmark() [4/6]

FTraitmark::FTraitmark ( const FTraitmark Traitmark,
const EBootFilter  InBootState 
)
inline

◆ FTraitmark() [5/6]

FTraitmark::FTraitmark ( UScriptStruct *  TraitType,
const EBootFilter  InBootState = EBootFilter::None 
)
inline

Initialize a new traitmark with a single detail type.

Parameters
TraitTypeA detail type to initialize with.

◆ FTraitmark() [6/6]

template<typename TAllocator >
FTraitmark::FTraitmark ( const TArray< UScriptStruct *, TAllocator > &  InTraits,
const EBootFilter  InBootState = EBootFilter::None 
)
inline

Member Function Documentation

◆ Add() [1/6]

EApparatusStatus FTraitmark::Add ( const EBootFilter  InBootState)
inline

Add a boot state specification.

Returns
The status of the operation.

◆ Add() [2/6]

template<typename T >
EApparatusStatus FTraitmark::Add ( const EBootFilter  InBootState = EBootFilter::None)
inline

Add a generic trait type.

Returns
The status of the operation.

◆ Add() [3/6]

EApparatusStatus FTraitmark::Add ( const FTraitmark Traitmark,
const EBootFilter  InBootState = EBootFilter::None 
)
inline

Add a traitmark.

Returns
The status of the operation.

◆ Add() [4/6]

EApparatusStatus FTraitmark::Add ( const TArray< UScriptStruct * > &  InTraits,
const EBootFilter  InBootState = EBootFilter::None 
)
inline

Add an array of traits and a boot state specification.

Returns
The status of the operation.

◆ Add() [5/6]

EApparatusStatus FTraitmark::Add ( std::initializer_list< UScriptStruct * >  TraitTypes)
inline

Add trait types to a fingerprint.

Returns
The status of the operation.

◆ Add() [6/6]

EApparatusStatus FTraitmark::Add ( UScriptStruct *  TraitType)
inline

Add a trait type.

Parameters
TraitTypeA type of the detail to add.
Returns
The status of the operation.

◆ Contains() [1/2]

template<typename T >
bool FTraitmark::Contains ( ) const
inline

Check if the traitmark includes a trait type.

◆ Contains() [2/2]

bool FTraitmark::Contains ( const UScriptStruct *  TraitType) const
inline

Check if the traitmark includes a trait type.

◆ FindMappingFrom() [1/2]

template<typename TAllocator >
EApparatusStatus FTraitmark::FindMappingFrom ( const FTraitmark Traitmark,
TArray< int32, TAllocator > &  OutMapping 
) const
inline

Get an indexing mapping from another traitmark's traits.

Parameters
FingerprintA traitmark to get a mapping from.
OutMappingThe resulting traits mapping.

◆ FindMappingFrom() [2/2]

template<typename TAllocator >
EApparatusStatus FTraitmark::FindMappingFrom ( const TArray< UScriptStruct * > &  Traitmark,
TArray< int32, TAllocator > &  OutMapping 
) const
inline

Get an indexing mapping from another traitmark defined by an array of traits.

Parameters
TraitmarkA traitmark to get a mapping from.
OutMappingThe resulting mapping.

◆ FindMappingTo() [1/2]

template<typename TAllocator >
EApparatusStatus FTraitmark::FindMappingTo ( const FTraitmark Traitmark,
TArray< int32, TAllocator > &  OutMapping 
) const
inline

Get an indexing traits mapping to another traitmark.

Parameters
TraitmarkA traitmark to get the traits mapping to.
OutMappingThe resulting mapping.

◆ FindMappingTo() [2/2]

template<typename TAllocator >
EApparatusStatus FTraitmark::FindMappingTo ( const TArray< UScriptStruct * > &  Traitmark,
TArray< int32, TAllocator > &  OutMapping 
) const
inline

Get an indexing mapping to an another traitmark defined by an array of traits.

Parameters
TraitmarkA traitmark to get a mapping to.
OutMappingThe resulting mapping.

◆ GetBootState()

EBootFilter FTraitmark::GetBootState ( ) const
inline

Get the active boot state.

◆ GetTraitId()

int32 FTraitmark::GetTraitId ( const UScriptStruct *  TraitType)
inlinestatic

Get a trait's unique identifier.

◆ GetTraitMask() [1/2]

template<class T >
static const FBitMask& FTraitmark::GetTraitMask ( )
inlinestatic

Get the mask of a trait.

◆ GetTraitMask() [2/2]

const FBitMask & FTraitmark::GetTraitMask ( const UScriptStruct *  TraitType)
inlinestatic

Get the cached mask for a trait type.

◆ GetTraits()

const TArray<UScriptStruct*>& FTraitmark::GetTraits ( ) const
inline

Get the traits of the traitmark.

◆ GetTraitsMask()

const FBitMask& FTraitmark::GetTraitsMask ( ) const
inline

Get the traits mask of the traitmark.

Constant version.

◆ IndexOf()

int32 FTraitmark::IndexOf ( const UScriptStruct *  TraitType) const
inline

Get the index of a specific trait type.

◆ IsBooted()

bool FTraitmark::IsBooted ( ) const
inline

Check if the traitmark corresponds to a booted entity.

◆ Matches() [1/2]

bool FTraitmark::Matches ( const struct FFilter Filter) const

Check if the traitmark matches a filter.

◆ Matches() [2/2]

bool FTraitmark::Matches ( const struct FTraitmark Traitmark) const

Check if the traitmark matches another traitmark acting as a filter.

◆ operator bool()

FTraitmark::operator bool ( ) const
inline

Check if a traitmark is viable and has any actual effect.

◆ operator+=() [1/3]

FTraitmark& FTraitmark::operator+= ( const TArray< UScriptStruct * > &  TraitTypes)
inline

Add an array of trait types.

◆ operator+=() [2/3]

FTraitmark& FTraitmark::operator+= ( std::initializer_list< UScriptStruct * >  TraitTypes)
inline

Add variadic trait types.

◆ operator+=() [3/3]

FTraitmark& FTraitmark::operator+= ( UScriptStruct *  TraitType)
inline

Add a single trait type.

◆ operator-=()

FTraitmark& FTraitmark::operator-= ( UScriptStruct *  TraitType)
inline

Remove a trait type from the traitmark.

◆ operator=() [1/2]

FTraitmark& FTraitmark::operator= ( const FTraitmark InTraitmark)
inline

Set a traitmark equal to another traitmark.

◆ operator=() [2/2]

FTraitmark& FTraitmark::operator= ( FTraitmark &&  InTraitmark)
inline

Move a traitmark.

◆ operator[]()

UScriptStruct* FTraitmark::operator[] ( int32  Index) const
inline

Get a trait type by its index.

◆ Remove() [1/2]

template<typename T >
EApparatusStatus FTraitmark::Remove ( )
inline

Remove a type from a traitmark.

Returns
The status of the operation.

◆ Remove() [2/2]

EApparatusStatus FTraitmark::Remove ( UScriptStruct *  TraitType)
inline

Remove a trait type from the traitmark specification.

Parameters
TraitTypeA trait type to remove.
Returns
The status of the operation.

◆ Reset()

EApparatusStatus FTraitmark::Reset ( )
inline

Clear the traitmark without any deallocations.

◆ Set() [1/3]

EApparatusStatus FTraitmark::Set ( const FTraitmark InTraitmark)
inline

Set a traitmark equal to another traitmark.

◆ Set() [2/3]

EApparatusStatus FTraitmark::Set ( const TArray< UScriptStruct * > &  InTraits,
const EBootFilter  InBootState = EBootFilter::None 
)

Set a traitmark to an array of traits and a boot state.

◆ Set() [3/3]

EApparatusStatus FTraitmark::Set ( FTraitmark &&  InTraitmark)
inline

Move a traitmark to this traitmark.

◆ SetBooted()

EApparatusStatus FTraitmark::SetBooted ( bool  bState = true)
inline

Set the new active boot state.

Returns
The status of the operation.

◆ SetBootState()

EApparatusStatus FTraitmark::SetBootState ( const EBootFilter  InBootState)
inline

Set the new active boot state.

Returns
The status of the operation.

◆ ToString()

FString FTraitmark::ToString ( ) const

Convert a traitmark to a string.

◆ TraitAt()

UScriptStruct* FTraitmark::TraitAt ( const int32  Index) const
inline

Get a trait type by its index.

◆ TraitsNum()

int32 FTraitmark::TraitsNum ( ) const
inline

The number of traits in the traitmark.

Friends And Related Function Documentation

◆ AMechanism

friend class AMechanism
friend

◆ FFilter

friend struct FFilter
friend

◆ FFingerprint

friend struct FFingerprint
friend

◆ FSubjectHandle

friend struct FSubjectHandle
friend

◆ UApparatusFunctionLibrary

friend class UApparatusFunctionLibrary
friend

◆ UBelt

friend class UBelt
friend

◆ UChunk

friend class UChunk
friend

Member Data Documentation

◆ Halted

const FTraitmark FTraitmark::Halted = FTraitmark(EBootFilter::Halted)
static

The default traitmark for newly spanwed subjects.

◆ Zero

const FTraitmark FTraitmark::Zero = FTraitmark()
static

An empty traitmark constant.


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