示例#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();
        }
示例#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();
     }
 }
示例#3
0
 public DataSave(DataSave dataSave)
 {
     this.highScores = dataSave.highScores;
 }