/// <summary> /// Load action /// </summary> /// <param name="stream"></param> private static void Load(Stream stream) { DataContractSerializer dcs = new DataContractSerializer(typeof(PlayerProgress.Data), new List <Type>() { typeof(Single), typeof(Double), typeof(Achievement), typeof(HashSet <DataPea>), typeof(DataPea) }); _current = dcs.ReadObject(stream) as PlayerProgress.Data; }
/// <summary> /// Loads a default instance /// </summary> private static void LoadDefault(String serialNumber) { _current = new PlayerProgress.Data(serialNumber) { SessionScore = 0, Score = 0, }; // Saves the default instance Save(); }
/// <summary> /// Load action /// </summary> /// <param name="stream"></param> private static void Load(Stream stream) { DataContractSerializer dcs = new DataContractSerializer(typeof(PlayerProgress.Data), new List<Type>() { typeof(Single), typeof(Double), typeof(Achievement), typeof(HashSet<DataPea>), typeof(DataPea) }); _current = dcs.ReadObject(stream) as PlayerProgress.Data; }