CampaignController beta
Interface of @v12-engine/client
export interface CampaignControllerA campaign between its missions: how far it is, which mission is next, and what there is to do. What a campaign's menu shows (CampaignDef.menu)
Members
chapters
readonly chapters: readonly CampaignChapter[];Its missions in chapters, in order (CampaignDef.chapters): those no chapter names in one of their own at the end, named as the campaign; one chapter of them all for a campaign that has none
complete
complete(): boolean;Whether every mission is won
difficulties
readonly difficulties: readonly string[];The difficulties it offers, by name (CampaignDef.difficulties)
difficulty
difficulty(): string;The difficulty its missions' computers play on: the one chosen (kept in the progress), else normal where offered, else the first
id
readonly id: string;The campaign's id
leave
leave(): void;Out of the campaign
missions
readonly missions: readonly CampaignMissionInfo[];The campaign's missions, in order
name
readonly name: string;The campaign's name on the menu
next
next(): CampaignMissionInfo;The mission to go on with: the one it is at, the last one once every one is won
play
play(mission: string): void;Plays a mission
progress
readonly progress: Accessor<CampaignProgress>;How far it is: the mission it is at, the ones won with their times, the heroes carried
reached
reached(mission: string): boolean;Whether a mission can be played: as its unlock says; else the first, one won, the one the campaign is at (where the last won led: MissionDef.next), and one after a mission won that says nothing of what comes after it
saves
readonly saves: SavesController;The games of the campaign saved in this browser: listed, loaded, deleted
setDifficulty
setDifficulty(difficulty: string): void;Chooses the difficulty, kept at once with the progress: the missions played from now on have it
startOver
startOver(): void;Starts the campaign over: what was won and carried is forgotten
total
total(): number;The seconds the missions won took, together
won
won(mission: string): CampaignProgress['done'][string] | undefined;What a mission was won with, when it was: its time, and the best