Class GameplayReadinessGate
Default IGameplayReadinessGate implementation backed by a TaskCompletionSource<TResult>. Thread-safe; MarkReady() is idempotent within a session and Reset() rearms the gate for the next session.
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 state.
Declaration
public GameplayReadinessGate()
Properties
IsReady
True once MarkReady() has been called for the current session.
Declaration
public bool IsReady { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
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 |