work around to allow two different types of callbacks for the same one
This commit is contained in:
@@ -130,7 +130,7 @@ public class InventoryHelper(
|
||||
try
|
||||
{
|
||||
if (request.Callback is not null)
|
||||
request.Callback(rootItemToAdd.Upd.StackObjectsCount.Value);
|
||||
request.Callback(rootItemToAdd.Upd.StackObjectsCount.Value, null, null, null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -373,7 +373,7 @@ public class ItemHelper(
|
||||
// found in the handbook. If the price can't be found at all return 0
|
||||
// @param List<string> tpls item tpls to look up the price of
|
||||
// @returns Total price in roubles
|
||||
public decimal GetItemAndChildrenPrice(List<string> tpls)
|
||||
public double GetItemAndChildrenPrice(List<string> tpls)
|
||||
{
|
||||
// Run getItemPrice for each tpl in tpls array, return sum
|
||||
return tpls.Aggregate(0, (total, tpl) => total + (int)GetItemPrice(tpl));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Eft.Common;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
using Core.Models.Eft.Trade;
|
||||
|
||||
namespace Core.Models.Eft.Inventory;
|
||||
|
||||
@@ -15,7 +17,7 @@ public record AddItemDirectRequest
|
||||
public bool? FoundInRaid { get; set; }
|
||||
|
||||
[JsonPropertyName("callback")]
|
||||
public Action<double>? Callback { get; set; }
|
||||
public Action<double, ProcessBuyTradeRequestData?, string?, PmcData?>? Callback { get; set; }
|
||||
|
||||
[JsonPropertyName("useSortingTable")]
|
||||
public bool? UseSortingTable { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user