Ejemplo n.º 1
0
        public static void Save(DataSave newSave)
        {
            BinaryFormatter bf         = new BinaryFormatter();
            FileStream      fileStream = File.Create(content.RootDirectory + "/savefile.dat");

            currentDataSave = newSave;
            bf.Serialize(fileStream, newSave);
            fileStream.Close();
        }
Ejemplo n.º 2
0
 public static void LoadContent(ContentManager Content)
 {
     content = Content;
     if (File.Exists(content.RootDirectory + "/savefile.dat"))
     {
         BinaryFormatter bf         = new BinaryFormatter();
         FileStream      fileStream = File.Open(content.RootDirectory + "/savefile.dat", FileMode.Open);
         currentDataSave = new DataSave((DataSave)bf.Deserialize(fileStream));
         fileStream.Close();
     }
     else
     {
         currentDataSave = new DataSave();
     }
 }
Ejemplo n.º 3
0
 public DataSave(DataSave dataSave)
 {
     this.highScores = dataSave.highScores;
 }