Beispiel #1
0
        public static void Load(string path)
        {
            if (CurrentSaveSheet != null)
            {
                throw new Exception("current save sheet isntempty, wft?");
            }

            var serializer = new XmlSerializer(typeof(SaveSheet));

            using (FileStream fs = new FileStream(path, FileMode.Open))
            {
                TextReader reader = new StreamReader(fs);
                CurrentSaveSheet = (SaveSheet)serializer.Deserialize(reader);
            }
        }
Beispiel #2
0
 /// <summary>
 /// creates new save file and sets current save sheet to it
 /// </summary>
 /// <param name="fileName"></param>
 public static void SaveAs(string fileName)
 {
     CurrentSaveSheet = new SaveSheet {
         fileName = fileName
     };
 }