static void Main(string[] args) { Engine engine = new Engine(); Accumulator accumulator = new Accumulator(); FuelPump fuelPump = new FuelPump(); Car car = new Car(engine, accumulator, fuelPump); CarDriver carDriver = new CarDriver(car); carDriver.StartCar(); Console.WriteLine(new string('-', 30)); carDriver.StopCar(); Console.ReadKey(); }
public Car(Engine engine, Accumulator accumulator, FuelPump fuelPump) { _engine = engine; _accumulator = accumulator; _fuelPump = fuelPump; }