public void SaveTo(ColonySnapshot snapshot, string destinationName) { BinaryFormatter Formatter = new BinaryFormatter(); using (FileStream stream = File.Open(destinationName, FileMode.OpenOrCreate)) { Formatter.Serialize(stream, snapshot); } }
public void SaveColony(ColonySnapshot snapshot, string toPath) { Repository.SaveTo(snapshot, toPath); }
private void _IView_LoadColony(string fromPath) { ColonySnapshot snapshot = OuterColony.GetColony(fromPath); Life.PlaceColonyOnField(new ReadOnlyCollection <(int, int)>(snapshot.Colony), snapshot.GenerationCounter); }