refactor and better screen mechanism (probably)

This commit is contained in:
2018-11-17 23:27:05 -06:00
parent 8377bb5ae8
commit 1195b8228a
15 changed files with 89 additions and 71 deletions

View File

@@ -1,14 +1,11 @@
using RhythmBullet.Zer01HD.Utilities.Persistence;
using RhythmBullet.Zer01HD.Preferences;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace RhythmBullet.Zer01HD.Utilities
namespace RhythmBullet.Zer01HD.Utilities.Persistence
{
public class PreferencesManager
{
@@ -21,12 +18,13 @@ namespace RhythmBullet.Zer01HD.Utilities
this.savePath = savePath;
Directory.CreateDirectory(savePath);
preferenceList = new Dictionary<Type, Preferences>();
Debug.WriteLine("Preference manager setting up...");
Type[] preferenceTypes = new Type[preferences.Length];
for (int prefID = 0; prefID < preferences.Length; prefID++)
{
preferenceList.Add(preferences[prefID].GetType(), preferences[prefID]);
preferenceTypes[prefID] = preferences[prefID].GetType();
Debug.WriteLine(preferences[prefID] + " added to list of preferences");
}
xmlSerializer = new XmlSerializer(typeof(Preferences), preferenceTypes);