Skip to content

Commit

Permalink
Change: WIP on FIRS GS Manufacturers
Browse files Browse the repository at this point in the history
  • Loading branch information
andythenorth committed Jun 29, 2024
1 parent 73438f0 commit f1b522b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/firs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
15 changes: 15 additions & 0 deletions src/gs/manufacturers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# 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",
"equipment_manufacturer",
"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
5 changes: 3 additions & 2 deletions src/gs/templates/vulcan/manufacturers.pynut
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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"],
};
Expand Down
1 change: 0 additions & 1 deletion src/industries/blast_furnace.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"industry_ownership": {
"owner_types": ["manufacturer"],
"production_tiers": ["steel_production"],
"manufacturer_types_this_is_anchor_for": ["steelmaker"],
}
},
)
Expand Down
2 changes: 1 addition & 1 deletion src/polar_fox/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
1 change: 1 addition & 0 deletions src/render_gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def main():
print("[RENDER GS]")

firs.main()
manufacturers.main()

if os.path.exists(gs_dst):
shutil.rmtree(gs_dst)
Expand Down

0 comments on commit f1b522b

Please sign in to comment.