BasicServiceProvider - allow the core to return itself when its specific implementation is requested

This commit is contained in:
adelikat 2014-12-13 16:22:36 +00:00
parent 4985b3853d
commit 925d6f5a50
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ namespace BizHawk.Emulation.Common
}
}
// Add the core itself since we know a core implements IEmulatorService
Services.Add(core.GetType(), core);
foreach (var service in core.GetType().GetNestedTypes(BindingFlags.Public)
.Where(t => typeof(IEmulatorService).IsAssignableFrom(t))
.Where(t => t.IsClass))