BatchArea beta
Class of @v12-engine/editor
export declare class BatchAreaMany things at once, of any kind: what the map's symmetry does again, copying and pasting, lining up, and moving markers together. Made with the document, how each kind is written, and the areas whose things it puts down
Members
constructor
constructor(
doc: MapDocument, writerOf: (kind: CollectionId) => CollectionWriter, objects: ObjectsArea, markers: MarkersArea, names: NamesArea);Constructs a new instance of the BatchArea class
addDoodadMirrored
addDoodadMirrored(model: string, at: Vec2, options?: Partial<Omit<MapDoodad, 'id' | 'model' | 'x' | 'z'>>): MapDoodad[];Puts a doodad down, and again where the map's symmetry says, as one step
arrange
arrange(ids: SelectionIds, how: Arrangement): void;Puts what stands at one place in a line where they stand on average, or spreads them evenly between the first and the last, along x or z, as one step. Objects that would not fit stay where they are
copied
copied(ids: SelectionIds, origin?: Vec2): {
clip: MapClip;
middle: Vec2;
};What copy makes, with the middle it was taken around: the middle of what is copied, or a place given (a prefab written around where it was put down, a part of what was selected copied around the middle of all of it)
copy
copy(ids: SelectionIds): MapClip;What is selected, as plain data around its middle, to put down again elsewhere (paste)
counterpartsOf
counterpartsOf(ids: SelectionIds): {
kind: CollectionId;
item: {
id: number;
};
index: number;
}[];The things that stand where the map's symmetry puts the ones of these ids again, and are not among them: of the same kind (an object of the same type, a doodad of the same model), within half a cell, each found once. What "move the mirrors too" moves with a drag (RV100), by its kind, as it is now, and the index of the map it is at
countsOf
countsOf(kinds: Iterable<CollectionId>): [MapCollection, number][];How many there are of each kind among some, with the kind: for a step's name
doc
readonly doc: MapDocument;The map document the area works on
duplicate
duplicate(ids: Iterable<number>): MapObject[];Copies of objects, each a little to the side of its original, as one operation: the same in everything but the place and, for what has one, the name. Returns the copies, without those there was no room for
duplicateAll
duplicateAll(ids: SelectionIds): Pasted;Copies of whatever is selected, of every kind, a little to the side of the originals (a cell, or past the widest footprint among them), as one step: the same in everything but the place and the name. Returns the copies by kind
faceAlong
faceAlong(ids: SelectionIds, pathId: number): number;Turns the things of a selection along a path: each the way the path goes at its nearest point, as one step (FC3). Nothing for a path of fewer than two points. How many turned
faceToward
faceToward(ids: SelectionIds, point: Vec2, away?: boolean): number;Turns the things of a selection toward a point of the map (or away from it), each where it stands, as one step (FC3). Camps face no way. How many turned
flipInPlace
flipInPlace(ids: SelectionIds): number;Flips the things of a selection where they stand (EQ17): each put where the map's symmetry would put it again (the first of mirrorMaps: a mirror across x or z, half a turn, a quarter turn; across x on a map with none), facing as it would there, and the whole moved back so that its middle is where it was. What stands at one place (MapCollection.stands), as one step; objects that would not fit stay where they are. How many there were
markersOf
markersOf(ids: SelectionIds): MarkerPoses;How the things of these ids are now, each a copy: what transformMarkers moves from. Objects and camps are left out: they stand in the game's world and are moved there (moveObjects, moveCamp), round its cells
mirrorItems
mirrorItems(kind: CollectionId, ids: Iterable<number>): {
id: number;
index: number;
}[];Copies of things where the map's symmetry puts them again, each as its kind is moved there (mirrorMoving): a light, an effect, a sound, a point, a region, a place of the mist, a path, whatever the collection. Inside the step being made (or one of its own). A copy that would stand where the thing or another copy does (at the middle) is not made. What was made, with the index of the symmetry's map each is at (RV100)
mirrorMaps
mirrorMaps(): ((at: Facing) => Facing)[];What the map's symmetry does to a place and the way it faces, a function for each place it is done again at (one for a mirror, three for the quarter turns): the place itself is not among them, nor are places made one
mirrorMoving
mirrorMoving(index: number): Moving;How a thing is moved to where the map's symmetry puts it again (mirrorMaps, by its index): as a collection's moved takes it, its places, the way it faces and its shape (a rectangle on a quarter turn swaps its sides)
mirrors
mirrors(at: Facing): Facing[];A place, and the places it is mirrored or turned to as the map's symmetry says (symmetry), each facing as it would there: the first is the place itself. Places that come out the same, at the middle, are one
mirrorSelection
mirrorSelection(ids: SelectionIds): number;Copies of the things of a selection at the places the map's symmetry mirrors them to (mirrors), facing as they would there, as one step (FC3): of the kinds that are mirrored (MapCollection.mirrored: objects, whose and what they start as kept, camps, points and doodads), their names not kept. Nothing for a map with no symmetry. How many copies were made
moveBy
moveBy(ids: SelectionIds, by: Vec2, name?: string): boolean;Moves what a selection holds by so far over the ground, every kind, as one operation (EQ5: the arrows): the objects all or none (none where one would not fit, and those the game has no type for stay, as a drag leaves them), the camps, and the rest by their places. False where the objects did not fit
paste
paste(clip: MapClip, at: Vec2, told?: PasteTold, label?: string): Pasted;Puts what was copied down with its middle at a point, as one step: new ids, names of their own where the copied names are taken. What does not fit or is not of this game is left out. Returns what was put down, by kind
placeMirrored
placeMirrored(type: string, owner: PlayerId, at: Vec2, facing?: number, looks?: {
look?: string;
scale?: number;
}): MapObject[];Puts a unit type down, and again where the map's symmetry says, as one step. Returns what fitted
placesOf
placesOf(poses: MarkerPoses): Vec2[];Every place of the things a drag holds: their middles, their points, and every point of the paths
placeWall
placeWall(type: string, owner: PlayerId, from: Vec2, to: Vec2): MapObject[];Lays a wall along a drag (wallLine): a piece of the type on each cell from one end to the other, as one step, leaving out the cells it does not fit on. The world shapes each piece by its neighbours (wallsPack). Returns what fitted
randomise
randomise(ids: SelectionIds, range: {
turn?: number;
size?: number;
}, random?: () => number): number;Gives the things of a selection a turn and a size of their own each, at random within a range, as one step (FC3): turn is how far either way they may turn from where they face (π for any way), size how much bigger or smaller they may be, as a part of their size (0.1: within a tenth). What has a size of its own (MapCollection.sized: objects, doodads) is sized; camps are neither. random is the document's (MapDocument.rng) when left out. How many changed
removeSelected
removeSelected(ids: SelectionIds): void;Takes away what a selection holds, of every kind, as one operation named by how many of each
snapToGround
snapToGround(ids: SelectionIds): number;Puts the things of a selection that were lifted off the ground back on it: doodads with a height of their own (MapDoodad.y), as one step (FC3). How many came down
spreadAlong
spreadAlong(ids: SelectionIds, shape: SpreadShape): number;Spreads the things of a selection evenly along the line from the two farthest apart, or round a circle through where they stand on average (each keeps its order round the middle), as one step (FC3). Objects that would not fit stay where they are. Nothing for fewer than three
transformMarkers
transformMarkers(from: MarkerPoses, pivot: Vec2, change: Around, name?: string): void;Moves, turns or resizes the things a drag holds around a point, all as one operation: where each of their places goes, they keep to each other as they were. from is how they were when the drag began, so that it can be asked again and again as the drag goes. A point turns with them; a rectangle stays along the map, and a quarter turn swaps its width and its depth