Class GameplayReadinessGate
Default IGameplayReadinessGate implementation backed by a TaskCompletionSource<TResult>. Thread-safe; MarkReady() is idempotent within a session and Reset() clears readiness for the next session without affecting IsArmed.
Implements
Inherited Members
Namespace: Serenity.GameMode.Application.Services
Assembly: Serenity.GameMode.Application.dll
Syntax
public class GameplayReadinessGate : IGameplayReadinessGate
Constructors
GameplayReadinessGate()
Creates a gate in the not-ready, not-armed state.
Declaration
public GameplayReadinessGate()
Properties
IsArmed
True once Arm() has been called. A standing declaration that the game has code-driven post-load initialization and the loading overlay should wait for it.
Declaration
public bool IsArmed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsReady
True once MarkReady() has been called for the current session.
Declaration
public bool IsReady { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Arm()
Declares that the game has code-driven post-load initialization: the gameplay-load coroutine will wait for MarkReady() (bounded by a safety timeout) instead of revealing the scene immediately. Idempotent — call once, before the first gameplay scene load.
Declaration
public void Arm()
Remarks
Reset() does NOT clear the armed state; arming is sticky for the gate's lifetime.
MarkReady()
Marks the current session ready. Idempotent within a session.
Declaration
public void MarkReady()
Reset()
Resets the gate so the next session starts in the not-ready state.
Declaration
public void Reset()
WaitUntilReadyAsync(CancellationToken)
Completes when the current session is marked ready, or when
cancellationToken is cancelled.
Declaration
public Task WaitUntilReadyAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |