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

The main entity of the Apparatus, consisting of traits. More...

#include <SubjectHandle.h>

Collaboration diagram for FSubjectHandle:
Collaboration graph
[legend]

Public Types

enum  { InvalidId = FSubjectInfo::InvalidId , InvalidGeneration = FSubjectInfo::InvalidGeneration }
 

Public Member Functions

EApparatusStatus Despawn ()
 Destroy the subject. More...
 
bool Contains (const UScriptStruct *Trait) const
 Check if a subject contains a trait. More...
 
class UChunkGetChunk () const
 Get the current chunk of the subject. More...
 
bool IsValid () const
 Check if the subject is valid. More...
 
 operator bool () const
 Check if the subject is valid. More...
 
EApparatusStatus SetTrait (UScriptStruct *TraitType, const void *const TraitData)
 Set a trait of the subject by its type. More...
 
EApparatusStatus GetTrait (UScriptStruct *TraitType, void *const TraitData, const bool bTraitDataInitialized=true)
 Get a trait from a subject by its type. More...
 
EApparatusStatus ObtainTrait (UScriptStruct *TraitType, void *const TraitData, const bool bTraitDataInitialized=true)
 Obtain a trait from a subject by its type. More...
 
EApparatusStatus RemoveTrait (UScriptStruct *TraitType)
 Remove a trait from the subject. More...
 
void Reset () const
 Clear the subject handle, making it invalid. More...
 

Static Public Attributes

static const FSubjectHandle INVALID
 A global constant for an invalid (NULL) subject handle. More...
 

Friends

struct FSubjectInfo
 
struct FChunkChain
 
class UChunk
 
class UMachine
 
class ISubjective
 

Detailed Description

The main entity of the Apparatus, consisting of traits.

This is a user-level handle structure, something like a pointer. The size of this structure is exactly 64-bit and may be passed by value.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InvalidId 

Invalid subject identifier.

InvalidGeneration 

Invalid subject generation.

Member Function Documentation

◆ Contains()

bool FSubjectHandle::Contains ( const UScriptStruct *  Trait) const
inline

Check if a subject contains a trait.

Parameters
SubjectThe subject to examine.
TraitA trait to check for.
Returns
true If the trait exists in the subject.
false If there is no such trait in the subject.

◆ Despawn()

EApparatusStatus FSubjectHandle::Despawn ( )

Destroy the subject.

Returns
The status of the operation.

◆ GetChunk()

UChunk * FSubjectHandle::GetChunk ( ) const
inline

Get the current chunk of the subject.

Returns
A chunk, this subject is part of.

◆ GetTrait()

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

Get a trait from a subject by its type.

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

◆ IsValid()

bool FSubjectHandle::IsValid ( ) const
inline

Check if the subject is valid.

Returns
Returns true if the subject is valid. Otherwise, false is returned.

◆ ObtainTrait()

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

Obtain a trait from a subject by its type.

If the trait is not currently within the subject, it gets created and the default value gets copied.

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

◆ operator bool()

FSubjectHandle::operator bool ( ) const
inline

Check if the subject is valid.

Returns
Returns true if the subject is valid. Otherwise, false is returned.

◆ RemoveTrait()

EApparatusStatus FSubjectHandle::RemoveTrait ( UScriptStruct *  TraitType)

Remove a trait from the subject.

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

◆ Reset()

void FSubjectHandle::Reset ( ) const
inline

Clear the subject handle, making it invalid.

◆ SetTrait()

EApparatusStatus FSubjectHandle::SetTrait ( UScriptStruct *  TraitType,
const void *const  TraitData 
)
inline

Set a trait of the subject by its type.

If the trait is not currently within the subject, it gets created and the default value gets copied.

Parameters
TraitTypeThe type of the trait to add.
TraitDataThe trait data to initialize with.
Returns
The status of the operation.

Friends And Related Function Documentation

◆ FChunkChain

friend struct FChunkChain
friend

◆ FSubjectInfo

friend struct FSubjectInfo
friend

◆ ISubjective

friend class ISubjective
friend

◆ UChunk

friend class UChunk
friend

◆ UMachine

friend class UMachine
friend

Member Data Documentation

◆ INVALID

const FSubjectHandle FSubjectHandle::INVALID
static

A global constant for an invalid (NULL) subject handle.


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