Skip to content

@v12-engine/client/campaign-worker ​

Interfaces ​

NameWhat
CampaignWorkerArgs betaWhat the campaign's scene sends its worker of the mission to play (WorkerGame.args): plain data
MissionWin betaA mission won, as its world says it: what the campaign keeps of it (missionWon) and its debrief shows. Plain data: what a worker tells the page (WorkerSession.onTold)

Functions ​

NameWhat
serveCampaign betaWhat a campaign's worker file does (StartAppOptions.worker): plays the mission the campaign's scene asks for (its id, the progress, the difficulty: CampaignWorkerArgs) with the game's rules, runs the mission's code on its world there (its onStart, a cinematic briefing, its carry as it is won), and tells the page the mission won as plain data (MissionWin), which the page keeps. The missions are the campaign's code, by id: the list given to defineCampaign (missions), imported from a module with nothing of the page in it // sim.worker.ts, with serveCampaign of @v12-engine/client/campaign-worker serveCampaign(game.toRules(), missions: MISSION_CODE ) A worker served this way plays the campaign's missions only: the app's other games (free play, the editor's Play here) are played in the page

Types ​

NameWhat
CampaignMissionCode betaA mission's code, as a campaign's worker has it (serveCampaign): by its id, what runs on its world. A MissionDef or a campaign's MissionCode is one
ServeCampaignOptions betaWhat the worker's file of a campaign is given besides its missions: where it hears, a new version of the game for the dev server's hot reload, what the page is told as a mission starts (ServeWorldOptions)