IProjectVCampaignScreen interface
The Campaign screen contract: observe the view, call commands, redraw on change. Loading, retries and double-tap protection are handled for you.
Namespace: SilverTiger.ProjectV.Unity.Presentation.Campaign
public interface IProjectVCampaignScreen
Properties​
| Property | Type | Description |
|---|---|---|
Current | ProjectVCampaignView | The view right now, built from the last confirmed missions; never null. |
Methods​
Observe(Action<ProjectVCampaignView> render)​
Calls render with the current view, then again only when the missions change. Loads the missions if they are not loaded yet.
IDisposable Observe(Action<ProjectVCampaignView> render);
Parameters
| Name | Type | Description |
|---|---|---|
render | Action<ProjectVCampaignView> | Draws the page; always called on the Unity main thread. |
Returns
IDisposable: The observation; dispose it when the page closes.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | render is null. |
BeginMissionAsync(string missionId)​
Starts a run of the mission on the server; load its gameplay scene on success. Entry stamina is checked now and charged when the run ends.
Task<ProjectVResult> BeginMissionAsync(string missionId);
Parameters
| Name | Type | Description |
|---|---|---|
missionId | string | The ID of a mission in the current view that is not locked, as in MissionId.Value. |
Returns
Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server started the run. Otherwise ProjectVResult.Message is the reason to show. A second tap while a start runs, even on another mission, returns the same result; load the scene only once.
CancelSceneLoadAsync()​
Releases the run started by BeginMissionAsync when its gameplay scene cannot load, or when your scene table has no scene for it. A released run costs no stamina.
Task<ProjectVResult> CancelSceneLoadAsync();
Returns
Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server released the run. Otherwise ProjectVResult.Message is the reason to show.