From 083e5cb0c24f34f40a7be1f58a64acf6bdb5df04 Mon Sep 17 00:00:00 2001 From: "Yi Yang @ Anteros" Date: Thu, 5 Oct 2023 02:30:54 +0800 Subject: [PATCH] (Aegis) add placeholder for YETI-style workers --- industry/cargos/workers.py | 4 ++++ industry/economies/vanilla_subarctic.py | 8 ++++++++ industry/industries/worker_yard.py | 4 ++++ industry/lib/validator/reachability.py | 4 ++++ 4 files changed, 20 insertions(+) create mode 100644 industry/cargos/workers.py create mode 100644 industry/industries/worker_yard.py diff --git a/industry/cargos/workers.py b/industry/cargos/workers.py new file mode 100644 index 00000000..c408fb93 --- /dev/null +++ b/industry/cargos/workers.py @@ -0,0 +1,4 @@ +import grf +from industry.lib.cargo import ACargo + +the_cargo = ACargo(b"WOKR", grf.CargoClass.PASSENGERS, capacity_multiplier=0x400, weight=1) diff --git a/industry/economies/vanilla_subarctic.py b/industry/economies/vanilla_subarctic.py index 908b0734..f1dddbbf 100644 --- a/industry/economies/vanilla_subarctic.py +++ b/industry/economies/vanilla_subarctic.py @@ -14,6 +14,7 @@ farm_supplies, engineering_supplies, water, + workers, ) from industry.industries import ( bank, @@ -32,6 +33,7 @@ trading_centre, water_supply, water_tower, + worker_yard, ) @@ -96,6 +98,12 @@ def get_economy(self, parameters): ret.graph[printing_works].produces += (engineering_supplies,) ret.graph[oil_refinery].produces += (farm_supplies,) + if parameters["WORKER"].startswith("YETI"): + ret.graph[worker_yard] = PrimaryIndustry(workers) + + # FIXME + ret.graph[coal_mine].booster = workers + if port in ret.graph: if parameters["LAND_PORTS"] == "LAND_ONLY": ret.graph[trading_centre] = ret.graph[port] diff --git a/industry/industries/worker_yard.py b/industry/industries/worker_yard.py new file mode 100644 index 00000000..9b67ee74 --- /dev/null +++ b/industry/industries/worker_yard.py @@ -0,0 +1,4 @@ +from industry.lib.industry import AIndustry + + +the_industry = AIndustry(id=0x36, name="Worker Yard") diff --git a/industry/lib/validator/reachability.py b/industry/lib/validator/reachability.py index 2bcfc5cc..b1164b08 100644 --- a/industry/lib/validator/reachability.py +++ b/industry/lib/validator/reachability.py @@ -26,3 +26,7 @@ def check_reachability(economy): assert can_produce.issubset( can_accept ), f"The following cargos can be produced but not accepted by any industry: {', '.join(str(x) for x in can_produce if x not in can_accept)}" + + assert can_accept.issubset( + can_produce + ), f"The following cargos can be accepted but not produced by any industry: {', '.join(str(x) for x in can_accept if x not in can_produce)}"