GroundWorks beta
Class of @v12-engine/client
export declare class GroundWorksWhere an app's ground textures made in code are made and kept (ClientRuntime.ground): in its worker where it has one (the client's patterns; serveGroundTextures in its file), here otherwise, and kept for the app's life, the oldest let go past about 48 MB. Given what makes the worker (() => new Worker(…)), the worker is made when the first texture is asked of it: a page's menu fetches none of it (OF2)
Members
constructor
constructor(worker?: GroundWorkerLike | (() => GroundWorkerLike) | null);Constructs a new instance of the GroundWorks class
bytes
get bytes(): number;How many bytes the textures kept take
clear
clear(): void;Lets every texture kept go, and every file
count
get count(): number;How many textures are kept: for the stats and the tests
dispose
dispose(): void;Lets go of the textures and the worker: what it was asked and did not answer is made here, as without one, and not kept
pixels
pixels(pattern: string | PatternDef | PatternMaker, color: Readonly<Rgb>, seed: number, size?: number, recipe?: GroundRecipe, patterns?: Readonly<Record<string, PatternDef>>): Promise<Uint8Array>;A ground's texture made in code: kept, made in the worker (the client's patterns, where there is one) or made here. Not to be changed: it is kept for whoever asks next
pixelsNow
pixelsNow(pattern: string | PatternDef | PatternMaker, color: Readonly<Rgb>, seed: number, size?: number, recipe?: GroundRecipe, patterns?: Readonly<Record<string, PatternDef>>): Uint8Array | undefined;A ground's texture made in code, as it is kept or made at once: the pixels, or nothing where it is being made in the worker (then pixels says when it is). Without a worker it is always made at once. Not to be changed: it is kept for whoever asks next