private TrySetLap ( int driverId, PostedTime time ) : void | ||
driverId | int | The Id of the driver which posted the time. |
time | PostedTime | The time. |
return | void |
private void TrySetLap(int driverId, PostedTime time)
{
var isSessionBest = time.Type == PostedTimeType.SessionBest ||
// We only receive session best lap times during a race session so we determine here
// if the specified time should be promoted.
(CurrentSessionType != SessionType.Race && (Lap == null || time.Time < Lap.Time));
if(isSessionBest)
{
SetLap(driverId, time.Time, time.LapNumber);
}
}