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); } }
/// <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 }; }