Example #1
0
 static Settings()
 {
     Preferences.RegisterType <Level>
     (
         (n, o) => Preferences.HasPref(n) ? FileManagement.levels.First(p => p.Id == Preferences.Get <int>(n)) : o,
         (n, v) => Preferences.Set(n, v.Id),
         n => Preferences.Delete <ulong>(n)
     );
     Preferences.RegisterType <Pack>
     (
         (n, o) => Preferences.HasPref(n) ? FileManagement.packs.First(p => p.Id == Preferences.Get <int>(n)) : o,
         (n, v) => Preferences.Set(n, v.Id),
         n => Preferences.Delete <ulong>(n)
     );
 }