diff --git a/src/firs.py b/src/firs.py index 1122375be..421201487 100644 --- a/src/firs.py +++ b/src/firs.py @@ -95,6 +95,10 @@ def validate_economies_cargo_ids(self): for economy in self: economy.validate_economy_cargo_ids() + def get_economy_by_id(self, id): + for economy in self: + if economy.id == id: + return economy class IndustryManager(list): """ diff --git a/src/gs/manufacturers.py b/src/gs/manufacturers.py index ac654b181..90b63bdfb 100644 --- a/src/gs/manufacturers.py +++ b/src/gs/manufacturers.py @@ -1,3 +1,6 @@ +# firs is imported, but main is not called in this module, this relies on firs already being present in the context +import firs + manufacturer_types = [ "steelmaker", "automaker", @@ -5,3 +8,15 @@ "chemicals_manufacturer", "building_materials_manufacturer", ] + +def main(): + test_economy = firs.economy_manager.get_economy_by_id("STEELTOWN") + print("CABBAGE manufacturers test_economy.detect_cargo_flow") + print(test_economy.detect_cargo_flow("GOOD")) + + +class Manufacturer(object): + # extend + + def __init__(self): + pass diff --git a/src/gs/templates/vulcan/manufacturers.pynut b/src/gs/templates/vulcan/manufacturers.pynut index b328184f5..cf95e0a3d 100644 --- a/src/gs/templates/vulcan/manufacturers.pynut +++ b/src/gs/templates/vulcan/manufacturers.pynut @@ -174,7 +174,7 @@ class VulcanManufacturers { } local cabbage_industries = { foo_1 = ["blast_furnace", "electric_arc_furnace", "basic_oxygen_furnace", "assembly_plant", "body_plant", "engine_plant"], - foo_2 = ["precision_parts_plant", "hardware_factory", "appliance_factory", "chlor_alkali_plant", "cryo_plant", "pipework_fabricator"], + foo_2 = ["precision_parts_plant", "metal_fabricator", "appliance_factory", "chlor_alkali_plant", "cryo_plant", "pipework_fabricator"], } foreach (tier_id, cabbage_tier in cabbage_tiers) { @@ -232,6 +232,7 @@ class TestManufacturerCabbage { local result = [] foreach (industry_id, industry_spec in firs.active_economy.industries) { if ("industry_ownership" in industry_spec) { + // CABBAGE - manufacturer_types_this_is_anchor_for is deprecated, put the industries on the manufacturer instead if ("manufacturer_types_this_is_anchor_for" in industry_spec.industry_ownership) { industry_spec.economy_variations[firs.active_economy.id].vulcan_config.industry_ownership Log.Info(industry_spec.economy_variations[firs.active_economy.id].vulcan_config.industry_ownership.manufacturer_types_this_is_anchor_for); @@ -252,7 +253,7 @@ class TestManufacturerCabbage { local anchors_temp = { steelmaker = ["blast_furnace", "electric_arc_furnace"], automaker = ["assembly_plant", "body_plant", "engine_plant"], - equipment_manufacturer = ["precision_parts_plant", "hardware_factory", "appliance_factory"], + equipment_manufacturer = ["precision_parts_plant", "metal_fabricator", "appliance_factory"], chemicals_manufacturer = ["chlor_alkali_plant", "cryo_plant"], building_materials_manufacturer = ["concrete_plant", "pipework_fabricator"], }; diff --git a/src/industries/blast_furnace.py b/src/industries/blast_furnace.py index ffde28c73..f7223c00d 100644 --- a/src/industries/blast_furnace.py +++ b/src/industries/blast_furnace.py @@ -31,7 +31,6 @@ "industry_ownership": { "owner_types": ["manufacturer"], "production_tiers": ["steel_production"], - "manufacturer_types_this_is_anchor_for": ["steelmaker"], } }, ) diff --git a/src/polar_fox/constants.py b/src/polar_fox/constants.py index 574bfab9c..c584e6de0 100644 --- a/src/polar_fox/constants.py +++ b/src/polar_fox/constants.py @@ -223,7 +223,7 @@ "BAKE", "ALO_", "NHNO", - # not CBLK, gets dedicated vehicles or box + "CBLK", ], "cryo_gases": ["CHLO", "O2__", "NH3_", "N7__", "WELD", "H2__", "N7__"], "edible_liquids": ["MILK", "WATR", "BEER", "FOOD", "EOIL"], diff --git a/src/render_gs.py b/src/render_gs.py index 492336cfd..0b675e72f 100755 --- a/src/render_gs.py +++ b/src/render_gs.py @@ -92,6 +92,7 @@ def main(): print("[RENDER GS]") firs.main() + manufacturers.main() if os.path.exists(gs_dst): shutil.rmtree(gs_dst)