static List <DataSample> GetIncidentsReverse(IEnumerable <DataSample> samples, int sessionNumber, int maxTotalIncidents) { return(IncidentsSupport.FindIncidents( samples.TakeWhile(data => data.Telemetry.SessionNum == sessionNumber && data.Telemetry.RaceLaps > 0), d => iRacing.Replay.MoveToPrevIncident(), maxTotalIncidents)); }
static List <DataSample> GetIncidentsForward(IEnumerable <DataSample> samples, int maxTotalIncidents) { return(IncidentsSupport.FindIncidents( samples.TakeWhile(data => data.Telemetry.SessionState != SessionState.CoolDown), d => iRacing.Replay.MoveToNextIncident(), maxTotalIncidents)); }