跳转到内容

Bakes

此内容尚不支持你的语言。

Defined in: sdk/src/runtime/bakes.ts:51

The jobs an App is running. Read Bakes.active for what to show.

new Bakes(): Bakes

Bakes

budgetMs: number = 8

Defined in: sdk/src/runtime/bakes.ts:53

How long, in milliseconds, all the work spread over frames may take of one frame between it.


priorityExtraMs: number = 12

Defined in: sdk/src/runtime/bakes.ts:55

How much more a frame gives while work that would be seen missing is still to do (see urge).

get active(): BakeProgress[]

Defined in: sdk/src/runtime/bakes.ts:101

Every piece of work in hand now. Empty when the engine is idle.

BakeProgress[]


get frameBudgetMs(): number

Defined in: sdk/src/runtime/bakes.ts:159

What this frame may spend: the steady budget, and the extra while something urgent is outstanding.

number


get urgent(): boolean

Defined in: sdk/src/runtime/bakes.ts:154

Whether something the player would see missing is still being made: what a loading screen waits for.

boolean

clear(owner): void

Defined in: sdk/src/runtime/bakes.ts:95

object

void


hasTime(owner?): boolean

Defined in: sdk/src/runtime/bakes.ts:115

Whether owner’s work stepped elsewhere may go on this frame. Such work does what it must at once (what stands right by the player) whatever this says, and stops when it says no; saying no is remembered, so the jobs leave it more of the next frame.

The first time an owner asks in a frame it is given its part: what the frame has left, divided among it and those that asked the frame before and have not had their turn yet. An owner that asks alone has all of it.

object = SHARED

boolean


mark(owner, label, progress): void

Defined in: sdk/src/runtime/bakes.ts:90

Shows work that is stepped elsewhere (pages made a few a frame) under label while progress is below 1; owner names it, so a later mark replaces it. Mark it 1, or clear it, when it is done.

object

string

number

void


run<T>(label, job): object

Defined in: sdk/src/runtime/bakes.ts:77

Runs job over the frames to come, under label; the promise is what it returns. A job that is cancelled (see cancel) never settles.

T

string

WorkJob<T>

object

cancel: () => void

void

done: Promise<T>


step(now?): void

Defined in: sdk/src/runtime/bakes.ts:164

Starts the frame’s budget and steps the jobs for their part of it, oldest first; a job that finishes or throws settles its promise.

() => number

void


urge(owner, urgent): void

Defined in: sdk/src/runtime/bakes.ts:148

Says whether what owner still has to do would be seen missing by the player: the chunk they stand in, the ground under them. While any owner says so the frame’s budget is larger by priorityExtraMs. Say false when it is done, or it is held for good.

object

boolean

void