work around to allow two different types of callbacks for the same one

This commit is contained in:
CWX
2025-01-23 11:23:48 +00:00
parent 7534f00fb6
commit 916756bf19
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -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; }