Factorio Funnels: only sort current funnel, not all funnels

This commit is contained in:
Fabian Dill 2021-06-11 20:18:28 +02:00
parent 2a13fe05c6
commit 3ea7f1cb03
2 changed files with 1 additions and 3 deletions

View File

@ -1,4 +1,3 @@
import copy
from itertools import zip_longest
import logging
import os

View File

@ -173,15 +173,14 @@ def get_shapes(factorio_world) -> Dict[str, List[str]]:
elif layout in funnel_layers:
slice_size = funnel_slice_sizes[layout]
world.random.shuffle(tech_names)
tech_names.sort(key=lambda tech_name: len(custom_technologies[tech_name].get_prior_technologies()))
while len(tech_names) > slice_size:
tech_names = tech_names[slice_size:]
current_tech_names = tech_names[:slice_size]
layer_size = funnel_layers[layout]
previous_slice = []
current_tech_names.sort(key=lambda tech_name: len(custom_technologies[tech_name].get_prior_technologies()))
for layer in range(funnel_layers[layout]):
slice = current_tech_names[:layer_size]
current_tech_names = current_tech_names[layer_size:]