ProjectVScreens class
Creates screens from their presenters when you do not use ProjectVPresentationLifetimeScope, for example in tests or tools. Inside that scope, inject the screen interfaces instead.
Namespace: SilverTiger.ProjectV.Unity.Presentation
public static class ProjectVScreens
Methods
Campaign(IProjectVCampaignPresenter presenter, Func<Action, CancellationToken, Task>? dispatch)
Creates the Campaign screen contract for a page.
public static IProjectVCampaignScreen Campaign(IProjectVCampaignPresenter presenter, Func<Action, CancellationToken, Task>? dispatch = null);
Parameters
| Name | Type | Description |
|---|---|---|
presenter | IProjectVCampaignPresenter | The Campaign presenter, normally resolved from the ProjectV presentation scope. |
dispatch | Func<Action, CancellationToken, Task>? | Runs a draw on the Unity main thread; null draws on the calling thread. |
Returns
IProjectVCampaignScreen: A new Campaign screen.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | presenter is null. |
Lobby(IProjectVLobbyPresenter presenter, Func<Action, CancellationToken, Task>? dispatch)
Creates the Lobby screen on top of a Lobby presenter.
public static IProjectVLobbyScreen Lobby(IProjectVLobbyPresenter presenter, Func<Action, CancellationToken, Task>? dispatch = null);
Parameters
| Name | Type | Description |
|---|---|---|
presenter | IProjectVLobbyPresenter | The Lobby presenter, normally resolved from the ProjectV presentation scope. |
dispatch | Func<Action, CancellationToken, Task>? | Runs a draw on the Unity main thread; null draws on the calling thread. |
Returns
IProjectVLobbyScreen: A new Lobby screen.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | presenter is null. |
Character(IProjectVCharacterPresenter presenter, Func<Action, CancellationToken, Task>? dispatch)
Creates the Character screen over a Character presenter.
public static IProjectVCharacterScreen Character(IProjectVCharacterPresenter presenter, Func<Action, CancellationToken, Task>? dispatch = null);
Parameters
| Name | Type | Description |
|---|---|---|
presenter | IProjectVCharacterPresenter | The Character presenter the screen reads from and sends commands to. |
dispatch | Func<Action, CancellationToken, Task>? | Runs a render step on the Unity main thread; pass null to render on the calling thread. |
Returns
IProjectVCharacterScreen: A new Character screen.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | presenter is null. |
CharacterView(ProjectVCharacterSnapshot snapshot, ProjectVCharacterProgressionPending? pending)
Builds a Character view from one snapshot, without a presenter, for tools and tests. Upgrade previews on the view use that snapshot's data.
public static ProjectVCharacterView CharacterView(ProjectVCharacterSnapshot snapshot, ProjectVCharacterProgressionPending? pending = null);
Parameters
| Name | Type | Description |
|---|---|---|
snapshot | ProjectVCharacterSnapshot | The Character snapshot to show. |
pending | ProjectVCharacterProgressionPending? | A level-up, rank or reset still waiting for the server, or null when there is none. |
Returns
ProjectVCharacterView: The view of snapshot, or a loading view that carries the snapshot's error message when the snapshot has no data yet.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | snapshot is null. |
Alliance(IProjectVAlliancePresenter presenter, Func<Action, CancellationToken, Task>? dispatch)
Creates the Alliance screen over an Alliance presenter.
public static IProjectVAllianceScreen Alliance(IProjectVAlliancePresenter presenter, Func<Action, CancellationToken, Task>? dispatch = null);
Parameters
| Name | Type | Description |
|---|---|---|
presenter | IProjectVAlliancePresenter | The Alliance presenter the screen reads from and sends commands to. |
dispatch | Func<Action, CancellationToken, Task>? | Runs a render step on the Unity main thread; pass null to render on the calling thread. |
Returns
IProjectVAllianceScreen: A new Alliance screen.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | presenter is null. |
Shop(IProjectVShopPresenter presenter, Func<Action, CancellationToken, Task>? dispatch)
Creates the Shop screen on top of a Shop presenter.
public static IProjectVShopScreen Shop(IProjectVShopPresenter presenter, Func<Action, CancellationToken, Task>? dispatch = null);
Parameters
| Name | Type | Description |
|---|---|---|
presenter | IProjectVShopPresenter | The Shop presenter, normally resolved from the ProjectV presentation scope. |
dispatch | Func<Action, CancellationToken, Task>? | Runs a draw on the Unity main thread; null draws on the calling thread. |
Returns
IProjectVShopScreen: A new Shop screen.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | presenter is null. |