Constimport { automap, AUTOMAP_EMPTY, type AutomapTarget, type AutomapRule } from '@datamoc/mw_games/rpg';
declare const map: AutomapTarget; // a real two-d/render.TileMap satisfies this structurally
const cornerRule: AutomapRule = {
width: 2, height: 2,
input: { ground: [1, AUTOMAP_EMPTY, AUTOMAP_EMPTY, AUTOMAP_EMPTY] },
outputs: [{ ground: [2, AUTOMAP_EMPTY, AUTOMAP_EMPTY, AUTOMAP_EMPTY] }],
};
const changed = automap(map, [cornerRule]); // how many cells the rules actually wrote
The wildcard: an
inputcell holding it constrains nothing, anoutputcell holding it leaves the target alone.Deliberately the same value as
two-d/render's ownEMPTY, declared here rather than imported so this module needs no renderer.tests/automap.test.tsasserts the two stay equal, the same way the version test pinsversion.tstopackage.json.