public static StackableItemDecorator Init(IItem item, byte currentStack) { return(new StackableItemDecorator() { Item = item, Stack = CappedByte.Init(currentStack, item.MaxStack) }); }
public ItemHolder(ItemDBCache itemDb) { Inventories = new Dictionary <ItemType, List <IItem> > { { ItemType.Armor, new List <IItem>() }, { ItemType.Consumable, new List <IItem>() }, { ItemType.Material, new List <IItem>() } }; inventorySpace = CappedByte.Init(0, byte.MaxValue); _inventory = new Dictionary <int, IItem>(); _equipment = new Dictionary <ItemSlot, IItem>(); InventorySlots = Enum.GetNames(typeof(ItemSlot)).Length; _usedInventorySlots = 0; }