LiteCellLayers beta
Class of @v12-engine/client/lite-views
export declare class LiteCellLayersThe game's layers of cells on this renderer, the client's CellLayerViews with its rules: each layer's parts made, told of what changed and of every frame, and disposed (what fills LiteWorldView's LayersSlot)
Members
constructor
constructor(renderer: Renderer,
terrain: Terrain, looks: Record<string, LiteLayerFactories> | undefined, means?: LiteLayerMeans);Constructs a new instance of the LiteCellLayers class
covered
get covered(): Uint8Array;How many buildings stand over each cell, a byte a cell, row by row (standing)
dispose
dispose(): void;Removes every layer's parts
disturb
disturb(layer: string, at: Vec2, strength?: number): void;Shakes what a layer draws at a place, as one moving through it would (strength 1)
drawn
get drawn(): number;How many things the parts draw, all together
empty
get empty(): boolean;Whether any layer is drawn at all: nothing to tell each frame where none is
frame
frame(dt: number, focus: Vec2, walkers: () => readonly CellWalker[], wind: WindNow): void;Every frame: the parts hear of it, and of who walks about when they ask (walkers, worked out once at most)
lay
lay(layer: string, changed?: readonly number[], over?: number, seen?: boolean): void;A layer's cells changed: these, or all of them. Those of a state layer (foliageStateLayer) are told to the parts of the layer it is the state of (layState), with the seconds the rules said they ease in over (over), and whether they came into sight as they are (seen)
layAll
layAll(): void;Every layer laid again: the ground under them changed
layArea
layArea(area: {
x: number;
z: number;
width: number;
depth: number;
} | 'all'): void;What changed of the ground, in cells, laid again over it alone; the whole of every layer for all
layCells
layCells(cells: readonly number[]): void;Cells of every layer laid again, by index: what is kept off them came or went (a building, a doodad that blocks)
looks
looks(layer: string): readonly LiteLayerFactory[];What a layer's parts are made from, as it was last given (set)
of
of(layer: string): readonly CellLayerView[];The parts a layer is drawn with now
set
set(layer: string, look: LiteLayerFactories | null | undefined): void;A layer's look, in place of the one it had: none takes it away (the client's CellLayerViews.set). Where the parts it has can each take the look of the new one in its place (grass for grass: FoliageView.relook) they do, laying again only what changed; else they are made anew, and laid. A part of grass made by a foliage factory of the client's (a game's code, its file laid over it, a map's bushes) is drawn by FoliageView with that look; another of the client's (made for Babylon's scene) is not drawn, said once. Those who watch are told
setDetail
setDetail(amount: number): void;How much detail the graphics settings ask for, 0 to 1, for every part
standing
standing(added: readonly CellStanding[], removed: readonly CellStanding[]): void;What stands on the ground came and went (the entities a snapshot added and removed): the cells under each building are covered as it comes and uncovered as it goes, and the layers laid again there alone. Nothing for the rest
terrain
readonly terrain: Terrain;The ground the layers are drawn on
watch
watch(listener: (layer: string) => void): () => void;Told of each layer whose look was set (set): its parts made anew, or taking the new look in place. Gives back what stops it