Class UZagalaSpecCEEnsureTestWorld#

Inheritance Relationships#

Base Type#

Class Documentation#

class UZagalaSpecCEEnsureTestWorld : public UZagalaSpecDefaultExecutionStep#

Context extension step that ensures an active test UWorld is available.

Handles both execution environments transparently:

Editor builds (WITH_EDITOR): Always starts a fresh PIE session. A running session (for example one still ending from the previous scenario) is ended first and the new one is requested once PlayWorld is gone. When the settings ask for a listen server, PIE runs under one process with the host plus NumberOfClients clients. Waits for FEditorDelegates::PostPIEStarted with a configurable timeout, then stores a UZagalaSpecDataPlaySessionWorld (the listen server world when networked) in the scenario context cache. Teardown ends the PIE session.

Packaged game builds (non-editor): Calls UGameplayStatics::OpenLevel to load the configured map, waits for FCoreUObjectDelegates::PostLoadMapWithWorld, then stores a UZagalaSpecDataPlaySessionWorld wrapping the loaded world (or GWorld when no map is configured). Teardown only removes pending delegates (the game always has an active world).

Pattern: ^(?:Given |And )?a (test world) is ready$ Registered by UZagalaSpecExamplesStepEntryEnsureTestWorld.

Public Functions

UZagalaSpecCEEnsureTestWorld(const FObjectInitializer &ObjectInitializer = FObjectInitializer::Get())#

Protected Functions

virtual void InternalExecute_Implementation(const TScriptInterface<IZagalaSpecTaggedDataCacher> &AssignedCacher) override#

Native implementation of InternalExecute(); broadcasts a failure unless overridden.

Parameters:

AssignedCacher – The tagged data cache assigned to this link.

virtual void InternalTeardown_Implementation() override#

Native implementation of InternalTeardown(); does nothing by default.

Protected Attributes

TObjectPtr<UZagalaSpecPlaySessionSettings> SettingsAsset#

Optional settings asset.

Controls map, timing, and fixed timestep. If null, uses defaults.