MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / make

Function make

python/make.py:73–93  ·  view source on GitHub ↗
(
    thing: str, dog: Dog, smelter: Smelter, lc: LazerCutter, fab: Fabricator
)

Source from the content-addressed store, hash-verified

71
72
73def 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
96def make_requirements(

Callers 4

main.pyFile · 0.90
make_shapeFunction · 0.85
make_requirementsFunction · 0.85
buildFunction · 0.85

Calls 7

make_requirementsFunction · 0.85
make_smeltableFunction · 0.85
make_shapeFunction · 0.85
transportMethod · 0.80
fetchMethod · 0.80
getMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected