public PlatformContext(IMemoryManager memoryManager, ICullingController cullingController, IClipboard clipboard, IPhysicsSyncController physicsSyncController, IParcelScenesCleaner parcelScenesCleaner, IDebugController debugController) { this.memoryManager = memoryManager; this.cullingController = cullingController; this.clipboard = clipboard; this.physicsSyncController = physicsSyncController; this.parcelScenesCleaner = parcelScenesCleaner; this.debugController = debugController; }
public static PlatformContext CreateWithCustomMocks( IMemoryManager memoryManager = null, ICullingController cullingController = null, IClipboard clipboard = null, IPhysicsSyncController physicsSyncController = null, IParcelScenesCleaner parcelScenesCleaner = null, IDebugController debugController = null) { return(new PlatformContext( memoryManager: memoryManager ?? Substitute.For <IMemoryManager>(), cullingController: cullingController ?? Substitute.For <ICullingController>(), clipboard: clipboard ?? Substitute.For <IClipboard>(), physicsSyncController: physicsSyncController ?? Substitute.For <IPhysicsSyncController>(), parcelScenesCleaner: parcelScenesCleaner ?? Substitute.For <ParcelScenesCleaner>(), debugController: debugController ?? Substitute.For <IDebugController>())); }
/// <summary> /// Setup the debugger after an instance has been started. /// </summary> public void OnInstanceStarted() { this.Emulator.AttachDebugger(); IEmulationInstance emu = this.Emulator.CurrentInstance; List <IHook> hooks = new List <IHook>(); foreach (IComponentInstance instance in emu.Components) { IDebuggable debuggable = instance as IDebuggable; if (debuggable == null) { continue; } if (debuggable.SupportsDebugging == false) { Debug.WriteLine(string.Format("Debugger: {0} does not support debugging", instance.Factory.Name)); continue; } debuggable.EnableDebugging(); hooks.Add(debuggable.DebugHook); if (debuggable.DebugHook is IBiosHook) { this.BiosHook = ( IBiosHook )debuggable.DebugHook; } else if (debuggable.DebugHook is ICpuHook) { this.CpuHook = ( ICpuHook )debuggable.DebugHook; } else if (debuggable.DebugHook is IVideoHook) { this.VideoHook = ( IVideoHook )debuggable.DebugHook; } } _hooks = hooks.ToArray(); this.Controller = emu.Cpu.DebugController; if (_isAttached == false) { return; } _client.OnStarted(emu.Bios.Game, emu.Bios.BootStream); }
public PlatformContext(IMemoryManager memoryManager, ICullingController cullingController, IClipboard clipboard, IPhysicsSyncController physicsSyncController, IParcelScenesCleaner parcelScenesCleaner, IDebugController debugController, IWebRequestController webRequest, IServiceProviders serviceProviders) { this.memoryManager = memoryManager; this.cullingController = cullingController; this.clipboard = clipboard; this.physicsSyncController = physicsSyncController; this.parcelScenesCleaner = parcelScenesCleaner; this.debugController = debugController; this.webRequest = webRequest; this.serviceProviders = serviceProviders; }
public static PlatformContext CreateWithCustomMocks( IMemoryManager memoryManager = null, ICullingController cullingController = null, IClipboard clipboard = null, IPhysicsSyncController physicsSyncController = null, IParcelScenesCleaner parcelScenesCleaner = null, IDebugController debugController = null, IWebRequestController webRequestController = null, IServiceProviders serviceProviders = null) { return(new PlatformContext( memoryManager: memoryManager ?? Substitute.For <IMemoryManager>(), cullingController: cullingController ?? Substitute.For <ICullingController>(), clipboard: clipboard ?? Substitute.For <IClipboard>(), physicsSyncController: physicsSyncController ?? Substitute.For <IPhysicsSyncController>(), parcelScenesCleaner: parcelScenesCleaner ?? Substitute.For <ParcelScenesCleaner>(), debugController: debugController ?? Substitute.For <IDebugController>(), webRequest: webRequestController ?? GetWebRequestControllerMock(), serviceProviders: serviceProviders ?? GetServiceProvidersMock())); }
public static PlatformContext CreateWithGenericMocks(params object[] mocks) { IMemoryManager memoryManager = Substitute.For <IMemoryManager>(); ICullingController cullingController = Substitute.For <ICullingController>(); IParcelScenesCleaner parcelScenesCleaner = Substitute.For <IParcelScenesCleaner>(); IClipboard clipboard = Substitute.For <IClipboard>(); IPhysicsSyncController physicsSyncController = Substitute.For <IPhysicsSyncController>(); IDebugController debugController = Substitute.For <IDebugController>(); IWebRequestController webRequest = Substitute.For <IWebRequestController>(); IServiceProviders serviceProviders = Substitute.For <IServiceProviders>(); IIdleChecker idleChecker = Substitute.For <IIdleChecker>(); IAvatarsLODController avatarsLODController = Substitute.For <IAvatarsLODController>(); foreach (var mock in mocks) { switch (mock) { case ICullingController cc: cullingController = cc; break; case IMemoryManager mm: memoryManager = mm; break; case IClipboard c: clipboard = c; break; case IPhysicsSyncController psc: physicsSyncController = psc; break; case IParcelScenesCleaner pscc: parcelScenesCleaner = pscc; break; case IDebugController dc: debugController = dc; break; case IWebRequestController wrc: webRequest = wrc; break; case IServiceProviders sp: serviceProviders = sp; break; case IIdleChecker idl: idleChecker = idl; break; case IAvatarsLODController alodc: avatarsLODController = alodc; break; } } return(new PlatformContext(memoryManager, cullingController, clipboard, physicsSyncController, parcelScenesCleaner, debugController, webRequest, serviceProviders, idleChecker, avatarsLODController)); }
/// <summary> /// Setup the debugger after an instance has been started. /// </summary> public void OnInstanceStarted() { this.Emulator.AttachDebugger(); IEmulationInstance emu = this.Emulator.CurrentInstance; List<IHook> hooks = new List<IHook>(); foreach( IComponentInstance instance in emu.Components ) { IDebuggable debuggable = instance as IDebuggable; if( debuggable == null ) continue; if( debuggable.SupportsDebugging == false ) { Debug.WriteLine( string.Format( "Debugger: {0} does not support debugging", instance.Factory.Name ) ); continue; } debuggable.EnableDebugging(); hooks.Add( debuggable.DebugHook ); if( debuggable.DebugHook is IBiosHook ) this.BiosHook = ( IBiosHook )debuggable.DebugHook; else if( debuggable.DebugHook is ICpuHook ) this.CpuHook = ( ICpuHook )debuggable.DebugHook; else if( debuggable.DebugHook is IVideoHook ) this.VideoHook = ( IVideoHook )debuggable.DebugHook; } _hooks = hooks.ToArray(); this.Controller = emu.Cpu.DebugController; if( _isAttached == false ) return; _client.OnStarted( emu.Bios.Game, emu.Bios.BootStream ); }