Skip to main content

IProjectVGameplayDataPresenter interface

The mission scene's link to the current run: report skill uses and send the result. You receive it in IProjectVGameplayDataConsumer.BindGameplayData; it also implements IProjectVGameplayDataPolicy. Once unbound, every call fails.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Gameplay

public interface IProjectVGameplayDataPresenter

Properties​

PropertyTypeDescription
OwnsAuthoritativeRunboolTrue while this presenter belongs to a started run that was not cancelled. Check it before using the presenter.
IsSettlementConfirmedboolTrue once the server confirmed the end of the run. Keep your local run data until then.

Methods​

RecordSkillActivated(ProjectVGameplaySkillId skillId, ProjectVGameplayDataSkillSlot slot)​

Records one use of an active skill. Call it each time the player uses a skill.

ProjectVGameplayDataResult RecordSkillActivated(ProjectVGameplaySkillId skillId, ProjectVGameplayDataSkillSlot slot);

Parameters

NameTypeDescription
skillIdProjectVGameplaySkillIdThe skill used: the ProjectVGameplayCastSkillView.SkillId of the matching slot.
slotProjectVGameplayDataSkillSlotThe slot of the skill.

Returns

ProjectVGameplayDataResult: Success when recorded. A failure when the skill does not match the slot in ProjectVGameplayStartingDataView.CastSkills, the outcome is already reported, or the presenter no longer belongs to the run.

Exceptions

ExceptionWhen
ArgumentOutOfRangeExceptionslot is not a defined slot.

CompleteAsync(ProjectVGameplayCompletionView input, CancellationToken cancellationToken)​

Sends the result of the run and waits for the server. After a success, calling again returns the same result. After a failure, call again with the same input to retry.

Task<ProjectVGameplayDataResult> CompleteAsync(ProjectVGameplayCompletionView input, CancellationToken cancellationToken);

Parameters

NameTypeDescription
inputProjectVGameplayCompletionViewThe result of the run.
cancellationTokenCancellationTokenStops waiting for the server.

Returns

Task<ProjectVGameplayDataResult>: On success, ProjectVGameplayDataResult.Rewards, ProjectVGameplayDataResult.MailedRewards and ProjectVGameplayDataResult.Stars are what to show. On failure, keep the result screen open with Retry.

Exceptions

ExceptionWhen
ArgumentNullExceptioninput is null.
ArgumentExceptionA value in input is out of range, such as negative health or an undefined outcome.

CancelRunAsync(CancellationToken cancellationToken)​

Ends the run without settling it, for Pause > Restart. A cancelled run costs no stamina; start the mission again with a new admission.

Task<ProjectVGameplayDataResult> CancelRunAsync(CancellationToken cancellationToken);

Parameters

NameTypeDescription
cancellationTokenCancellationTokenStops waiting for the server.

Returns

Task<ProjectVGameplayDataResult>: Success when the run was cancelled. A failure when the outcome is already reported (settle it with a completion instead) or the presenter no longer belongs to the run.