Пример #1
0
        public void SaveTo(ColonySnapshot snapshot, string destinationName)
        {
            BinaryFormatter Formatter = new BinaryFormatter();

            using (FileStream stream = File.Open(destinationName, FileMode.OpenOrCreate))
            {
                Formatter.Serialize(stream, snapshot);
            }
        }
Пример #2
0
 public void SaveColony(ColonySnapshot snapshot, string toPath)
 {
     Repository.SaveTo(snapshot, toPath);
 }
Пример #3
0
        private void _IView_LoadColony(string fromPath)
        {
            ColonySnapshot snapshot = OuterColony.GetColony(fromPath);

            Life.PlaceColonyOnField(new ReadOnlyCollection <(int, int)>(snapshot.Colony), snapshot.GenerationCounter);
        }