VRage.Game.ModAPI
IMyInventory
Assembly: VRage.Game.dll
public interface IMyInventory: IMyInventory
Describes inventory interface (PB scripting interface) You can cast if MyInventory for getting more functionality
Events
| Member | Description |
|---|---|
| OnVolumeChanged | Triggers when volume of the inventory is changed |
Properties
| Member | Description |
|---|---|
| CanPutItems | Gets or sets if inventory can receive items or not. |
| Owner | Returns entity this inventory belongs to. |
| CanPutItems | Gets if inventory can receive items or not. Inherited from IMyInventory |
| CurrentMass | Returns total mass of items inside this inventory in Kg. Inherited from IMyInventory |
| CurrentVolume | Returns total volume of items inside this inventory in m^3. Inherited from IMyInventory |
| IsFull | Determines if inventory is absolutely full. Inherited from IMyInventory |
| ItemCount | Returns number of occupied inventory slots. Inherited from IMyInventory |
| MaxVolume | Sets maximum volume of items this inventory can contain in m^3. Inherited from IMyInventory |
| Owner | Returns entity this inventory belongs to. Inherited from IMyInventory |
| VolumeFillFactor | Gets the current volume fill factor of the inventory Inherited from IMyInventory |
Methods
| Member | Description |
|---|---|
| AddItems(MyFixedPoint, MyObjectBuilder_PhysicalObject, int) | Adds item to inventory. Doesn't do all checks inside. Call CanAddItemAmount(IMyInventoryItem, MyFixedPoint) before this function |
| CanAddItemAmount(IMyInventoryItem, MyFixedPoint) | Gets whether item could be added into inventory, but doesn't add it Checks: - Inserting volume - Inventory can receive items - Inventory filter can |
| Clear(bool) | Remove all items from inventory |
| Empty() | Gets if inventory is empty |
| FindItem(SerializableDefinitionId) | Finds first item stack, whose content matching provided id |
| GetItemByID(uint) | Gets item by id |
| RemoveItemAmount(IMyInventoryItem, MyFixedPoint) | Remove |
| RemoveItems(uint, MyFixedPoint?, bool, bool) | Removes item by itemId |
| RemoveItemsAt(int, MyFixedPoint?, bool, bool) | Removes items at exact inventory index |
| RemoveItemsOfType(MyFixedPoint, MyObjectBuilder_PhysicalObject, bool) | Removes amount for specified item type from inventory |
| RemoveItemsOfType(MyFixedPoint, SerializableDefinitionId, MyItemFlags, bool) | Removes amount for specified item type from inventory |
| TransferItemFrom(IMyInventory, int, int?, bool?, MyFixedPoint?, bool) | Transfer item from one inventory to another |
| TransferItemFrom(IMyInventory, IMyInventoryItem, MyFixedPoint) | Transfer item from one inventory to another |
| TransferItemTo(IMyInventory, int, int?, bool?, MyFixedPoint?, bool) | Transfer item from one inventory to another |
| CanItemsBeAdded(MyFixedPoint, MyItemType) | Determines if given amount of items fits into this inventory on top of existing items. Inherited from IMyInventory |
| CanTransferItemTo(IMyInventory, MyItemType) | Determines if there is working conveyor connection for item of give type to be transferred to other inventory. Inherited from IMyInventory |
| ContainItems(MyFixedPoint, MyItemType) | Determines if there is at least given amount of items of given type contained inside this inventory. Inherited from IMyInventory |
| FindItem(MyItemType) | Tries to find an item of given type inside this inventory. Inherited from IMyInventory |
| GetAcceptedItems(List |
Returns all items this inventory accepts. Inherited from IMyInventory |
| GetItemAmount(MyItemType) | Sums up total amount of items of given type contained inside this inventory. Inherited from IMyInventory |
| GetItemAt(int) | Returns info about item at give position. Inherited from IMyInventory |
| GetItemByID(uint) | Returns info about item contained inside this inventory. Inherited from IMyInventory |
| GetItems(List |
Collects all items present inside this inventory and returns snapshot of the current inventory state. Inherited from IMyInventory |
| IsConnectedTo(IMyInventory) | Checks if two inventories are connected. Inherited from IMyInventory |
| IsItemAt(int) | Determines if there is any item on given inventory slot. Inherited from IMyInventory |
| TransferItemFrom(IMyInventory, MyInventoryItem, MyFixedPoint?) | Attempts to transfer item from one inventory to another. Inherited from IMyInventory |
| TransferItemFrom(IMyInventory, int, int?, bool?, MyFixedPoint?) | Attempts to transfer item from one inventory to another. Inherited from IMyInventory |
| TransferItemTo(IMyInventory, MyInventoryItem, MyFixedPoint?) | Attempts to transfer item from one inventory to another. Inherited from IMyInventory |
| TransferItemTo(IMyInventory, int, int?, bool?, MyFixedPoint?) | Attempts to transfer item from one inventory to another. Inherited from IMyInventory |
| GetItems() | Obsolete: Use non-allocating GetItems overload |
Implements:
Inheritors: