public void Execute() { if (StartTime.HasValue) { startTimeCutAction = new CutRouteAction(Session, StartTime.Value + offset, CutType.Before); startTimeCutAction.Execute(); } if (EndTime.HasValue) { endTimeCutAction = new CutRouteAction(Session, EndTime.Value + offset, CutType.After); endTimeCutAction.Execute(); } addLapActions = new List<AddLapAction>(); foreach(Lap lap in Laps) { lap.Time += offset; if (lap.Time >= Session.Route.FirstWaypoint.Time && lap.Time <= Session.Route.LastWaypoint.Time) { var a = new AddLapAction(lap, Session); addLapActions.Add(a); a.Execute(); } } }
public void Execute() { if (StartTime.HasValue) { startTimeCutAction = new CutRouteAction(Session, StartTime.Value + offset, CutType.Before); startTimeCutAction.Execute(); } if (EndTime.HasValue) { endTimeCutAction = new CutRouteAction(Session, EndTime.Value + offset, CutType.After); endTimeCutAction.Execute(); } addLapActions = new List <AddLapAction>(); foreach (Lap lap in Laps) { lap.Time += offset; if (lap.Time >= Session.Route.FirstWaypoint.Time && lap.Time <= Session.Route.LastWaypoint.Time) { var a = new AddLapAction(lap, Session); addLapActions.Add(a); a.Execute(); } } }