Remove the one-way ore API superseded by the transfer menu

The loose end from #24. withdraw_to_fleet, unload_into_building and
deliver_cargo were the old one-way moves behind "Load ore" and "Store
ore here"; every one of them is a special case of transfer_to_building /
transfer_to_fleet, and none had a caller left outside tests. The
cargo_delivered signal had no listeners at all.

Not just tidying: unload_into_building routed through
deposit_to_building, which does NOT special-case the mothership - it
writes b.stock, while building_holdings() returns `rocks` for a
mothership and ignores stock entirely. So unload_into_building(
mothership_id) would have parked ore in a field nothing reads, with no
error. Nothing called it that way, but it is a plausibly-named function
sitting there to be reached for later. transfer_to_building handles it.

CARGO_LOAD_BATCH stays - the transfer menu's batch buttons use it; only
its role as withdraw_to_fleet's default argument is gone.

The #24 note expected folding these in to be costly for
test_cargo_readout, which places no buildings. It is not: the transfer
primitives work off GameState records rather than spawned nodes, so a
single add_building() in setup is enough and it stays a display test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-12 13:07:52 +02:00
commit b6427b080d
27 changed files with 1085 additions and 275 deletions

View file

@ -27,6 +27,7 @@ var scene: Node
var banked: Control
var cargo: Control
var stage: int = 0
var mothership_id: int = 0
var elapsed: float = 0.0
@ -36,6 +37,11 @@ func _initialize() -> void:
game_state.extractors.clear()
game_state.rocks = 42
game_state.fleet_cargo = 0
# Banking is a transfer TO the mothership now (#24), and a transfer needs
# a building to aim at. Only the record is required - the transfer
# primitives work off GameState, not off the spawned node - so this stays
# a display test rather than becoming one about the building system.
mothership_id = game_state.add_building(GameState.BUILDING_MOTHERSHIP, Vector2.ZERO)
scene = load("res://Main.tscn").instantiate()
root.add_child(scene)
banked = scene.get_node("UI/ResourceCounter")
@ -95,7 +101,7 @@ func _process(delta: float) -> bool:
])
# --- 4. delivery moves it across ----------------------------
game_state.deliver_cargo()
game_state.transfer_to_building(mothership_id, game_state.fleet_cargo)
elapsed = 0.0
stage = 2
return false