Class BagInventory
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
The contents of one or more bags
public class BagInventory : IReadOnlyCollection<ItemSlot>, IEnumerable<ItemSlot>, IEnumerable
- Inheritance
-
BagInventory
- Implements
- Inherited Members
- Extension Methods
Constructors
BagInventory(ICoreAPI, ItemSlot[])
public BagInventory(ICoreAPI api, ItemSlot[] bagSlots)
Parameters
Fields
Api
protected ICoreAPI Api
Field Value
bagContents
protected List<ItemSlot> bagContents
Field Value
Properties
BagSlots
public ItemSlot[] BagSlots { get; set; }
Property Value
- ItemSlot[]
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
this[int]
public ItemSlot this[int slotId] { get; set; }
Parameters
slotId
int
Property Value
Methods
GetEnumerator()
Gets the enumerator for the inventory.
public IEnumerator<ItemSlot> GetEnumerator()
Returns
ReloadBagInventory(InventoryBase, ItemSlot[])
public void ReloadBagInventory(InventoryBase parentinv, ItemSlot[] bagSlots)
Parameters
parentinv
InventoryBasebagSlots
ItemSlot[]
SaveSlotIntoBag(ItemSlotBagContent)
public void SaveSlotIntoBag(ItemSlotBagContent slot)
Parameters
slot
ItemSlotBagContent
SaveSlotsIntoBags()
public void SaveSlotsIntoBags()