示例#1
0
        public void AddItem(IUIItem item, bool doesIncrement)
        {
            int idAtAdd = GetProspectiveSlotID(item);

            if (thisItemIcons.Count == idAtAdd)
            {
                AddIIAndMutate(item, idAtAdd);
            }
            else
            {
                IItemIcon iiAtID = thisItemIcons[idAtAdd];
                if (iiAtID.IsEmpty())
                {
                    iiAtID.Disemptify(item);
                    iiAtID.SetQuantityInstantly(0);
                    iiAtID.UpdateQuantity(item.GetQuantity(), doesIncrement);
                }
                else
                {
                    if (iiAtID.HasSameItem(item))
                    {
                        iiAtID.IncreaseBy(item.GetQuantity(), doesIncrement);
                    }
                    else
                    {
                        this.AddIIAndMutate(item, idAtAdd);
                    }
                }
            }
        }
        void IncrementPickUpQuantityBy(int increQuantity)
        {
            IItemIcon pickedII = thisIITAM.GetPickedII();

            pickedII.IncreaseBy(increQuantity, doesIncrement: true);
            thisItemIcon.DecreaseBy(increQuantity, doesIncrement: true, removesEmpty: false);
            int newPickedUpQuantity = pickedII.GetItemQuantity();

            thisItemIcon.UpdateTransferableQuantity(newPickedUpQuantity);
        }
 void SetUpPickedQuantity(int pickedQ)
 {
     thisItem.SetQuantity(0);
     thisItemIcon.IncreaseBy(pickedQ, doesIncrement: true);
 }