Skip to content

GroundChanges beta ​

Interface of @v12-engine/engine

ts
export interface GroundChanges

The ground as a map the game has, and the cells of it that changed: in a save and in a welcome

Members ​

bounds ​

ts
bounds?: {
        x: number;
        z: number;
        width: number;
        depth: number;
    };

The part of the map play happens in, as it is now

cells ​

ts
cells?: Record<string, {
        count: number;
        at: string;
        to: string;
    }>;

The same for the game's layers of cells (Terrain.cells), by id

changes ​

ts
changes: Partial<Record<GroundLayer, {
        count: number;
        at: string;
        to: string;
    }>>;

For each layer that changed: which cells (packed as 32-bit numbers), and what each holds now

depth ​

ts
depth: number;

The ground's depth in cells

hash ​

ts
hash: string;

A hash of the ground the map makes, which tells the ground of a save or a welcome is the one it was taken from

map ​

ts
map: string;

The map it started as, by its name (GameMap.name) and a hash of the ground it makes (groundHash)

width ​

ts
width: number;

The ground's width in cells