Closed fechan closed 11 months ago
Idea is to have machines inherit from a superclass with the following methods:
new(slots)
: Configures the peripherals to be managed by the rest of the superclass' inventory methods. slots
is a table that maps from slot names to {peripheral, slot_in_peripheral}
pushItems(toMachine, fromSlot, [limit], [toSlot])
: same as CCTweaked inventory API, but accepting a machine instead of a peripheralpullItems(fromName, fromSlot, [limit], [toSlot])
see abovelist()
dittogetItemDetail(slotName)
ditto except slot number is replaced by slot nameWe can get rid of peripherals
from new
altogether since it's only used for slot resolution anyway. So instead of peripheral_idx
we just pass in refs to the actual peripheral table.
Done. See https://github.com/fechan/modular-factory/blob/master/drivers/create/sequencedassembly.lua for an example
It needs to be possible to define a machine that has virtual slots corresponding to actual slots on multiple peripherals, i.e. for the I/O of Create sequenced assembly.