Example #1
0
            internal async Task Go()
            {
                var selectedMode = SelectedModeViewModel;

                if (selectedMode == null)
                {
                    return;
                }

                if (SettingsHolder.Drive.QuickDriveCheckTrack)
                {
                    var doesNotFit = selectedMode.TrackDoesNotFit;
                    if (doesNotFit != null)
                    {
                        var respond = ShowTrackDoesNotFitMessage(doesNotFit.Item1);
                        if (respond == TrackDoesNotFitRespond.Cancel)
                        {
                            return;
                        }

                        if (respond == TrackDoesNotFitRespond.FixAndGo)
                        {
                            doesNotFit.Item2(SelectedTrack);
                        }
                    }
                }

                try {
                    await selectedMode.Drive(new Game.BasicProperties {
                        CarId                = SelectedCar.Id,
                        CarSkinId            = SelectedCar.SelectedSkin?.Id,
                        CarSetupId           = _carSetupId,
                        TrackId              = SelectedTrack.Id,
                        TrackConfigurationId = SelectedTrack.LayoutId
                    }, AssistsViewModel.ToGameProperties(), new Game.ConditionProperties {
                        AmbientTemperature = Temperature,
                        RoadTemperature    = RoadTemperature,

                        SunAngle      = Game.ConditionProperties.GetSunAngle(_forceTime ?? Time),
                        TimeMultipler = TimeMultipler,
                        CloudSpeed    = 0.2,

                        WeatherName = SelectedWeather?.Id
                    }, TrackState.ToProperties());
                } finally {
                    _goCommand?.RaiseCanExecuteChanged();
                }
            }
Example #2
0
 public AssistsDialog(AssistsViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
     Buttons = new[] { CloseButton };
 }