Chuyển tới nội dung chính

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

NameTypeDescription
presenterIProjectVCampaignPresenterThe Campaign presenter, normally resolved from the ProjectV presentation scope.
dispatchFunc<Action, CancellationToken, Task>?Runs a draw on the Unity main thread; null draws on the calling thread.

Returns

IProjectVCampaignScreen: A new Campaign screen.

Exceptions

ExceptionWhen
ArgumentNullExceptionpresenter 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

NameTypeDescription
presenterIProjectVLobbyPresenterThe Lobby presenter, normally resolved from the ProjectV presentation scope.
dispatchFunc<Action, CancellationToken, Task>?Runs a draw on the Unity main thread; null draws on the calling thread.

Returns

IProjectVLobbyScreen: A new Lobby screen.

Exceptions

ExceptionWhen
ArgumentNullExceptionpresenter 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

NameTypeDescription
presenterIProjectVCharacterPresenterThe Character presenter the screen reads from and sends commands to.
dispatchFunc<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

ExceptionWhen
ArgumentNullExceptionpresenter 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

NameTypeDescription
snapshotProjectVCharacterSnapshotThe Character snapshot to show.
pendingProjectVCharacterProgressionPending?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

ExceptionWhen
ArgumentNullExceptionsnapshot 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

NameTypeDescription
presenterIProjectVAlliancePresenterThe Alliance presenter the screen reads from and sends commands to.
dispatchFunc<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

ExceptionWhen
ArgumentNullExceptionpresenter 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

NameTypeDescription
presenterIProjectVShopPresenterThe Shop presenter, normally resolved from the ProjectV presentation scope.
dispatchFunc<Action, CancellationToken, Task>?Runs a draw on the Unity main thread; null draws on the calling thread.

Returns

IProjectVShopScreen: A new Shop screen.

Exceptions

ExceptionWhen
ArgumentNullExceptionpresenter is null.