Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
component:transposer [2017/07/11 17:07]
gamax92 created
component:transposer [2018/09/21 05:34] (current)
payonel
Line 7: Line 7:
 Callbacks: Callbacks:
  
-- `transferFluid(sourceSide:​number,​ sinkSide:​number,​ count:​number):​number` ​  +- `transferFluid(sourceSide:​number,​ sinkSide:​number,​ count:​number):​boolean, ​number` ​  
-  Transfer some items between two inventories.+  Transfer some fluids ​between two fluid handlers (pipes or tanks, etc). `sourceSide` is the side pulled from and `sinkSide` is the side transferred to. The side value is a integral value representing the cardinal directions (east, west, south, north), up, and down. The `sides` library has these values for convenience. `count` is the number of millibuckets to transfers. Returns true and the number of millibuckets transfered on success, or false and an error message on failure.
 - `store(side:​number,​ slot:​number,​ dbAddress:​string,​ dbSlot:​number):​boolean`  ​ - `store(side:​number,​ slot:​number,​ dbAddress:​string,​ dbSlot:​number):​boolean`  ​
   Store an item stack description in the specified slot of the database with the specified address.   Store an item stack description in the specified slot of the database with the specified address.
Line 17: Line 17:
 - `getSlotMaxStackSize(side:​number,​ slot:​number):​number`  ​ - `getSlotMaxStackSize(side:​number,​ slot:​number):​number`  ​
   Get the maximum number of items in the specified slot of the inventory on the specified side of the device.   Get the maximum number of items in the specified slot of the inventory on the specified side of the device.
 +- `getInventoryName(side:​number):​string`  ​
 +  Get the the name of the inventory on the specified side of the device.
 - `getInventorySize(side:​number):​number`  ​ - `getInventorySize(side:​number):​number`  ​
   Get the number of slots in the inventory on the specified side of the device.   Get the number of slots in the inventory on the specified side of the device.
Line 35: Line 37:
 - `getTankCapacity(side:​number , tank:​number):​number`  ​ - `getTankCapacity(side:​number , tank:​number):​number`  ​
   Get the capacity of the specified tank on the specified side.   Get the capacity of the specified tank on the specified side.
 +- `getAllStacks(side:​number):​userdata`  ​
 +  Get a description of all stacks in the inventory on the specified side of the device.  ​
 +  The return value is callable. Calling it will return a table describing the stack in the inventory or nothing if the iterator reaches end.  ​
 +  The return value provides the followings callbacks:  ​
 +  `getAll():​table`  ​
 +    Returns ALL the stack in the this.array. Memory intensive.  ​
 +  `count():​number`  ​
 +    Returns the number of elements in the this.array.  ​
 +  `reset()`  ​
 +    Reset the iterator index so that the next call will return the first element.  ​
 +    ​
  
 ---- ----
  
 {{page>​component:​contents&​noheader&​noeditbutton&​nouser&​nofooter}} {{page>​component:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}