Ejemplo n.º 1
0
 protected override void InitializeSaveable() {
     Saveable = new SaveHelper<SaveableData>("__QuickDrive_Trackday", () => {
         var r = new SaveableData();
         Save(r);
         return r;
     }, Load, Reset);
     Saveable.RegisterUpgrade<OldSaveableData>(OldSaveableData.Test, Load);
 }
Ejemplo n.º 2
0
            public ViewModel(bool initialize = true) {
                Saveable = new SaveHelper<SaveableData>("__QuickDrive_TimeAttack", () => new SaveableData {
                    Penalties = Penalties,
                }, o => {
                    Penalties = o.Penalties;
                }, () => {
                    Penalties = true;
                });

                if (initialize) {
                    Saveable.Initialize();
                } else {
                    Saveable.Reset();
                }
            }
Ejemplo n.º 3
0
            public ViewModel(bool initialize = true) {
                Saveable = new SaveHelper<SaveableData>("__QuickDrive_Drift", () => new SaveableData {
                    Penalties = Penalties,
                    StartType = SelectedStartType.Value
                }, o => {
                    Penalties = o.Penalties;
                    SelectedStartType = Game.StartType.Values.FirstOrDefault(x => x.Value == o.StartType) ?? Game.StartType.Pit;
                }, () => {
                    Penalties = true;
                    SelectedStartType = Game.StartType.Pit;
                });

                if (initialize) {
                    Saveable.Initialize();
                } else {
                    Saveable.Reset();
                }
            }
Ejemplo n.º 4
0
            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();
                }
            }
Ejemplo n.º 5
0
 protected override void InitializeSaveable() {
     Saveable = new SaveHelper<SaveableData>("__QuickDrive_Weekend", () => {
         var r = new SaveableData();
         Save(r);
         return r;
     }, Load, Reset);
     Saveable.RegisterUpgrade<OldSaveableData>(QuickDrive_Race.ViewModel.OldSaveableData.Test, Load);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Will be called in constuctor!
 /// </summary>
 protected virtual void InitializeSaveable() {
     Saveable = new SaveHelper<SaveableData>("__QuickDrive_GridTest", () => {
         var r = new SaveableData();
         Save(r);
         return r;
     }, Load, Reset);
 }