Skip to content

MapFiles beta ​

Interface of @v12-engine/editor/vite

ts
export interface MapFiles

What the engine says a map file is: how to read one, and how to write it and its names. Handed in, not imported: the config of the dev server loads this file, and the engine is loaded by the dev server once it runs

Members ​

DATA_KINDS ​

ts
DATA_KINDS: readonly string[];

The kinds of definition the engine keeps data of (DATA_KINDS): what the game's data is written of, and nothing else

gameIdsSource ​

ts
gameIdsSource?(game: string, sources: GameIdSources): string;

What the engine writes of a game's ids from its files (gameIdsSource): without it, <game>.ids.ts is not written

looksText ​

ts
looksText?(file: Record<string, unknown>): string;

Writes a looks file as the text of looks.json

mapNamesSource ​

ts
mapNamesSource(stem: string, map: GameMap): string;

The source of the generated names file for the map file stem, made from the map's objects

mapText ​

ts
mapText(map: GameMap): string;

Writes a map as the text of its file

parseMap ​

ts
parseMap(data: unknown): GameMap;

Reads a map from the parsed JSON of a map file; throws when the data is not a map

readLooksEntry ​

ts
readLooksEntry?(data: unknown, what?: string): unknown;

Checks and reads one entry of a looks.json from its parsed data; what names it in the error

readLooksFile ​

ts
readLooksFile?(data: unknown): Record<string, unknown>;

What the client says a looks.json is (packages/client/src/client/looksFile.ts): without them, the looks are not answered

readScenario ​

ts
readScenario?(data: unknown): {
        name: string;
        game: string;
    };

What the engine says a scenario file is (readScenario): without it, scenarios are not written