(
thing: str, dog: Dog, smelter: Smelter, lc: LazerCutter, fab: Fabricator
)
| 71 | |
| 72 | |
| 73 | def make( |
| 74 | thing: str, dog: Dog, smelter: Smelter, lc: LazerCutter, fab: Fabricator |
| 75 | ): |
| 76 | requirements = BUILD_REQUIREMENTS.get(thing) |
| 77 | if requirements is not None: |
| 78 | make_requirements(requirements, dog, smelter, lc, fab) |
| 79 | fab.send(f"MAKE {thing}") |
| 80 | dog.transport(thing, fab.location, fab.location) |
| 81 | else: |
| 82 | match thing: |
| 83 | # raw materials |
| 84 | case "IRON" | "COPPER" | "SILICATE" | "SULFER": |
| 85 | dog.fetch(thing, fab.location) |
| 86 | # smeltable |
| 87 | case "IRON_PLATE" | "COPPER_PLATE" | "WAFER": |
| 88 | make_smeltable(thing, dog, smelter, fab) |
| 89 | # shapes |
| 90 | case "GEAR" | "BAR_WINDING" | "NUT": |
| 91 | make_shape(thing, dog, smelter, lc, fab) |
| 92 | case x: |
| 93 | ValueError(f"make {x} not implemented") |
| 94 | |
| 95 | |
| 96 | def make_requirements( |
no test coverage detected