Skip to content

Commit

Permalink
Add LapCounter to RaceEvents and store them into the JSON ReplayScrip…
Browse files Browse the repository at this point in the history
…t File
  • Loading branch information
MerlinCooper committed Dec 1, 2020
1 parent 50ec686 commit 7a9895f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Phases/Capturing/OverlayData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class RaceEvent
public InterestState Interest;
public bool WithOvertake;
public int Position = int.MaxValue;
public int RaceLapNumber = 0;

public override int GetHashCode()
{
Expand Down
9 changes: 5 additions & 4 deletions Phases/Capturing/RemovalEdits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ internal void WithOvertake()

void AddEvent(InterestState interest, DataSample d, TimeSpan t)
{
raceEvents.Add(new OverlayData.RaceEvent
raceEvents.Add(new OverlayData.RaceEvent
{
Interest = interest,
StartTime = lastStartTime.TotalSeconds,
Interest = interest,
StartTime = lastStartTime.TotalSeconds,
EndTime = t.TotalSeconds,
WithOvertake = withOvertake,
Position = position
Position = position,
RaceLapNumber = d.Telemetry.Lap
});
lastStartTime = t;

Expand Down

0 comments on commit 7a9895f

Please sign in to comment.