Skip to content

Class FTryllAgentVariables

ClassList > FTryllAgentVariables

More...

  • #include <TryllAgentVariables.h>

Public Attributes

Type Name
TFunction< void(TArray< FTryllVariableUpdate >, TFunction< void(const FTryllError &)>)> TestSendUpdate

Public Functions

Type Name
FTryllError AddToSet (const FString & Name, const FString & Element)
TOptional< ETryllVariableType > DeclaredType (const FString & Name) const
FTryllAgentVariables (FTryllAgent * InAgent, const TArray< FTryllVariableDecl > & Declared)
void FlushIfDirty (TFunction< void(const FTryllError &)> OnComplete=nullptr, uint64 CarrierRequestId=0)
bool GetBool (const FString & Name) const
double GetFloat (const FString & Name) const
int64 GetInt (const FString & Name) const
FString GetString (const FString & Name) const
TArray< FString > GetStringSet (const FString & Name) const
bool IsDeclared (const FString & Name) const
bool IsDirty () const
FTryllError RemoveFromSet (const FString & Name, const FString & Element)
FTryllError Reset (const FString & Name)
FTryllError SetBool (const FString & Name, bool bValue)
FTryllError SetFloat (const FString & Name, double Value)
FTryllError SetInt (const FString & Name, int64 Value)
FTryllError SetString (const FString & Name, const FString & Value)
FTryllError SetStringSet (const FString & Name, const TArray< FString > & Values)
TMap< FString, FTryllVariableDecl > Snapshot () const
void SyncFromServerAsync (TArray< FString > Names={}, TFunction< void(const FTryllError &)> OnComplete=nullptr)

Detailed Description

Local mirror of one agent's declared per-agent Variables (C++ surface). Obtained via FTryllAgent::GetVariables(). Blueprint code uses the UTryllAgentVariables wrapper (UTryllAgentComponent::GetVariables()) instead.

Public Attributes Documentation

variable TestSendUpdate

TFunction<void(TArray<FTryllVariableUpdate>, TFunction<void(const FTryllError&)>)> FTryllAgentVariables::TestSendUpdate;

Test hook: when set, FlushIfDirty invokes this instead of the live agent wire send. Signature is (WireBatch, OnComplete).


Public Functions Documentation

function AddToSet

FTryllError FTryllAgentVariables::AddToSet (
    const FString & Name,
    const FString & Element
) 

Idempotent — a no-op success if Element is already present.


function DeclaredType

TOptional< ETryllVariableType > FTryllAgentVariables::DeclaredType (
    const FString & Name
) const

function FTryllAgentVariables

FTryllAgentVariables::FTryllAgentVariables (
    FTryllAgent * InAgent,
    const TArray< FTryllVariableDecl > & Declared
) 

function FlushIfDirty

void FTryllAgentVariables::FlushIfDirty (
    TFunction< void(const FTryllError &)> OnComplete=nullptr,
    uint64 CarrierRequestId=0
) 

Send every staged mutation as one batched UpdateAgentVariablesRequest. Called automatically at the top of FTryllAgent::SendMessage/Resume/ ChangeParams — deliberately NOT before Cancel. No-op (invokes OnComplete with Ok) when nothing is staged.


function GetBool

bool FTryllAgentVariables::GetBool (
    const FString & Name
) const

function GetFloat

double FTryllAgentVariables::GetFloat (
    const FString & Name
) const

function GetInt

int64 FTryllAgentVariables::GetInt (
    const FString & Name
) const

function GetString

FString FTryllAgentVariables::GetString (
    const FString & Name
) const

function GetStringSet

TArray< FString > FTryllAgentVariables::GetStringSet (
    const FString & Name
) const

function IsDeclared

inline bool FTryllAgentVariables::IsDeclared (
    const FString & Name
) const

function IsDirty

inline bool FTryllAgentVariables::IsDirty () const

True when one or more mutations are staged and not yet flushed.


function RemoveFromSet

FTryllError FTryllAgentVariables::RemoveFromSet (
    const FString & Name,
    const FString & Element
) 

Idempotent — a no-op success if Element is already absent.


function Reset

FTryllError FTryllAgentVariables::Reset (
    const FString & Name
) 

Restores the CreateAgent-time initial value for Name.


function SetBool

FTryllError FTryllAgentVariables::SetBool (
    const FString & Name,
    bool bValue
) 

function SetFloat

FTryllError FTryllAgentVariables::SetFloat (
    const FString & Name,
    double Value
) 

function SetInt

FTryllError FTryllAgentVariables::SetInt (
    const FString & Name,
    int64 Value
) 

function SetString

FTryllError FTryllAgentVariables::SetString (
    const FString & Name,
    const FString & Value
) 

function SetStringSet

FTryllError FTryllAgentVariables::SetStringSet (
    const FString & Name,
    const TArray< FString > & Values
) 

function Snapshot

inline TMap< FString, FTryllVariableDecl > FTryllAgentVariables::Snapshot () const

Copy of every declared variable's current local value, keyed by name.


function SyncFromServerAsync

void FTryllAgentVariables::SyncFromServerAsync (
    TArray< FString > Names={},
    TFunction< void(const FTryllError &)> OnComplete=nullptr
) 

Refresh the local mirror from the server's authoritative current values. Names with a locally newer (staged or in-flight) write are skipped. Empty Names = every declared variable.



The documentation for this class was generated from the following file C:/_tryll/_monorepo3/tryll/clients/unreal/Source/TryllClient/Public/TryllAgentVariables.h