public void Load(PersistableObject o) { using (var reader = new BinaryReader(File.Open(_savePath, FileMode.Open))) { o.Load(new GameDataReader(reader, -reader.ReadInt32())); } }
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)); } }