Factorio Funnels: only sort current funnel, not all funnels
This commit is contained in:
parent
2a13fe05c6
commit
3ea7f1cb03
1
Main.py
1
Main.py
|
@ -1,4 +1,3 @@
|
||||||
import copy
|
|
||||||
from itertools import zip_longest
|
from itertools import zip_longest
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -173,15 +173,14 @@ def get_shapes(factorio_world) -> Dict[str, List[str]]:
|
||||||
|
|
||||||
elif layout in funnel_layers:
|
elif layout in funnel_layers:
|
||||||
slice_size = funnel_slice_sizes[layout]
|
slice_size = funnel_slice_sizes[layout]
|
||||||
|
|
||||||
world.random.shuffle(tech_names)
|
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:
|
while len(tech_names) > slice_size:
|
||||||
tech_names = tech_names[slice_size:]
|
tech_names = tech_names[slice_size:]
|
||||||
current_tech_names = tech_names[:slice_size]
|
current_tech_names = tech_names[:slice_size]
|
||||||
layer_size = funnel_layers[layout]
|
layer_size = funnel_layers[layout]
|
||||||
previous_slice = []
|
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]):
|
for layer in range(funnel_layers[layout]):
|
||||||
slice = current_tech_names[:layer_size]
|
slice = current_tech_names[:layer_size]
|
||||||
current_tech_names = current_tech_names[layer_size:]
|
current_tech_names = current_tech_names[layer_size:]
|
||||||
|
|
Loading…
Reference in New Issue