Module object reference

Description

Describes an instance of a module definition (see configRef).

Properties

Property nameTypeInfo
moduleIdintegerThe module's definition id number. (Read-only)
inBufferProductBufferThe module's input buffer. Stored products to be processed. (See ProductBuffer reference)
outBufferProductBufferThe module's output buffer. Stores outgoing products to be shipped.
processListProductBufferProducts that are currently being processed.
maxInBufferintegerMaximum inbuffer size, from config. (Read-only)
maxOutBufferintegerMaximum outbuffer size, from config. (Read-only)
inConModuleThe module this module recieves input from. (Or null)
outConModuleThe module this module sends output to. (Or null)
waitTimenumberThe time it takes for the module to complete a production cycle. (Read-only)
namestringThe name of the module.
mode1,mode2,mode3,mode4integerGeneral variables to define different settings for modules.
qanumberThe module's QA setting.
cleaningnumberThe module's cleaning setting.
damagenumberThe module's damage level.

Methods

None yet.

Events

Event nameInfoReturn value
onInput(Product)Called when the module recieves a new product that should be sent to the inbuffer.A product to be sent to storage, or null/nothing.
onOutput(Product)Called when a product is finished processing and should be sent to the outbuffer.A product to be sent to storage, or null/nothing.
onCheckBufferCalled when the processList is empty, to see if there are products in the inbuffer that can be processed.None
onClickCalled when the module is clicked in "change mode".A gui object where additional gui objects can be placed.

Examples

See dummyModule.js