Table of Contents

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

api ICoreAPI
bagSlots ItemSlot[]

Fields

Api

protected ICoreAPI Api

Field Value

ICoreAPI

bagContents

protected List<ItemSlot> bagContents

Field Value

List<ItemSlot>

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

ItemSlot

Methods

GetEnumerator()

Gets the enumerator for the inventory.

public IEnumerator<ItemSlot> GetEnumerator()

Returns

IEnumerator<ItemSlot>

ReloadBagInventory(InventoryBase, ItemSlot[])

public void ReloadBagInventory(InventoryBase parentinv, ItemSlot[] bagSlots)

Parameters

parentinv InventoryBase
bagSlots ItemSlot[]

SaveSlotIntoBag(ItemSlotBagContent)

public void SaveSlotIntoBag(ItemSlotBagContent slot)

Parameters

slot ItemSlotBagContent

SaveSlotsIntoBags()

public void SaveSlotsIntoBags()