feat(api): palette floor paint, region query, and walkability (#7) - #361
Open
Aduersarius wants to merge 1 commit into
Open
feat(api): palette floor paint, region query, and walkability (#7)#361Aduersarius wants to merge 1 commit into
Aduersarius wants to merge 1 commit into
Conversation
…ndefi#7) Etapa 1 floor API on top of worldBuilder.paintTiles drafts: paint by palette entry (tile / rectangle / selection), blocked-only updates that preserve graphics, effective region snapshots, and isolation BFS warning. Pure unit tests cover geometry, palette expansion, and walkability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #7 — Etapa 1 floor API so an uploaded/palette tile can be painted onto the map floor through the persistence layer.
What landed
PUT .../floor/paint,.../paint-rectangle,.../paint-selectionexpand apaletteIdinto all layers + layer-1blocked(same contract as the in-game editor), then write via existing atomicpaintTilesdrafts.PUT .../floor/blockedthat preserves existing draft/publishedgrhIndex(does not null out graphics).GET .../floor/region— baseterrain.jsonpalette id/graphics/blocked merged with draft-preferred overrides (not just override rows).GET .../floor/walkability(+ warning attached to paint/blocked responses) so sealing off walkable islands is detectable after collision edits.npx tsx --test src/tests/floorPaint.unit.test.ts) for geometry caps, 20×20 plans, palette expansion, and isolation.Acceptance mapping
paintTilesBEGIN/COMMIT/ROLLBACK)terrain.jsonDifferentiation vs competing PRs
grhIndex; includes walkability; selection API; pure unit tests.worldBuilder.paintTiles+ Postgres drafts (not an in-memory stub service); no kitchen-sink frontend/protocol files.Test plan
cd api && npx tsx --test src/tests/floorPaint.unit.test.ts(6/6)isolated: true