diff --git a/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs index cbbdb031..b0437966 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/MathUtil.cs @@ -16,6 +16,12 @@ public class MathUtil return values.Sum(); } + public float ListSum(List values) + { + // Sum the list starting with an initial value of 0 + return values.Sum(); + } + /// /// Helper to create the cumulative sum of all list elements /// ListCumSum([1, 2, 3, 4]) = [1, 3, 6, 10] diff --git a/UnitTests/Tests/Utils/MathUtilTests.cs b/UnitTests/Tests/Utils/MathUtilTests.cs index 4bcde051..f9f99c07 100644 --- a/UnitTests/Tests/Utils/MathUtilTests.cs +++ b/UnitTests/Tests/Utils/MathUtilTests.cs @@ -10,7 +10,7 @@ public class MathUtilTests [TestMethod] public void ListSumTest() { - var test = new List + var test = new List { 1.1f, 2.1f,