Skip to content

Commit

Permalink
Fix typos and syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SSchulze1989 committed Feb 25, 2024
1 parent 7706286 commit a79b237
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<PackageId>iRLeagueApiCore.Client</PackageId>
<Version>0.11.2</Version>
<Version>0.11.3-dev.1</Version>
<Authors>Simon Schulze</Authors>
<Company>Simon Schulze</Company>
<PackageDescription>This package contains shared objects for all members of the iRLeagueDatabase-iRLeagueApi stack</PackageDescription>
Expand Down
2 changes: 1 addition & 1 deletion src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>0.11.2</Version>
<Version>0.11.3-dev.1</Version>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using iRLeagueApiCore.Services.ResultService.Models;

namespace iRLeagueApiCore.Services.ResultService.Calculation;
internal record FormulaParameter(string[] Aliases, string Description, Func<SessionCalculationData, ResultRowCalculationData, object> valueFunc);
internal record FormulaParameter(string[] Aliases, string Description, Func<SessionCalculationData, ResultRowCalculationData, double> valueFunc);

public static class FormulaParameters
{
Expand All @@ -16,7 +16,7 @@ public static class FormulaParameters
new(["qlap", "qualy_lap"], "Personal qualy lap", (_, row) => row.QualifyingTime.TotalSeconds),
new(["avglap", "avg_lap"], "Personal avg. lap", (_, row) => row.AvgLapTime.TotalSeconds),
new(["flapsession", "session_fastest_lap"], "Fastest lap in the session", (session, _) => session.FastestLap.TotalSeconds),
new(["qlapsession", "session_fastest_qualy_lap"], "Fastest qaly lap in the session", (session, _) => session.FastestQualyLap.TotalSeconds),
new(["qlapsession", "session_fastest_qualy_lap"], "Fastest qualy lap in the session", (session, _) => session.FastestQualyLap.TotalSeconds),
new(["avglapsession", "session_fastest_avg_lap"], "Fastest avg. lap in the session", (session, _) => session.FastestAvgLap.TotalSeconds),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public override IReadOnlyList<T> ApplyPoints<T>(SessionCalculationData session,
{
// prepare parameters
var e = new NCalc.Expression(Formula, EvaluateOptions.IterateParameters);
foreach (var parameter in _parameters)
foreach (var (key, parameter) in _parameters)
{
e.Parameters[parameter.Key] = rows.Select(row => parameter.Value.valueFunc.Invoke(session, row)).ToArray();
e.Parameters[key] = rows.Select(row => parameter.valueFunc.Invoke(session, row)).ToArray();
}
// calculate
if (e.Evaluate() is not IList<object> points)
Expand Down

0 comments on commit a79b237

Please sign in to comment.