Esempio n. 1
0
 public void Save(Game.GameOptions options)
 {
     using (FileStream fs = new FileStream(_filePath, FileMode.OpenOrCreate))
     {
         new BinaryFormatter().Serialize(fs, options);
     }
 }
Esempio n. 2
0
 public Game.GameOptions Load()
 {
     Game.GameOptions options = null;
     if (File.Exists(_filePath))
     {
         using (FileStream file = File.Open(_filePath, FileMode.Open))
         {
             object loadedData = new BinaryFormatter().Deserialize(file);
             options = (Game.GameOptions)loadedData;
         }
     }
     return(options);
 }