public Engine(int engine_number) { _itsEngineNumber = engine_number; _itsCompressor = new Compressor(PartStatus.WORKING, _itsEngineNumber); _itsFuelPump = new FuelPump(PartStatus.WORKING, _itsEngineNumber); _itsOilPump = new OilPump(PartStatus.WORKING, _itsEngineNumber); _itsOxygenSensor = new OxygenSensor(PartStatus.WORKING, _itsEngineNumber); _itsTemperatureSensor = new TemperatureSensor(PartStatus.WORKING, _itsEngineNumber); _itsStatus = PartStatus.WORKING; Console.WriteLine("Engine #" + _itsEngineNumber + " created!"); }
public Engine(int engineNumber){ _engineNumber = engineNumber; _isRunning = false; _itsParts = new EnginePart[6]; _itsParts[0] = new Compressor(PartStatus.WORKING, EngineNumber); _itsParts[1] = new FuelPump(PartStatus.WORKING, _engineNumber); _itsParts[2] = new OilPump(PartStatus.WORKING, _engineNumber); _itsParts[3] = new WaterPump(PartStatus.WORKING, _engineNumber); _itsParts[4] = new OxygenSensor(PartStatus.WORKING, _engineNumber); _itsParts[5] = new TemperatureSensor(PartStatus.WORKING, _engineNumber); Console.WriteLine("Engine number {0} created", _engineNumber); }