UMLAdapterSession

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MLAdapter

Header

/Engine/Plugins/AI/MLAdapter/Source/MLAdapter/Public/MLAdapterSession.h

Include

#include "MLAdapterSession.h"

Syntax

UCLASS()
class UMLAdapterSession : public UObject

Variables

Name Description

Protected variable

FDelegateHandle

 

ActorSpawnedDelegateHandle

Protected variable

FCriticalSectio...

 

AgentOpCS

Protected variable UProperty

TArray< UMLAdap...

 

Agents

Protected variable UProperty

TMap< uint32, U...

 

AvatarToAgent

Protected variable UProperty

TArray< UMLAdap...

 

AwaitingAvatar

Protected variable

bool

 

bActive

Protected variable

bool

 

bTickWorldManually

Protected variable UProperty

AGameModeBase &...

 

CachedGameMode

Protected variable UProperty

UWorld *

 

CachedWorld

Protected variable

float

 

LastTimestamp

Protected variable

FOnAgentAvatarC...

 

OnAgentAvatarChanged

Protected variable

FOnBeginAgentRe...

 

OnBeginAgentRemove

Protected variable

EMLAdapterSimSt...

 

SimulationState

Protected variable

TSharedPtr< FWo...

 

WorldTicker

Functions

Name Description

Public function

FMLAdapter::...

 

AddAgent()

Agent/Avatar management.

Public function

FMLAdapter::...

 

AddAgent

(
    const FMLAdapterAgentConfig& InCon...
)

Agent/Avatar management.

Public function

void

 

BindAvatar

(
    UMLAdapterAgent& Agent,
    AActor& Avatar
)

Public function

void

 

ClearAvatar

(
    UMLAdapterAgent& Agent
)

Public function Virtual

void

 

Close()

Public function Virtual

void

 

ConfigureAsClient()

This is where Session can add Client-side-specific functions by calling UMLAdapterManager::Get().AddClientFunctionBind.

Public function Virtual

void

 

ConfigureAsServer()

This is where Session can add Authority-side-specific functions by calling UMLAdapterManager::Get().AddServerFunctionBind

Public function Const

const UMLAda...

 

FindAgentByAvatar

(
    AActor& Avatar
)

Public function

void

 

FindAvatars

(
    UWorld& World
)

Finds avatar in given World for every avatar-less agent in AwaitingAvatar

Public function

UMLAdapterAg...

 

GetAgent

(
    FMLAdapter::FAgentID AgentID
)

Public function Const

int32

 

GetAgentsCount()

Public function Const

UGameInstanc...

 

GetGameInstance()

Public function Const

FMLAdapter::...

 

GetNextAgentID

(
    FMLAdapter::FAgentID ReferenceAgent...
)

That the return value might be equal to ReferenceAgentID if there's only one agent.

Public function

FOnAgentAvat...

 

GetOnAgentAvatarChanged()

Public function

FOnBeginAgen...

 

GetOnBeginAgentRemove()

Public function Const

float

 

GetTimestamp()

Public function Virtual Const

UWorld *

 

GetWorld()

Protected function Static

uint32

 

HashAvatar

(
    const AActor& Avatar
)

Public function Const

bool

 

IsAgentReady

(
    FMLAdapter::FAgentID AgentID
)

Public function Const

bool

 

IsDone()

Public function Const

bool

 

IsReady()

Public function Virtual

void

 

OnActorSpawned

(
    AActor* InActor
)

Public function Virtual

void

 

OnGameModeInitialized

(
    AGameModeBase& GameModeBase
)

Public function Virtual

void

 

OnGameModeMatchStateSet

(
    FName InMatchState
)

Public function Virtual

void

 

OnGameModePostLogin

(
    AGameModeBase* GameMode,
    APlayerController* NewPlayer
)

Public function Virtual

void

 

OnPostWorldInit

(
    UWorld& World
)

Public function Virtual

void

 

OnWorldCleanup

(
    UWorld& World,
    bool bSessionEnded,
    bool bCleanupResources
)

Public function Virtual

void

 

Open()

Public function

void

 

RemoveAgent

(
    FMLAdapter::FAgentID AgentID
)

Public function

void

 

RemoveAvatars

(
    UWorld* World
)

Processes Agents and removes all agent avatars belonging to World.

Public function

bool

 

RequestAvatarForAgent

(
    FMLAdapter::FAgentID& AgentID,
    UWorld* InWorld
)

Public function Virtual

bool

 

RequestAvatarForAgent

(
    UMLAdapterAgent& Agent,
    UWorld* InWorld,
    const bool bForceSearch
)

Finds a suitable avatar in InWorld (or CachedWorld, if InWorld is null) for given agent, as specified by FMLAdapterAgentConfig.AvatarClass and confirmed by Agent->IsSuitableAvatar call.

Public function Virtual

void

 

ResetWorld

(
    FMLAdapter::FAgentID AgentID
)

Using FMLAdapter::InvalidAgentID for AgentID will reset all agents

Protected function Virtual

void

 

SetGameMode

(
    AGameModeBase* GameModeBase
)

Debug

Public function

void

 

SetManualWorldTickEnabled

(
    bool bEnable
)

Public function Virtual

void

 

SetWorld

(
    UWorld* NewWorld
)

NewWorld might be null

Public function

void

 

Tick

(
    float DeltaTime
)

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Classes

Name

Description

Protected struct

FWorldTicker

Typedefs