arx-level-generator
Version:
A tool for creating Arx Fatalis maps
81 lines (80 loc) • 2.62 kB
TypeScript
import { Box3 } from 'three';
import { Entities } from './Entities.js';
import { Fogs } from './Fogs.js';
import { Lights } from './Lights.js';
import { Paths } from './Paths.js';
import { Polygons } from './Polygons.js';
import { Texture } from './Texture.js';
import { Vector3 } from './Vector3.js';
import { Zones } from './Zones.js';
export declare abstract class Selection<T extends Array<any>> {
protected selection: number[];
protected items: T;
constructor(items: T);
get(): T;
clearSelection(): this;
hasSelection(): boolean;
sizeOfSelection(): number;
selectAll(): this;
/**
* selects items based on a given predicate
* if there are already items selected then this filters those further
*/
selectBy(predicate: (item: T[0], idx: number) => boolean): this;
invertSelection(): this;
/**
* Removes items which have been selected
*
* @returns a copy of the elements that have been deleted
*/
delete(): T;
apply(fn: (item: T[0], idx: number) => void): this;
move(offset: Vector3): this;
abstract copy(): this;
}
export declare class PolygonSelection extends Selection<Polygons> {
copy(): this;
/**
* selects polygons which go outside the 0-160 meters boundary on the horizontal axis
*/
selectOutOfBounds(): this;
selectWithinBox(box: Box3): this;
selectByTextures(textures: (Texture | string)[]): this;
makeDoubleSided(): this;
moveToRoom1(): this;
scale(scale: number): this;
flipUVHorizontally(): this;
flipUVVertically(): this;
}
export declare class LightsSelection extends Selection<Lights> {
copy(): this;
}
export declare class EntitiesSelection extends Selection<Entities> {
copy(): this;
}
export declare class FogsSelection extends Selection<Fogs> {
copy(): this;
}
export declare class PathsSelection extends Selection<Paths> {
copy(): this;
}
export declare class ZonesSelection extends Selection<Zones> {
copy(): this;
}
type OverloadsOf$ = {
<U extends Array<any>, T extends Selection<U>>(items: T): T;
(items: Polygons): PolygonSelection;
(items: Entities): EntitiesSelection;
(items: Lights): LightsSelection;
(items: Fogs): FogsSelection;
(items: Paths): PathsSelection;
(items: Zones): ZonesSelection;
};
/**
* Calling methods on the selected items will mutate the original values
* unless you create a copy of them with the `.copy()` method
* the copied (or original if no copy has been called) values can
* be read with the `.get()` method.
*/
export declare const $: OverloadsOf$;
export {};