Interface IMyConveyorSorter
Describes conveyor sorter block (PB scripting interface)
Inherited Members
Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll
Syntax
public interface IMyConveyorSorter : IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity
Properties
DrainAll
Determines whether the sorter should drain any inventories connected to it and push them to the other side - as long as the items passes the filtering as defined by the filter list (GetFilterList(List<MyInventoryItemFilter>)) and Mode.
Declaration
bool DrainAll { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Mode
Determines the current mode of this sorter.
Declaration
MyConveyorSorterMode Mode { get; }
Property Value
Type | Description |
---|---|
MyConveyorSorterMode |
Methods
AddItem(MyInventoryItemFilter)
Adds a single item to the filter list. See SetFilter(MyConveyorSorterMode, List<MyInventoryItemFilter>) to change the filter mode and/or fill the entire list in one go.
Declaration
void AddItem(MyInventoryItemFilter item)
Parameters
Type | Name | Description |
---|---|---|
MyInventoryItemFilter | item | Item filter settings |
GetFilterList(List<MyInventoryItemFilter>)
Gets the items currently being allowed through or rejected, depending on the Mode.
Declaration
void GetFilterList(List<MyInventoryItemFilter> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<MyInventoryItemFilter> | items | Buffer array, that would be cleared, and receive block filter settings |
IsAllowed(MyDefinitionId)
Determines whether a given item type is allowed go through the sorter, depending on the filter list (GetFilterList(List<MyInventoryItemFilter>)) and Mode.
Declaration
bool IsAllowed(MyDefinitionId id)
Parameters
Type | Name | Description |
---|---|---|
MyDefinitionId | id | Item id |
Returns
Type | Description |
---|---|
System.Boolean | Whether a given item type is allowed go through the sorter |
RemoveItem(MyInventoryItemFilter)
Removes a single item from the filter list. See SetFilter(MyConveyorSorterMode, List<MyInventoryItemFilter>) to change the filter mode and/or clear the entire list in one go.
Declaration
void RemoveItem(MyInventoryItemFilter item)
Parameters
Type | Name | Description |
---|---|---|
MyInventoryItemFilter | item | Item filter settings |
SetFilter(MyConveyorSorterMode, List<MyInventoryItemFilter>)
Changes the sorter to desired mode and filters the provided items. You can pass in null
to empty the list.
Declaration
void SetFilter(MyConveyorSorterMode mode, List<MyInventoryItemFilter> items)
Parameters
Type | Name | Description |
---|---|---|
MyConveyorSorterMode | mode | New work mod |
System.Collections.Generic.List<MyInventoryItemFilter> | items | Replaces previous filter settings with this one |