public Recorder(Version version, int levelID, int levelSeed) { this.Data = new RecordData(); this.Data.Version = version; this.Data.LevelID = levelID; this.Data.Seed = levelSeed; }
public static void Load(this RecordData recordData, string name) { try { using (var sr = new StreamReader(name)) { var serializer = new XmlSerializer(typeof(RecordData)); recordData = serializer.Deserialize(sr) as RecordData; } } catch (Exception err) { System.Diagnostics.Debug.WriteLine(err.Message); } }
public static bool Save(this RecordData recordData, string name) { try { using (var sw = new StreamWriter(name)) { var serializer = new XmlSerializer(typeof(RecordData)); serializer.Serialize(sw, recordData); } } catch (Exception err) { System.Diagnostics.Debug.WriteLine(err.Message); return(false); } return(true); }