Provision transporters with hubs
This commit is contained in:
parent
663648d949
commit
d0a9f5b971
21 changed files with 309 additions and 588 deletions
|
|
@ -39,12 +39,10 @@ func _process(delta: float) -> bool:
|
|||
print("extractor mined locally: stock=%d bank=%d" % [
|
||||
game_state.extractor_stock(extractor_index), game_state.rocks])
|
||||
game_state.add_building(GameState.BUILDING_MOTHERSHIP, MOTHERSHIP_AT)
|
||||
var hub_id: int = game_state.add_building(GameState.BUILDING_TRANSPORT_HUB, HUB_AT)
|
||||
# A manually seeded idle transporter is enough to exercise the same
|
||||
# simulation used by a produced one.
|
||||
game_state.transporters.append({"hub_id": hub_id, "state": GameState.TRANSPORTER_IDLE,
|
||||
"target_id": 0, "extractor_index": -1, "carrying": 0, "progress": 1.0,
|
||||
"from": HUB_AT, "to": HUB_AT})
|
||||
game_state.add_building(GameState.BUILDING_TRANSPORT_HUB, HUB_AT)
|
||||
if game_state.transporters.size() != game_state.hub_capacity():
|
||||
_fail("hub did not provision its transporters")
|
||||
return true
|
||||
base_load = game_state.transporter_load_limit()
|
||||
game_state.extractors[extractor_index].stock = base_load - 1
|
||||
elapsed = 0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue