MapCollections beta
Class of @v12-engine/editor
export declare class MapCollectionsThe kinds of thing on a map, as one registry (editor.collections): the editor's own and then the game's, as the editor is told them (MapEditor.kinds). What touches everything on the map goes over all(); what is handed a target goes to its collection (of) or straight to the thing (item, placeOf)
Members
constructor
constructor(registry: Registry,
kinds: () => readonly MapKind[]);Constructs a new instance of the MapCollections class
all
all(): MapCollection[];Every collection: the editor's own kinds, then the game's in the order the editor was told them
find
find<T extends {
id: number;
}>(map: GameMap, collection: MapCollection<T>, id: number): T | undefined;A thing of a collection by its id, as the map has it now
get
get(id: CollectionId): MapCollection;The collection by id. A kind of the game's own the editor was not told of is one too: its things are in the map all the same, and are called by the kind's id
item
item(map: GameMap, target: Named): {
id: number;
} | undefined;The thing a target names, as the map has it now
of
of(target: Named): MapCollection;The collection of what a target names
placeOf
placeOf(map: GameMap, target: Named): Vec2 | undefined;Where the thing a target names stands