public override async Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties) { var selectedCar = CarsManager.Instance.GetById(basicProperties.CarId ?? ""); var selectedTrack = TracksManager.Instance.GetLayoutById(basicProperties.TrackId ?? "", basicProperties.TrackConfigurationId); IEnumerable <Game.AiCar> botCars; try { using (var waiting = new WaitingDialog()) { if (selectedCar == null || !selectedCar.Enabled) { ModernDialog.ShowMessage(AppStrings.Drive_CannotStart_SelectNonDisabled, AppStrings.Drive_CannotStart_Title, MessageBoxButton.OK); return; } if (selectedTrack == null) { ModernDialog.ShowMessage(AppStrings.Drive_CannotStart_SelectTrack, AppStrings.Drive_CannotStart_Title, MessageBoxButton.OK); return; } botCars = await RaceGridViewModel.GenerateGameEntries(waiting.CancellationToken); if (waiting.CancellationToken.IsCancellationRequested) { return; } if (botCars == null || !botCars.Any()) { ModernDialog.ShowMessage(AppStrings.Drive_CannotStart_SetOpponent, AppStrings.Drive_CannotStart_Title, MessageBoxButton.OK); return; } } } catch (Exception e) when(e.IsCanceled()) { return; } catch (Exception e) { NonfatalError.Notify("Can’t create race grid", e); return; } basicProperties.Ballast = RaceGridViewModel.PlayerBallast; basicProperties.Restrictor = RaceGridViewModel.PlayerRestrictor; await StartAsync(new Game.StartProperties { BasicProperties = basicProperties, AssistsProperties = assistsProperties, ConditionProperties = conditionProperties, TrackProperties = trackProperties, ModeProperties = GetModeProperties(botCars) }); }
public abstract Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties);
public override async Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties) { await StartAsync(new Game.StartProperties { BasicProperties = basicProperties, AssistsProperties = assistsProperties, ConditionProperties = conditionProperties, TrackProperties = trackProperties, ModeProperties = new Game.PracticeProperties { Penalties = Penalties, StartType = SelectedStartType } }); }
public override async Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties) { basicProperties.Ballast = PlayerBallast; basicProperties.Restrictor = PlayerRestrictor; await StartAsync(new Game.StartProperties { BasicProperties = basicProperties, AssistsProperties = assistsProperties, ConditionProperties = conditionProperties, TrackProperties = trackProperties, ModeProperties = new Game.TimeAttackProperties { Penalties = Penalties } }); }
public override async Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties, string serializedQuickDrivePreset, IList <object> additionalProperties) { basicProperties.Ballast = PlayerBallast; basicProperties.Restrictor = PlayerRestrictor; await StartAsync(new Game.StartProperties { BasicProperties = basicProperties, AssistsProperties = assistsProperties, ConditionProperties = conditionProperties, TrackProperties = trackProperties, ModeProperties = new Game.TimeAttackProperties { Penalties = Penalties }, AdditionalPropertieses = additionalProperties.Concat(new object[] { new QuickDrivePresetProperty(serializedQuickDrivePreset), new CarCustomDataHelper(), new CarExtendedPhysicsHelper(), }).ToList() }); }
public override async Task Drive(Game.BasicProperties basicProperties, Game.AssistsProperties assistsProperties, Game.ConditionProperties conditionProperties, Game.TrackProperties trackProperties) { await StartAsync(new Game.StartProperties { BasicProperties = basicProperties, AssistsProperties = assistsProperties, ConditionProperties = conditionProperties, TrackProperties = trackProperties, ModeProperties = new Game.HotlapProperties { Penalties = Penalties, GhostCar = GhostCar, GhostCarAdvantage = GhostCarAdvantage, RecordGhostCar = SettingsHolder.Drive.AlwaysRecordGhost ? true : (bool?)null } }); }