/// <summary> /// Initializes a new instance of the <see cref="C8Engine"/> class. /// Engine constructor with an injected machine state /// </summary> /// <param name="machineState"> /// An injected machine state /// </param> /// <param name="pluginService"> /// The plugin Service. /// </param> /// <param name="configurationService"> /// The configuration Service. /// </param> /// <param name="romService"> /// The rom Service. /// </param> /// <param name="opcodeMapService"> /// The opcode Map Service. /// </param> public C8Engine( IMachineState machineState, IPluginService pluginService, IConfigurationService configurationService, IRomService romService, IOpcodeMapService opcodeMapService) { // Injects the machine state this.machineState = machineState; // Inject the plugin service this.PluginService = pluginService; // Inject the configuration service this.ConfigurationService = configurationService; // Inject the ROM Service this.RomService = romService; // Inject the opcode map service this.OpcodeMapService = opcodeMapService; // Gets the instruction map this.instructionMap = this.OpcodeMapService.GetInstructionMap(); // Loads the user saved configuration this.LoadSavedEngineSettings(); // Loads the plugins this.LoadPlugins(); }
/// <summary> /// Initializes a new instance of the <see cref="EngineMediator"/> class. /// </summary> /// <param name="machineState"> /// The machine State. /// </param> /// <param name="executionEngine"> /// The execution engine. /// </param> /// <param name="inputOutputEngine"> /// The input output engine. /// </param> /// <param name="configurationEngine"> /// The configuration engine. /// </param> /// <param name="romService"> /// The rom service. /// </param> public EngineMediator( IMachineState machineState, IExecutionEngine executionEngine, IInputOutputEngine inputOutputEngine, IConfigurationEngine configurationEngine, IRomService romService) { this.MachineState = machineState; this.ExecutionEngine = executionEngine; this.InputOutputEngine = inputOutputEngine; this.ConfigurationEngine = configurationEngine; this.RomService = romService; // Assign the mediator to the engines, avoiding circular dependency with IoC this.ExecutionEngine.SetMediator(this); this.InputOutputEngine.SetMediator(this); this.ConfigurationEngine.SetMediator(this); }
public RomsController(IRomService romService, IFileService fileService) { RomService = romService; FileService = fileService; }