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

ProjectVCharacterView class

Everything the Character screen draws. It is immutable and always complete: values come from the last confirmed data, never from an in-flight request.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Character

public sealed class ProjectVCharacterView

Properties​

PropertyTypeDescription
IsLoadingboolTrue only until the first data arrives.
LoadErrorstring?Why the first load failed, for a retry prompt; null otherwise.
DataProjectVCharacterData?The roster, loadout, skills, inventory and balances; null while loading.
PendingUpgradeProjectVCharacterProgressionPending?A level-up or level reset whose answer was lost, or null. While it is set, IProjectVCharacterScreen.LevelUpAsync finishes it before anything new.

Methods​

UpgradeState(string characterId)​

Requirements, balances and block reason for leveling this character.

public ProjectVCharacterUpgradeState? UpgradeState(string characterId);

Parameters

NameTypeDescription
characterIdstringThe character's ID, as in Id.Value.

Returns

ProjectVCharacterUpgradeState?: The upgrade state, or null while loading. ProjectVCharacterUpgradeState.CanUpgrade says whether Level Up can be offered; ProjectVCharacterUpgradeState.Message says why not.

Exceptions

ExceptionWhen
ArgumentExceptioncharacterId is null, empty or whitespace and data is loaded.

PreviewXp(string characterId, IReadOnlyList<ProjectVCharacterXpItemSelection> items)​

What leveling with these EXP items would do; null while loading.

public ProjectVCharacterXpUpgradePreview? PreviewXp(string characterId, IReadOnlyList<ProjectVCharacterXpItemSelection> items);

Parameters

NameTypeDescription
characterIdstringThe character's ID, as in Id.Value.
itemsIReadOnlyList<ProjectVCharacterXpItemSelection>The EXP items and quantities to spend; may be empty.

Returns

ProjectVCharacterXpUpgradePreview?: The preview, or null while loading. ProjectVCharacterXpUpgradePreview.CanSubmit says whether IProjectVCharacterScreen.LevelUpAsync can be called; it is false while a level-up is pending.

Exceptions

ExceptionWhen
ArgumentNullExceptionitems is null.
ArgumentExceptioncharacterId is null, empty or whitespace, data is loaded and no level-up is pending.