Add the Pawn record and Pawns registry #91
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!91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "77-pawn-record-and-registry"
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?
Splits the pawn scene script into a
Pawnrecord and aPawnView, and puts aPawnsregistry in front of both, so pawns become addressable by id for #78, #80 and #75.Decisions worth flagging
spawn()takes a world position, not a cell. Random placement lives ingame.gdas a stub — real spawning belongs to the rocket landing and unloading its crew, so the registry shouldn't own an RNG.mapis injected and_spawn_view()skips without one, so a pawn with no view is a supported state, not a fault.remove()treats only a missing record as an error.remove()emits after both dictionaries settle;Buildings.remove()emits before despawning its view. Worth aligning in a follow-up rather than here.PawnViewisqueue_free()d, notfree()d as buildings' views are — it has a script and anArea3D, and from #80 a path in_process.Left undone
Pawn.celldefaults toVector2i(), and(0, 0)is a valid tile — "never placed" is indistinguishable from "map corner".Vector2i(-1, -1)would matchid's sentinel andnearest_walkable()'s failure value.test_pawns.gd's_expect_push_errors()filters onis_push_error();test_buildings.gd's copy doesn't, and would miscount if warnings ever fire there.Verification
test/unit/test_pawns.gd. The one pending is the pre-existing #85 placeholder.Closes #77
🤖 Generated with Claude Code
https://claude.ai/code/session_01YJPT6VdCLkJAVjc8bHqrZz