AcManager.Pages.Drive.QuickDrive_Hotlap.ViewModel.ViewModel C# (CSharp) Method

ViewModel() public method

public ViewModel ( bool initialize = true ) : System.Threading.Tasks
initialize bool
return System.Threading.Tasks
            public ViewModel(bool initialize = true) {
                Saveable = new SaveHelper<SaveableData>("__QuickDrive_Hotlap", () => new SaveableData {
                    Penalties = Penalties,
                    GhostCar = GhostCar,
                    GhostCarAdvantage = GhostCarAdvantage
                }, o => {
                    Penalties = o.Penalties;
                    GhostCar = o.GhostCar;
                    GhostCarAdvantage = o.GhostCarAdvantage;
                }, () => {
                    Penalties = true;
                    GhostCar = true;
                    GhostCarAdvantage = 0.0;
                });

                if (initialize) {
                    Saveable.Initialize();
                } else {
                    Saveable.Reset();
                }
            }
QuickDrive_Hotlap.ViewModel