Skip to content

AssetIndexSource beta ​

Interface of @v12-engine/editor

ts
export interface AssetIndexSource

What the index reads of the editor, so that it can be made with no screen (a test, a script) *

Members ​

cinematics ​

ts
cinematics?: () => ReadonlyMap<string, CinematicDef>;

The game's cinematics by name

folder ​

ts
folder: string | undefined;

The game's folder (GameView.files.assets): games/td; nothing for a game with none

icons ​

ts
icons?: () => NonNullable<GameView['hud']>['icons'];

The game's HUD icons by name, when the view has any

list ​

ts
list?: () => Promise<{
        own: ProjectAsset[];
        shared: ProjectAsset[];
    }>;

What lists the files, where the index is not given them: the dev server while developing

looks ​

ts
looks: () => Readonly<Record<string, LooksEntry | undefined>>;

The game's looks as they are, by unit type: models, sounds, clips

map ​

ts
map: () => GameMap;

The game's map, read afresh on each call

pack ​

ts
pack: () => Iterable<string>;

The files the map brings (MapPack), by path

prefabs ​

ts
prefabs?: () => ReadonlyMap<string, PrefabFile>;

The game's prefab files by name

project ​

ts
project?: Pick<Project, 'has' | 'listAssets' | 'saveAssetTags' | 'assetUses'>;

The project the files are listed, tagged and found used in, where there is one: the editor's (editor.project)

registry ​

ts
registry?: Registry;

The registry of the engine's assets package, to list its files; none lists no package files

tiles ​

ts
tiles?: () => NonNullable<GameView['ground']>['tiles'] | undefined;

The ground's tiles by name, when the view has any

uses ​

ts
uses?: (asset: Asset) => AssetUse[];

The game's own: what else uses a file (a wave's icon, a mission's picture)

writeTags ​

ts
writeTags?: (tags: Record<string, string[]>) => Promise<void>;

What writes the tags: the dev server while developing