diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs index 03372ca6c8..f047f28240 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Glide.cs @@ -338,23 +338,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { return PluginType.Glide; } - - public Dictionary GetPluginSettings() - { - //TODO: deal witn the game depedent settings - var dictionary = new Dictionary(); - var members = this.GetType().GetMembers(); - foreach (var member in members) - { - if (member.MemberType == MemberTypes.Property) - { - var field = this.GetType().GetProperty(member.Name).GetValue(this, null); - dictionary.Add(member.Name, field); - } - } - - return dictionary; - } } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs index 545664e22b..765f000844 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.GlideMk2.cs @@ -282,23 +282,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { return PluginType.GlideMk2; } - - public Dictionary GetPluginSettings() - { - //TODO: deal witn the game depedent settings - var dictionary = new Dictionary(); - var members = this.GetType().GetMembers(); - foreach (var member in members) - { - if (member.MemberType == MemberTypes.Property) - { - var field = this.GetType().GetProperty(member.Name).GetValue(this, null); - dictionary.Add(member.Name, field); - } - } - - return dictionary; - } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs index dc6cf9a5a4..97d85fd3ba 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Jabo.cs @@ -39,23 +39,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 } - public Dictionary GetPluginSettings() - { - //TODO: deal witn the game depedent settings - var dictionary = new Dictionary(); - var members = this.GetType().GetMembers(); - foreach (var member in members) - { - if (member.MemberType == MemberTypes.Property) - { - var field = this.GetType().GetProperty(member.Name).GetValue(this, null); - dictionary.Add(member.Name, field); - } - } - - return dictionary; - } - [DefaultValue(ANISOTROPIC_FILTERING_LEVEL.FourTimes)] [DisplayName("Anisotropic filtering")] [Description("Anisotropic filtering level")] diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs index 190377d121..7a1eb23897 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.Rice.cs @@ -399,23 +399,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 { return PluginType.Rice; } - - public Dictionary GetPluginSettings() - { - //TODO: deal witn the game depedent settings - var dictionary = new Dictionary(); - var members = this.GetType().GetMembers(); - foreach (var member in members) - { - if (member.MemberType == MemberTypes.Property) - { - var field = this.GetType().GetProperty(member.Name).GetValue(this, null); - dictionary.Add(member.Name, field); - } - } - - return dictionary; - } } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs index 7e99c59048..554262b5e5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64SyncSettings.cs @@ -3,6 +3,7 @@ using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Nintendo.N64.NativeApi; using Newtonsoft.Json; using System.ComponentModel; +using System.Reflection; namespace BizHawk.Emulation.Cores.Nintendo.N64 { @@ -113,7 +114,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 public interface IPluginSettings { PluginType GetPluginType(); - Dictionary GetPluginSettings(); void FillPerGameHacks(GameInfo game); } + + public static class PluginExtensions + { + public static Dictionary GetPluginSettings(this IPluginSettings plugin) + { + // TODO: deal witn the game depedent settings + var dictionary = new Dictionary(); + var members = plugin.GetType().GetMembers(); + foreach (var member in members) + { + if (member.MemberType == MemberTypes.Property) + { + var field = plugin.GetType().GetProperty(member.Name).GetValue(plugin, null); + dictionary.Add(member.Name, field); + } + } + + return dictionary; + } + } }