Skip to content

Operation beta ​

Interface of @v12-engine/editor

ts
export interface Operation

One step of the history: what changed, and how to take it back. It holds only what changed (the part of a layer under the brush, the things that moved, the one value set), never the whole map, so a long history costs little

Members ​

area ​

ts
area?: MapRect;

The ground it changed, for whoever draws it. Left out when it changed none

items ​

ts
items: {
        [kind in PatchKind]?: Patch<{
            id: number;
        }>[];
    };

The things that changed, by the list they are in (PatchKind): a list with none changed is left out (see patchesOf)

layers ​

ts
layers: LayerChange[];

The parts of the map's layers that changed, with how they were and how they became

name ​

ts
name: string;

What was done, as the undo list says it: "Move 3 objects"

steps ​

ts
steps?: OwnStep[];

The steps of the game's own in it (OwnStep), where there are any: run as it is undone and redone

values ​

ts
values: ValueChange[];

The values of the map that changed, each whole (ValueKey)

whole ​

ts
whole?: {
        before: GameMap;
        after: GameMap;
    };

The whole map as it was and as it became, for what changes all of it at once: a resize, after which no layer is the size it was. Without its data, which is kept key by key in values (only the keys that changed), and without what the editor keeps of its own (GameMap.editor), which a resize leaves as it is. The layers and the things are empty then