feat: replaced ItemUtils.GetArmorDurability() loop with Sum() function.
This commit is contained in:
parent
7734090feb
commit
cabd008204
|
@ -6,15 +6,7 @@ namespace LootValueEX.Utils
|
||||||
{
|
{
|
||||||
internal static class ItemUtils
|
internal static class ItemUtils
|
||||||
{
|
{
|
||||||
internal static float GetArmorDurability(IEnumerable<RepairableComponent> repairableComponents)
|
internal static float GetArmorDurability(IEnumerable<RepairableComponent> repairableComponents) => repairableComponents.Sum(x => x.Durability);
|
||||||
{
|
|
||||||
float totalDurability = 0;
|
|
||||||
foreach (RepairableComponent component in repairableComponents)
|
|
||||||
{
|
|
||||||
totalDurability += component.Durability;
|
|
||||||
}
|
|
||||||
return totalDurability;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static Task<Structs.TradeOfferStruct> GetBestTraderValueAsync(Item item)
|
internal static Task<Structs.TradeOfferStruct> GetBestTraderValueAsync(Item item)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user