Made use of IdWithCount
This commit is contained in:
@@ -255,7 +255,7 @@ public class QuestController(
|
||||
return ShowRepeatableQuestInvalidConditionError(handoverQuestRequest, output);
|
||||
}
|
||||
|
||||
var totalItemCountToRemove = 0;
|
||||
var totalItemCountToRemove = 0d;
|
||||
foreach (var itemHandover in handoverQuestRequest.Items)
|
||||
{
|
||||
var matchingItemInProfile = pmcData.Inventory.Items.FirstOrDefault(item => item.Id == itemHandover.Id);
|
||||
@@ -279,7 +279,7 @@ public class QuestController(
|
||||
_questHelper.ChangeItemStack(
|
||||
pmcData,
|
||||
itemHandover.Id,
|
||||
itemHandover.Count - itemCountToRemove ?? 0,
|
||||
(int)(itemHandover.Count - itemCountToRemove ?? 0),
|
||||
sessionID,
|
||||
output
|
||||
);
|
||||
@@ -377,7 +377,7 @@ public class QuestController(
|
||||
return _httpResponseUtil.AppendErrorToOutput(output, errorMessage);
|
||||
}
|
||||
|
||||
private void UpdateProfileTaskConditionCounterValue(PmcData pmcData, string conditionId, string questId, int counterValue)
|
||||
private void UpdateProfileTaskConditionCounterValue(PmcData pmcData, string conditionId, string questId, double counterValue)
|
||||
{
|
||||
if (pmcData.TaskConditionCounters[conditionId] != null)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Eft.Common.Request;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace Core.Models.Eft.Hideout;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Common;
|
||||
using Core.Models.Eft.Common.Request;
|
||||
|
||||
namespace Core.Models.Eft.Hideout;
|
||||
@@ -10,17 +11,8 @@ public record HideoutPutItemInRequestData : BaseInteractionRequestData
|
||||
public int? AreaType { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public Dictionary<string, ItemDetails>? Items { get; set; }
|
||||
public Dictionary<string, IdWithCount>? Items { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public long? Timestamp { get; set; }
|
||||
}
|
||||
|
||||
public record ItemDetails
|
||||
{
|
||||
[JsonPropertyName("count")]
|
||||
public int? Count { get; set; }
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Common;
|
||||
using Core.Models.Eft.Common.Request;
|
||||
|
||||
namespace Core.Models.Eft.Hideout;
|
||||
@@ -9,29 +10,11 @@ public record HideoutScavCaseStartRequestData : BaseInteractionRequestData
|
||||
public string? RecipeId { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public List<HideoutItem>? Items { get; set; }
|
||||
public List<IdWithCount>? Items { get; set; }
|
||||
|
||||
[JsonPropertyName("tools")]
|
||||
public List<Tool>? Tools { get; set; }
|
||||
public List<IdWithCount>? Tools { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public long? Timestamp { get; set; }
|
||||
}
|
||||
|
||||
public record HideoutItem
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("count")]
|
||||
public int? Count { get; set; }
|
||||
}
|
||||
|
||||
public record Tool
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("count")]
|
||||
public int? Count { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Common;
|
||||
using Core.Models.Eft.Common.Request;
|
||||
|
||||
namespace Core.Models.Eft.Hideout;
|
||||
@@ -9,20 +10,11 @@ public record HideoutSingleProductionStartRequestData : BaseInteractionRequestDa
|
||||
public string? RecipeId { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public List<HandoverItem>? Items { get; set; }
|
||||
public List<IdWithCount>? Items { get; set; }
|
||||
|
||||
[JsonPropertyName("tools")]
|
||||
public List<HandoverItem>? Tools { get; set; }
|
||||
public List<IdWithCount>? Tools { get; set; }
|
||||
|
||||
[JsonPropertyName("timestamp")]
|
||||
public long? Timestamp { get; set; }
|
||||
}
|
||||
|
||||
public record HandoverItem
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("count")]
|
||||
public int? Count { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Eft.Common.Request;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
|
||||
namespace Core.Models.Eft.Hideout;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Common;
|
||||
using Core.Models.Eft.Inventory;
|
||||
|
||||
namespace Core.Models.Eft.Quests;
|
||||
@@ -12,14 +13,5 @@ public record HandoverQuestRequestData : InventoryBaseActionRequestData
|
||||
public string? ConditionId { get; set; }
|
||||
|
||||
[JsonPropertyName("items")]
|
||||
public List<HandoverItem>? Items { get; set; }
|
||||
}
|
||||
|
||||
public record HandoverItem
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("count")]
|
||||
public int? Count { get; set; }
|
||||
public List<IdWithCount>? Items { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Helpers;
|
||||
using Core.Models.Common;
|
||||
using SptCommon.Annotations;
|
||||
using Core.Models.Eft.Common;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
|
||||
Reference in New Issue
Block a user