Пример #1
0
    public int AddItemManyToSlot(Item item, int quantity, int slotNum)
    {
        if (slotNum >= slots.Length || slotNum < 0)
        {
            return(-1);
        }

        ItemInventorySlot s = slots [slotNum];

        if (s.isEmpty())
        {
            return(setSlot(item, quantity, slotNum));
        }
        else
        {
            if (s.isAddableItem(item))
            {
                return(s.addItemMany(item, quantity));
            }
            else
            {
                return(-1);
            }
        }
    }