Exemple #1
0
        public void Load(PersistableObject o)
        {
            byte[] data   = File.ReadAllBytes(savePath);
            var    reader = new BinaryReader(new MemoryStream(data));

            o.Load(new GameDataReader(reader, -reader.ReadInt32()));
        }
Exemple #2
0
 public void Save(PersistableObject o, int version)
 {
     using (var writer = new BinaryWriter(File.Open(savePath, FileMode.Create)))
     {
         writer.Write(-version);
         o.Save(new GameDataWriter(writer));
     }
 }