public void AddItem(OwnedItemInformation addItem, int amount, bool isSave)
        {
            if (amount == -1 || amount > addItem.Amount)
            {
                amount = addItem.Amount;
                addItem.OwnerContainer = ItemContainer;


                if (!AddToExistingStack(addItem, addItem.Amount, isSave))
                {
                    ItemContainer.containerItems.Add(addItem);
                    ItemContainer.AddItemEvent(addItem, isSave);
                }
            }
            else
            {
                addItem.OwnerContainer = ItemContainer;
                if (!AddToExistingStack(addItem, amount, isSave))
                {
                    addItem.Amount = amount;
                    ItemContainer.containerItems.Add(addItem);
                    ItemContainer.AddItemEvent(addItem, isSave);
                }
            }
        }
Beispiel #2
0
        void AddItemToContainer(OwnedItemInformation addItem, int amount, bool isSave)
        {
            if (amount == -1)
            {
                amount = addItem.Amount;
                addItem.OwnerContainer = itemContainer;

                itemContainer.containerItems.Add(addItem);
                itemContainer.AddItemEvent(addItem, isSave);
            }
            else
            {
                addItem.Amount         = amount;
                addItem.OwnerContainer = itemContainer;

                itemContainer.containerItems.Add(addItem);
                itemContainer.AddItemEvent(addItem, isSave);
            }
        }