Skip to main content

IProjectVAllianceScreen interface

The Alliance screen contract: observe the view, call commands, redraw on change. Loading, synchronisation, retries and double-tap protection are handled for you.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Alliance

public interface IProjectVAllianceScreen

Properties​

PropertyTypeDescription
CurrentProjectVAllianceViewThe view right now, built from the last confirmed data; never null.

Methods​

Observe(Action<ProjectVAllianceView> render)​

Calls render with the current view, then again only when the data changes. Loads the data if it is not loaded yet.

IDisposable Observe(Action<ProjectVAllianceView> render);

Parameters

NameTypeDescription
renderAction<ProjectVAllianceView>Draws the page; always called on the Unity main thread.

Returns

IDisposable: The observation; dispose it when the page closes.

Exceptions

ExceptionWhen
ArgumentNullExceptionrender is null.

SelectAllyAsync(string allyId)​

Makes an ally the one the player takes into battle. Does nothing when it is already selected.

Task<ProjectVResult> SelectAllyAsync(string allyId);

Parameters

NameTypeDescription
allyIdstringThe ID of an ally in the current view, as in ProjectVAllyView.Id.

Returns

Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server confirmed the selection. Otherwise ProjectVResult.Message is the reason to show.

LevelUpAsync(string allyId, IReadOnlyList<ProjectVCharacterXpItemSelection> items)​

Levels the ally with these EXP items, or finishes its pending upgrade (see ProjectVAllyView.HasPendingUpgrade). The view updates through Observe.

Task<ProjectVResult> LevelUpAsync(string allyId, IReadOnlyList<ProjectVCharacterXpItemSelection> items);

Parameters

NameTypeDescription
allyIdstringThe ID of an ally in the current view, as in ProjectVAllyView.Id.
itemsIReadOnlyList<ProjectVCharacterXpItemSelection>The EXP items and quantities to spend, for example from ProjectVAllyView.XpForNextLevel. Ignored when the ally has a pending upgrade.

Returns

Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server confirmed the upgrade. Otherwise ProjectVResult.Message is the reason to show, such as another ally having an upgrade pending. A second tap while the upgrade runs returns the same result.

Exceptions

ExceptionWhen
ArgumentExceptionallyId is null or blank, or items contains a null or invalid entry.
ArgumentNullExceptionitems is null.

UpgradeWeaponSkillAsync(string allyId)​

Upgrades the ally's weapon skill. Check ProjectVAllyView.WeaponSkill to show the cost and whether it can be upgraded.

Task<ProjectVResult> UpgradeWeaponSkillAsync(string allyId);

Parameters

NameTypeDescription
allyIdstringThe ID of an ally in the current view, as in ProjectVAllyView.Id.

Returns

Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server confirmed the upgrade. Otherwise ProjectVResult.Message is the reason to show. A second tap while the upgrade runs returns the same result.

Exceptions

ExceptionWhen
ArgumentExceptionallyId is null or blank.

ResetLevelAsync(string allyId)​

Resets the ally to level 1 and refunds EXP items. Check ProjectVAllyView.LevelReset to show the refund and whether the reset is possible.

Task<ProjectVResult> ResetLevelAsync(string allyId);

Parameters

NameTypeDescription
allyIdstringThe ID of an ally in the current view, as in ProjectVAllyView.Id.

Returns

Task<ProjectVResult>: ProjectVResult.IsSuccess is true when the server confirmed the reset. Otherwise ProjectVResult.Message is the reason to show. A second tap while the reset runs returns the same result.

Exceptions

ExceptionWhen
ArgumentExceptionallyId is null or blank.