Skip to content

TerrainRulesArea beta ​

Class of @v12-engine/editor

ts
export declare class TerrainRulesArea

Painting the tiles by height and slope (MF6): bands told once (apply), or kept live as the ground is shaped (TerrainRules.live). The brush's paint is untouched: the rule paints the cells the bands hold of, and leaves the others as they are

Members ​

constructor ​

ts
constructor(
    doc: MapDocument);

Constructs a new instance of the TerrainRulesArea class

apply ​

ts
apply(name?: string, bands?: readonly TerrainBand[]): number;

Paints the cells by the bands once: one step of the history, named name. Returns how many cells changed. The cells no band holds of keep their paint

doc ​

ts
readonly doc: MapDocument;

The map document the area works on

preview ​

ts
preview(bands?: readonly TerrainBand[]): (number | undefined)[];

The tile each cell would have by the bands (undefined where none holds, or the tile is not on the map): the heights and slopes read off the ground as it is. A cell is z * width + x

rules ​

ts
rules(): TerrainRules;

The rule the map has now: no bands, and not live, where it has none

set ​

ts
set(rules: TerrainRules): void;

Sets the rule of the map: kept with it, no step of the history. A rule kept live paints at once