diff --git a/industry/economies/vanilla_subarctic.py b/industry/economies/vanilla_subarctic.py index 163db7e0..a684eb17 100644 --- a/industry/economies/vanilla_subarctic.py +++ b/industry/economies/vanilla_subarctic.py @@ -108,7 +108,7 @@ def get_economy(self, parameters): ret.graph[printing_works].produces += (engineering_supplies,) ret.graph[oil_refinery].produces += (farm_supplies,) - if parameters["WORKFORCE"].startswith("YETI"): + if parameters["WORKFORCE"].startswith("YETI") and parameters["WORKER_PARTICIPATION"] != "NONE": ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold)) if parameters["WORKFORCE"] == "YETI": ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold)) @@ -118,10 +118,14 @@ def get_economy(self, parameters): ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold, mail)) elif parameters["WORKFORCE"] == "YETI_TIRED": ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold, tired_workers)) - ret.graph[coal_mine].produces += (tired_workers,) # FIXME ret.graph[coal_mine].boosters = workers + if parameters["WORKER_PARTICIPATION"] == "PRIMARY_INDUSTRY": + for i in [coal_mine, oil_wells, gold_mine, farm, forest]: + ret.graph[i] = ret.graph[i].to_secondary(workers) + if parameters["WORKFORCE"] == "YETI_TIRED": + ret.graph[i].produces += (tired_workers,) if port in ret.graph: if parameters["SEA_INDUSTRY"] == "LAND_ONLY": diff --git a/industry/lib/economy/__init__.py b/industry/lib/economy/__init__.py index 91d0645f..9acb080c 100644 --- a/industry/lib/economy/__init__.py +++ b/industry/lib/economy/__init__.py @@ -48,6 +48,9 @@ def boosters(self): def boosters(self, new_boosters): self._boosters = make_tuple(new_boosters) + def to_secondary(self, consumes): + return FakePrimaryIndustry(consumes, self.produces, self.extra_accepts, self.boosters) + class WorkerYard(PrimaryIndustry): def __init__(self, produces=(), extra_accepts=(), boosters=()): @@ -60,16 +63,23 @@ def __init__(self, boosters=(), produces=(), extra_accepts=()): class SecondaryIndustry(Industry): - def __init__(self, consumes=(), produces=()): + def __init__(self, consumes=(), produces=(), extra_accepts=(), boosters=()): self.consumes = make_tuple(consumes) self.produces = make_tuple(produces) + self.extra_accepts = make_tuple(extra_accepts) + self.boosters = make_tuple(boosters) def copy(self): - return SecondaryIndustry(self.consumes, self.produces) + return SecondaryIndustry(self.consumes, self.produces, self.extra_accepts) @property def accepts(self): - return self.consumes + return self.consumes + self.extra_accepts + self.boosters + + +class FakePrimaryIndustry(SecondaryIndustry): + def __init__(self, consumes=(), produces=(), extra_accepts=(), boosters=()): + super().__init__(consumes, produces, extra_accepts, boosters) class TertiaryIndustry(Industry): diff --git a/industry/lib/parameters.py b/industry/lib/parameters.py index 58482397..b25c4694 100644 --- a/industry/lib/parameters.py +++ b/industry/lib/parameters.py @@ -241,7 +241,7 @@ "SPECIFIC_SUPPLIES", ], ) -docs_parameter_choices.update_params("WORKFORCE", ["ABSTRACT", "PROFESSIONAL", "YETI"]) +docs_parameter_choices.update_params("WORKFORCE", ["ABSTRACT", "PROFESSIONAL", "YETI_TIRED"]) docs_parameter_choices.update_params("WORKER_PARTICIPATION", ["NONE", "PRIMARY_INDUSTRY", "SECONDARY_INDUSTRY"]) docs_parameter_choices.update_params("SEA_INDUSTRY", ["ORGANIC"]) docs_parameter_choices.update_params("TOWN_GOODS", ["ORGANIC"]) @@ -267,7 +267,7 @@ "YETI": { "POLICY": "AUTARKY", "PRIMARY_INDUSTRY_GROWTH": "UNIVERSAL_SUPPLIES", - "WORKFORCE": "YETI", + "WORKFORCE": "YETI_TIRED", "WORKER_PARTICIPATION": "PRIMARY_INDUSTRY", "SEA_INDUSTRY": "ORGANIC", "TOWN_GOODS": "ORGANIC",