Exemple #1
0
 /// <summary>
 /// Add an item to the trade.
 /// </summary>
 /// <param name="item">The Inventory.Item instance.</param>
 /// <param name="amount">An optional amount parameter. Use it if the item is a currency item.</param>
 /// <returns>True/false if the action was successful or not.</returns>
 public bool AddItem(GenericInventory.Inventory.Item item, int amount = 0)
 {
     amount = item.Amount;
     return(AddItem(new TradeUserAssets()
     {
         assetid = item.Id, appid = item.AppId, contextid = item.ContextId, amount = amount, iscurrency = item.IsCurrency
     }));
 }
Exemple #2
0
        /// <summary>
        /// Remove an item from the trade.
        /// </summary>
        /// <param name="item">The Inventory.Item instance.</param>
        /// <returns>True/false if the action was successful or not.</returns>
        public bool RemoveItem(GenericInventory.Inventory.Item item)
        {
            int amount = item.IsCurrency ? 0 : item.Amount;

            return(RemoveItem(item.Id, item.AppId, item.ContextId, amount, item.IsCurrency));
        }