Пример #1
0
    public int PutItem(Item item, int index)
    {
        Item myItem = inventory[index].MyItem;

        if (myItem == null)
        {
            inventory[index].MyItem = item;
            return(item.MaxStackSize);
        }

        int amount = myItem.Accepts(item);

        inventory[index].MyItem.StackSize += amount;
        return(amount);
    }