IProjectVLobbyPresenter interface
Lower-level Lobby state source. Most screens should use IProjectVLobbyScreen, which loads and redraws for you.
Namespace: SilverTiger.ProjectV.Unity.Presentation.Lobby
public interface IProjectVLobbyPresenter
Properties​
| Property | Type | Description |
|---|---|---|
Current | ProjectVLobbySnapshot | The latest Lobby state; never null. |
Methods​
SubscribeAsync(Action<ProjectVLobbySnapshot> listener)​
Calls listener right away with Current, then again with each new snapshot. Updates may arrive off the Unity main thread.
Task<IDisposable> SubscribeAsync(Action<ProjectVLobbySnapshot> listener);
Parameters
| Name | Type | Description |
|---|---|---|
listener | Action<ProjectVLobbySnapshot> | Called with each snapshot. An exception it throws on a later update is ignored. |
Returns
Task<IDisposable>: A subscription; dispose it to stop receiving updates.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | listener is null. |
ObjectDisposedException | The presenter was already disposed. |
RefreshAsync(CancellationToken cancellationToken)​
Loads the player's profile and level, publishing ProjectVLobbyStatus.Refreshing and then the result to subscribers. Calls run one at a time. A failure does not throw; it is in the result.
Task<ProjectVLobbyCommandResult> RefreshAsync(CancellationToken cancellationToken);
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken | CancellationToken | Cancels the load; the result then fails with a cancelled error. |
Returns
Task<ProjectVLobbyCommandResult>: The new state. ProjectVLobbyCommandResult.IsSuccess is false when the load failed, was cancelled, or the player signed out meanwhile.
Exceptions
| Exception | When |
|---|---|
ObjectDisposedException | The presenter was already disposed. |