/** * materialize.ts — turn a semantic template into a real RPG Maker MV tile array. * * This is the compiler pass that makes layouts portable: the template says * "wall here, ground there, a prop anchored at 4,7" and the profile says which * tile ID plays each of those roles in the target tileset. The same layout can * then be a stone dungeon or a sci-fi corridor. * * Order matters. Every autotile is written at shape 0 first and the shapes are * recomputed at the end by applyAutotileShapes, because a shape is a function of * the finished neighbourhood — deciding it cell by cell while painting produces * seams and stray corners. */ import { type SemanticTemplate, type TilesetProfile } from '../knowledge/semantic.js'; export interface MaterializeOptions { /** * Paint the template's props. They are concrete B-E tile IDs, so they only * make sense when the target tileset shares those sheets; by default they are * kept for the tileset they were mined from and dropped for any other. */ keepProps?: boolean; /** Tileset the result declares. Defaults to the profile's. */ tilesetId?: number; } export interface MaterializedMap { width: number; height: number; tilesetId: number; /** width * height * 6, the layout of MV's Map.data. */ data: number[]; /** Props that could not be painted because the tileset does not match. */ droppedProps: number; markers: { x: number; y: number; role: string; note?: string; }[]; } export declare function materializeTemplate(template: SemanticTemplate, profile: TilesetProfile, opts?: MaterializeOptions): MaterializedMap;