From d7f88ecbf94cc917b86230532cca56045a8690b1 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 5 Dec 2014 00:15:28 +0000 Subject: [PATCH] Chane IEmulator Extension methods like HasMemoryDomains to use the HasService() method --- BizHawk.Emulation.Common/Extensions.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BizHawk.Emulation.Common/Extensions.cs b/BizHawk.Emulation.Common/Extensions.cs index 7a46db6128..2eeb188551 100644 --- a/BizHawk.Emulation.Common/Extensions.cs +++ b/BizHawk.Emulation.Common/Extensions.cs @@ -12,14 +12,19 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions return (CoreAttributes)Attribute.GetCustomAttribute(core.GetType(), typeof(CoreAttributes)); } + public static bool IsNull(this IEmulator core) + { + return core == null || core is NullEmulator; + } + public static bool HasMemoryDomains(this IEmulator core) { - return core is IMemoryDomains; + return core != null && core.ServiceProvider.HasService(); } public static bool HasSaveRam(this IEmulator core) { - return core is ISaveRam; + return core != null && core.ServiceProvider.HasService(); } public static bool HasSavestates(this IEmulator core) @@ -29,12 +34,7 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions public static bool CanPollInput(this IEmulator core) { - return core is IInputPollable; - } - - public static bool IsNull(this IEmulator core) - { - return core == null || core is NullEmulator; + return core != null && core.ServiceProvider.HasService(); } public static bool CpuTraceAvailable(this IEmulator core)