Building footprints need an entrance #62
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "55-footprint-entrance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a mandatory entrance to
BuildingFootprint, authored as an ASCII arrow in the shape string.The grammar
On top of
X/./@, a shape now carries exactly one of< > ^ v(case-insensitive, soVworks). The arrow's own tile is the doorstep — the unoccupied tile a pawn stands on — and the direction it faces must land on an occupied tile.Two new accessors, both anchor-relative offsets like
cells():doorstep(steps)— the arrow's tile, rotated. Never incells().entrance_direction(steps)— the unit vector the arrow points in, rotated.doorstep(s) + entrance_direction(s)is always a cell inrotated(s).Decisions
@is. A lone"@"was the smallest legal footprint under #36 and no longer parses — pinned by a test so the contract change is deliberate.Vector2i, not an N/E/S/W enum, and turns through the samerotate_offset()the cells use.rotate_offset()is now a static, so there is one rotation implementation rather than two that have to agree — and a test assertsrotated()is that static mapped over every cell.push_errorandcells()left empty: no arrow, more than one arrow, arrow pointing at an empty tile, arrow pointing off the grid. Each rejection has its own message.Changes
BuildingFootprint.gd— parse, validate, rotate and expose the entrance..tresfiles gain an arrow.test_building_footprint_entrance.gd— new, 40-odd tests: parsing per shape and per arrow character, the doorstep-outside/entrance-inside properties held across all four rotations,rotate_offsetsemantics (zero, wrap, negative), the five rejection cases, a save/load round trip, and a catalogue test asserting every authored.treshas a usable entrance.Verification
Full GUT suite green: 173/173, 1046 asserts, no orphans.
Not covered: nothing visual. The doorstep is data only at this point — rendering it is #61, and
gl_compatibilitydraws nothing headless anyway.Follow-ups
test_building_footprint_entrance.gdis deliberately a separate file (a call to a not-yet-existing method is a parse error in GDScript, which would have taken every #36 test down with it). Now that the API exists it could be merged intotest_building_footprint.gd; left as-is here to keep the diff readable.Closes #55
🤖 Generated with Claude Code
https://claude.ai/code/session_01DtdF9mqzKi95DHBn9Et1pz