Skip to content

Commit

Permalink
(Aegis) add placeholder for YETI-style workers
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Oct 4, 2023
1 parent 29389fe commit 083e5cb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions industry/cargos/workers.py
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 8 additions & 0 deletions industry/economies/vanilla_subarctic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
farm_supplies,
engineering_supplies,
water,
workers,
)
from industry.industries import (
bank,
Expand All @@ -32,6 +33,7 @@
trading_centre,
water_supply,
water_tower,
worker_yard,
)


Expand Down Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions industry/industries/worker_yard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from industry.lib.industry import AIndustry


the_industry = AIndustry(id=0x36, name="Worker Yard")
4 changes: 4 additions & 0 deletions industry/lib/validator/reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"

0 comments on commit 083e5cb

Please sign in to comment.