public EngineEmulator(ExternalSystems systems) { _systems = systems; GasPressure = new PedalPressure(0); BrakePressure = new PedalPressure(0); CurrentGear = new Gear(0); Task.Run(Run); }
private static ExternalSystems SetUpExternalSystems() { var externalSystems = new ExternalSystems { CurrentRpm = 6000d, }; externalSystems.Lights.SetPosition(3); return(externalSystems); }
private static void SetupSystem(IEventBus eventBus) { _externalSystems = new ExternalSystems(); var externalSystemsAdapter = new ExternalSystemsAdapter(_externalSystems); var gearbox = new Gearbox(); var gearboxAdapter = new GearboxAdapter(gearbox); var automaticGearshifter = new AutomaticGearshifter(gearboxAdapter); eventBus.Attach(new EventLogger()); eventBus.Attach(new EngineEmulator(_externalSystems)); new AntiCorruptionLayerStartup(eventBus, externalSystemsAdapter, gearbox).Start(); new GearshiftStartup(eventBus, automaticGearshifter).Start(); new ProcessesStartup(eventBus, new GearshiftService(new Negotiator(), automaticGearshifter), new EngineCharacteristics(), new KickdownCharacteristics()).Start(); TimeHelper.WaitSeconds(3); }
public ExternalSystemsFacade(ExternalSystems externalSystems, SoundModule soundModule) { _externalSystems = externalSystems ?? throw new ArgumentNullException(nameof(externalSystems)); _soundModule = soundModule ?? throw new ArgumentNullException(nameof(soundModule)); }
public ExternalSystemsAdapter(ExternalSystems externalSystems) { _externalSystems = externalSystems; }