Skip to content

NamesArea beta ​

Class of @v12-engine/editor

ts
export declare class NamesArea

What things are called, one name each across the map, and the game's own fields on them

Members ​

constructor ​

ts
constructor(
    doc: MapDocument, writerOf: (kind: CollectionId) => CollectionWriter);

Constructs a new instance of the NamesArea class

all ​

ts
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 ​

ts
readonly doc: MapDocument;

The map document the area works on

fields ​

ts
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 ​

ts
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 ​

ts
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 ​

ts
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 ​

ts
whyNotName(target: Named, name: string): string | null;

Why something cannot be given a name, or null when it can