Class UZagalaSpecPDWaitForTicks#
Defined in File ZagalaSpecPDWaitForTicks.h
Inheritance Relationships#
Base Type#
public UZagalaSpecDefaultChainLink(Class UZagalaSpecDefaultChainLink)
Derived Types#
public UZagalaSpecPDCheckDisplacement(Class UZagalaSpecPDCheckDisplacement)public UZagalaSpecPDCheckHeading(Class UZagalaSpecPDCheckHeading)public UZagalaSpecPDCheckHoverHeightRange(Class UZagalaSpecPDCheckHoverHeightRange)public UZagalaSpecPDWaitForActivation(Class UZagalaSpecPDWaitForActivation)public UZagalaSpecPDWaitForClientConnections(Class UZagalaSpecPDWaitForClientConnections)
Class Documentation#
-
class UZagalaSpecPDWaitForTicks : public UZagalaSpecDefaultChainLink#
Protocol driver chain link that waits for a configurable number of ticks of the play session world before broadcasting success.
Base class: subclasses override OnTickCheck to implement condition polling (e.g. wait until height stabilises, wait until displacement threshold is met).
Ticks are counted from FWorldDelegates::OnWorldPostActorTick for the cached world only, so the count matches the simulation: Slate throttling, paused worlds and fixed-step PIE (several world ticks per engine frame) cannot desynchronise it, unlike the application-wide FTSTicker. FTimerManager is not used because it ticks at most once per engine frame.
Plain wait usage: use this class directly; OnTickCheck returns Continue by default until WaitTicks is exhausted, then the driver broadcasts success.
Cache contract (AssignedCacher, forwarded from the owning step): Reads: UZagalaSpecDataWaitTicks — number of ticks to wait (required unless TickLimit is present) UZagalaSpecDataTickLimit — max ticks before failure (optional; defaults to WaitTicks * 2 if absent, so it will never be triggered) UZagalaSpecDataPlaySessionWorld — world whose ticks are counted (required) Writes: (none)
Tick evaluation order (each tick of the cached world):
Call OnTickCheck — if Fail → BroadcastFailure; if Succeed → BroadcastSuccess.
If TickLimit exceeded → BroadcastFailure.
If WaitTicks reached → BroadcastSuccess.
Otherwise → keep listening. If the cached world is cleaned up while waiting, the driver broadcasts failure.
Subclassed by UZagalaSpecPDCheckDisplacement, UZagalaSpecPDCheckHeading, UZagalaSpecPDCheckHoverHeightRange, UZagalaSpecPDWaitForActivation, UZagalaSpecPDWaitForClientConnections
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.
-
void RemoveTickListener()#
-
bool IsWaitingForTicks() const#
True while the driver is listening for world ticks (InternalExecute succeeded and no outcome was broadcast yet).
-
void FinishWithSuccess()#
Stops listening for world ticks, then broadcasts success.
-
void FinishWithFailure(const FString &Reason)#
Stops listening for world ticks, then broadcasts failure.
Use from subclasses after Super::InternalExecute started the wait.
-
virtual EZagalaSpecTickCheckResult OnTickCheck(IZagalaSpecTaggedDataCacher *Cacher, int32 TicksSoFar, FString &OutFailureReason)#
Called each tick of the play session world while this driver is running.
Override in subclasses to add polling logic.
- Parameters:
Cacher – The AssignedCacher passed to InternalExecute.
TicksSoFar – Number of ticks elapsed since InternalExecute was called.
OutFailureReason – Set if returning Fail; left unchanged otherwise.
- Returns:
TickCheckResult indicating how to proceed.
-
int32 GetElapsedTicks()#
Returns the number of ticks elapsed since InternalExecute was called.
Protected Attributes
-
IZagalaSpecTaggedDataCacher *CachedCacher = nullptr#
The AssignedCacher passed to InternalExecute; valid only while ticking.
-
int32 CachedWaitTicks = 0#
Number of ticks to wait before broadcasting success.
-
int32 CachedTickLimit = 0#
Maximum ticks allowed before broadcasting failure.