Beispiel #1
0
 public Recorder(Version version, int levelID, int levelSeed)
 {
     this.Data         = new RecordData();
     this.Data.Version = version;
     this.Data.LevelID = levelID;
     this.Data.Seed    = levelSeed;
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        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);
        }