Rules read the live map but each rule collects all of its matches before writing
any of them: a later rule sees - and can override - what an earlier one wrote,
while a rule never trips over its own writes. Patterns must fit entirely; origins
where they would hang past the map edge are skipped. Returns how many times rules
matched (origins times rules), for tests and debug overlays.
Applies automapping rules to a
TileMap, in order.Rules read the live map but each rule collects all of its matches before writing any of them: a later rule sees - and can override - what an earlier one wrote, while a rule never trips over its own writes. Patterns must fit entirely; origins where they would hang past the map edge are skipped. Returns how many times rules matched (origins times rules), for tests and debug overlays.