Exemple #1
0
    private void AddItemToInventory(Item item, int amount)
    {
        bool addingNew = !Owned(item.itemId);

        ItemListing listing = this.GetItemListingForId(addingNew, item.itemId);

        listing.Add(amount);

        InventoryAdjustment adjustment = addingNew ? InventoryAdjustment.ADD : InventoryAdjustment.UPDATE;
        var adjustmentArgs             = new InventoryAdjustmentEventArgs(listing, adjustment);

        InventoryAdjusted.BroadcastEvent(this, adjustmentArgs);
    }