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
| Name | Type | Description |
|---|---|---|
missionId | ProjectVCampaignMissionId | The mission's ID. |
gameplayKey | ProjectVGameplayKey | Which gameplay content the mission plays. |
durationSeconds | long | The run time limit in seconds; greater than 0. |
entryStamina | long | The stamina a run costs; greater than 0. |
isCompleted | bool | True when the player has completed the mission. |
isActive | bool | True when the player has an open run of the mission. |
stars | ProjectVCampaignMissionStars? | The mission's star objectives and progress; null means ProjectVCampaignMissionStars.None. |
requiredMissionIds | IReadOnlyList<string>? | The missions to complete first; null means none. |
isLocked | bool | True when the mission cannot be started yet. |
dropPreview | IReadOnlyList<ProjectVCampaignReward>? | The most of each resource a run can drop; null means none. |
isClosed | bool | True when the mission is closed for everyone; it also makes the mission locked. |
Exceptions
| Exception | When |
|---|---|
ArgumentOutOfRangeException | durationSeconds or entryStamina is 0 or less. |
Properties​
| Property | Type | Description |
|---|---|---|
MissionId | ProjectVCampaignMissionId | The mission's ID. Pass MissionId.Value to IProjectVCampaignScreen.BeginMissionAsync. |
GameplayKey | ProjectVGameplayKey | Which gameplay content the mission plays; map it to a scene with your own table. |
DurationSeconds | long | The run time limit in seconds. |
EntryStamina | long | The stamina a run costs. It is checked when the run starts and charged when it ends. |
IsCompleted | bool | True when the player has completed the mission at least once. |
IsActive | bool | True when the player has an open run of this mission. |
Stars | ProjectVCampaignMissionStars | The mission's star objectives and the player's best run; ProjectVCampaignMissionStars.None when the mission has no stars. |
RequiredMissionIds | IReadOnlyList<string> | The IDs of the missions the player must complete before this one can start. |
IsLocked | bool | True 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. |
IsClosed | bool | True when the server keeps the mission closed for everyone; show it as not open yet. |
DropPreview | IReadOnlyList<ProjectVCampaignReward> | For display only: the most of each resource a run can drop (ProjectVCampaignReward.Amount is that maximum). |