示例#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);
        }