Split The code is public; the app answers only to the crew.
One map, held as a value: map.ts stops being a singleton so a second layout is possible #82
Check · Review · Land · Live done — Landed and live in production.
map.ts no longer builds a singleton grid at import time: buildMap(layout) turns a layout's areas and crates into a MapDef value (name, grid size, cells, boxes, spawns, sites), and DEFORGE is that value for today's tables, built in the same order as before so the grid, boxes, spawns and sites are bit-identical to what t…
shipped merged
Sign in to join this conversation.
new above
offline
map.tsno longer builds a singleton grid at import time:buildMap(layout)turns a layout's areas and crates into aMapDefvalue (name, grid size, cells, boxes, spawns, sites), andDE_FORGEis that value for today's tables, built in the same order as before so the grid, boxes, spawns and sites are bit-identical to what the module used to export. Every function that reads a grid —cellAt,walkable,worldOf,colOf,rowOf,findPath,siteAt— now takes the map instead of closing over module state.createWorldtakes aMapDefdefaulting toDE_FORGE;world.mapis wherebots.ts,hud.ts,radar.tsandobserve.tsread it from (only the read site changed inobserve.ts, not any normalisation, so the shipped weights still mean what they meant).arena.tsstill builds onDE_FORGE. The renderer's level mesh and the radar's baked image are now keyed by the map they were built from, so a future second layout can never show through as the first one's walls.Added
buildMaptests against a small hand-written layout, and a test that two maps built from two layouts share no state.bun testis green (334 pass). Not in this pull: a second layout, a picker, or any change to de_forge's own numbers.Closes #73