import { matchTerrainRule } from '@datamoc/mw_games/two-d/render';
const rule = { id: 'coast', conditions: [{ dx: 1, dy: 0, hasAll: ['water'] }], images: [] };
const flagsAt = (x: number, y: number) => (x === 1 && y === 0 ? new Set(['water']) : new Set(['land']));
console.log(matchTerrainRule(rule, 0, 0, flagsAt)); // true
Whether
rule, rotated byrotationIndexofrotationssteps, matches the cell atx, y.