NamesArea beta
Class of @v12-engine/editor
export declare class NamesAreaWhat things are called, one name each across the map, and the game's own fields on them
Members
constructor
constructor(
doc: MapDocument, writerOf: (kind: CollectionId) => CollectionWriter);Constructs a new instance of the NamesArea class
all
all(): Map<string, Named>;What has each name on the map, of every kind (collections). No two things have the same, whatever they are
doc
readonly doc: MapDocument;The map document the area works on
fields
fields(target: Named): readonly MapFieldDef[];The game's own fields for a thing on the map (see defineMapField): a placed object's by its type, a camp's, a region's (MapCollection.fields). Points and paths have none of the game's: the rules read them whole, world.map.path('road')
freeName
freeName(like: string): string;A name like this one that nothing has: the name itself, or gate-2, gate-3 and so on. For copies
setField
setField(targets: SelectionIds, id: string, value: unknown): string | null;Sets a field of the game's own on what is said, of the kinds that have fields (MapCollection.fields): on those it is a field of. undefined puts it back to its default, which is not kept. Returns why it cannot be that, or null when it is set
setName
setName(target: Named, name: string | undefined): string | null;Names something on the map, for the rules to find it by (world.named('gate')), or takes its name away with none. Returns why it cannot have that name, or null when it has it now
whyNotName
whyNotName(target: Named, name: string): string | null;Why something cannot be given a name, or null when it can