Skip to main content

ProjectVCampaignMission class

One Campaign mission with the player's progress on it: entry cost, lock state, stars and drops. Read-only; a change arrives as a new instance.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Campaign

public sealed class ProjectVCampaignMission

Constructors​

ProjectVCampaignMission(ProjectVCampaignMissionId missionId, ProjectVGameplayKey gameplayKey, long durationSeconds, long entryStamina, bool isCompleted, bool isActive, ProjectVCampaignMissionStars? stars, IReadOnlyList<string>? requiredMissionIds, bool isLocked, IReadOnlyList<ProjectVCampaignReward>? dropPreview, bool isClosed)​

Creates a mission, for example as test data.

public ProjectVCampaignMission(ProjectVCampaignMissionId missionId, ProjectVGameplayKey gameplayKey, long durationSeconds, long entryStamina, bool isCompleted, bool isActive, ProjectVCampaignMissionStars? stars = null, IReadOnlyList<string>? requiredMissionIds = null, bool isLocked = false, IReadOnlyList<ProjectVCampaignReward>? dropPreview = null, bool isClosed = false);

Parameters

NameTypeDescription
missionIdProjectVCampaignMissionIdThe mission's ID.
gameplayKeyProjectVGameplayKeyWhich gameplay content the mission plays.
durationSecondslongThe run time limit in seconds; greater than 0.
entryStaminalongThe stamina a run costs; greater than 0.
isCompletedboolTrue when the player has completed the mission.
isActiveboolTrue when the player has an open run of the mission.
starsProjectVCampaignMissionStars?The mission's star objectives and progress; null means ProjectVCampaignMissionStars.None.
requiredMissionIdsIReadOnlyList<string>?The missions to complete first; null means none.
isLockedboolTrue when the mission cannot be started yet.
dropPreviewIReadOnlyList<ProjectVCampaignReward>?The most of each resource a run can drop; null means none.
isClosedboolTrue when the mission is closed for everyone; it also makes the mission locked.

Exceptions

ExceptionWhen
ArgumentOutOfRangeExceptiondurationSeconds or entryStamina is 0 or less.

Properties​

PropertyTypeDescription
MissionIdProjectVCampaignMissionIdThe mission's ID. Pass MissionId.Value to IProjectVCampaignScreen.BeginMissionAsync.
GameplayKeyProjectVGameplayKeyWhich gameplay content the mission plays; map it to a scene with your own table.
DurationSecondslongThe run time limit in seconds.
EntryStaminalongThe stamina a run costs. It is checked when the run starts and charged when it ends.
IsCompletedboolTrue when the player has completed the mission at least once.
IsActiveboolTrue when the player has an open run of this mission.
StarsProjectVCampaignMissionStarsThe mission's star objectives and the player's best run; ProjectVCampaignMissionStars.None when the mission has no stars.
RequiredMissionIdsIReadOnlyList<string>The IDs of the missions the player must complete before this one can start.
IsLockedboolTrue while the mission is closed, a required mission is not completed, or the player has too few Campaign stars. Starting it fails with MISSION_RUN_LOCKED or MISSION_RUN_LOCKED_STARS.
IsClosedboolTrue when the server keeps the mission closed for everyone; show it as not open yet.
DropPreviewIReadOnlyList<ProjectVCampaignReward>For display only: the most of each resource a run can drop (ProjectVCampaignReward.Amount is that maximum).