# ports.ludic - what crafting asks the game: the pack, and the stations # the pack. `leaves` is what an item leaves behind once used (water leaves its bottle), -1 nothing. export port CraftPack { count: fn(int) -> int take: fn(int, int) -> bool add: fn(int, int) -> int room: fn(int) -> int = fn craft_no_limit leaves: fn(int) -> int = fn craft_leaves_nothing } function craft_no_limit(it: int) -> int { return 2147483647 } function craft_leaves_nothing(it: int) -> int { return -1 } # the stations. Unbound, there are none: only the hands are ready, and nothing can be started. # `start(station, recipe)` puts a timed recipe in; false gives the makings back. export port CraftStations { ready: fn(int) -> bool = fn craft_hands_only start: fn(int, int) -> bool = fn craft_no_start } function craft_hands_only(station: int) -> bool { return station == CRAFT_HANDS } function craft_no_start(station: int, recipe: int) -> bool { return false }