Snapshot a cell before mutation (no-op if already touched or out of bounds). Called automatically by every setter; call it directly only when mutating the map through APIs the transaction doesn't wrap.
Paired road-edge write — see HexMap.setRoadEdge. Touches both cells.
Records before-state for every cell it mutates, so the whole batch can be undone/redone as one unit. Create with
map.beginEdit()(long-lived, e.g. a paint stroke spanning many pointer events) ormap.edit(tx => …)(one-shot).Mutations apply to the map immediately — there is no deferred apply — and the first write to each cell snapshots all of that cell's channels first. Call commit exactly once when the interaction ends.