Skip to content

CellSelection beta ​

Class of @v12-engine/editor

ts
export declare class CellSelection

Cells of a layer picked to be changed together (the Patch tool): by index (z * width + x), never saved and no part of the map. A byte a cell of the map, so a selection of the whole map is as quick to add to as one of a few

Members ​

bounds ​

ts
bounds: {
        x: number;
        z: number;
        width: number;
        depth: number;
    } | undefined;

The rectangle the cells are in, in cells: none while nothing is picked

cells ​

ts
cells(): number[];

The cells picked, in order

clear ​

ts
clear(): void;

Lets go of every cell

each ​

ts
each(visit: (cell: number) => void): void;

Goes through the cells picked, in order, within their rectangle alone

has ​

ts
has(cell: number): boolean;

Whether a cell is picked

layer ​

ts
layer: string | undefined;

The layer the cells were picked on: none while nothing is

select ​

ts
select(layer: string, width: number, depth: number, cells: Iterable<number>, how?: SelectHow): void;

Picks cells of a layer of a map of a size: in the place of those picked (replace), with them (add) or out of them (subtract). Cells of another layer, or of a map of another size, are let go of first

size ​

ts
size: number;

How many cells are picked

version ​

ts
version: number;

Moves with every change, for what is drawn of it