diff --git a/BizHawk.Emulation.Common/Base Implementations/BasicServiceProvider.cs b/BizHawk.Emulation.Common/Base Implementations/BasicServiceProvider.cs index e34b506288..4a6912fb76 100644 --- a/BizHawk.Emulation.Common/Base Implementations/BasicServiceProvider.cs +++ b/BizHawk.Emulation.Common/Base Implementations/BasicServiceProvider.cs @@ -31,6 +31,11 @@ namespace BizHawk.Emulation.Common { Services.Add(coreType, core); coreType = coreType.BaseType; + + if (coreType == typeof(object)) // Don't register object + { + coreType = null; + } } } @@ -69,5 +74,13 @@ namespace BizHawk.Emulation.Common { return Services.ContainsKey(t); } + + public IEnumerable AvailableServices + { + get + { + return Services.Select(d => d.Key); + } + } } } diff --git a/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs b/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs index e948045dca..14b48d1d6d 100644 --- a/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs +++ b/BizHawk.Emulation.Common/Interfaces/IEmulatorServiceProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace BizHawk.Emulation.Common { @@ -25,5 +26,10 @@ namespace BizHawk.Emulation.Common /// Else returns null /// object GetService(Type t); + + /// + /// A list of all cuurently registered services available to be called + /// + IEnumerable AvailableServices { get; } } }