private KeyValuePair <string, object> parseSettingLine(string line) { string resultKey = null; object resultValue = null; string[] parts = line.Split(':'); if (parts.Length == 2) { switch (parts[0]) { case "screen_width": case "screen_height": resultValue = ResourceManager.ParseItemData <int>(parts[1]); break; case "fullscreen": resultValue = ResourceManager.ParseItemData <bool>(parts[1]); break; } if (resultValue != null) { resultKey = parts[0]; } } return(new KeyValuePair <string, object>(resultKey, resultValue)); }
public static void Initialize(ContentManager contentManager) { foreach (string line in File.ReadAllLines(contentManager.RootDirectory + "/KeyboardMapping.txt")) { string[] parts = line.Split(':'); KeyboardMapping.Add((InputButton)ResourceManager.ParseItemData <InputButton>(parts[0]), (Keys)ResourceManager.ParseItemData <Keys>(parts[1])); } GamePadUsedLast = false; }