Skip to content

Commit

Permalink
Merge pull request #64 from SSchulze1989/feature/complex-bonus-points
Browse files Browse the repository at this point in the history
Feature: Complex bonus points
  • Loading branch information
SSchulze1989 authored Sep 10, 2023
2 parents 337985b + 8c18a16 commit 5703a79
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/iRLeagueApiCore.Common/Enums/BonusPointType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public enum BonusPointType
{
Position,
QualyPosition,
FastestLap,
FastestAverageLap,
CleanestDriver,
NoIncidents,
MostPositionsGained,
MostPositionsLost,
LeadOneLap,
LeadMostLaps,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace iRLeagueApiCore.Common.Models;

[DataContract]
public class BonusPointModel
{
[DataMember]
public BonusPointType Type { get; set; }
[DataMember]
public double Value { get; set; }
[DataMember]
public double Points { get; set; }
[DataMember]
public ICollection<FilterConditionModel> Conditions { get; set; } = new List<FilterConditionModel>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class PostPointRuleModel
[DataMember]
public IList<int> PointsPerPlace { get; set; } = new List<int>();
[DataMember]
public IDictionary<string, int> BonusPoints { get; set; } = new Dictionary<string, int>();
public ICollection<BonusPointModel> BonusPoints { get; set; } = new List<BonusPointModel>();
[DataMember]
public int MaxPoints { get; set; }
public int PointDropOff { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<PackageId>iRLeagueApiCore.Common</PackageId>
<Version>0.9.0-dev.5</Version>
<Version>0.9.0-dev.6</Version>
<Authors>Simon Schulze</Authors>
<Company>Simon Schulze</Company>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down

0 comments on commit 5703a79

Please sign in to comment.