diff --git a/Airbus/Airbus/AirplaneCompareByColor.cs b/Airbus/Airbus/AirplaneCompareByColor.cs index 82a073d..83d2f4d 100644 --- a/Airbus/Airbus/AirplaneCompareByColor.cs +++ b/Airbus/Airbus/AirplaneCompareByColor.cs @@ -42,11 +42,11 @@ namespace Airbus { return xAirplaneColor.CompareTo(yAirplaneColor); } - if (xAirplane.GetAirplane.airplane is EntityAirbus xContainerShip && yAirplane.GetAirplane.airplane is EntityAirbus yContainerShip) + if (xAirplane.GetAirplane.airplane is EntityAirbus xAirbus && yAirplane.GetAirplane.airplane is EntityAirbus yAirbus) { - string xShipDopColor = xContainerShip.DopColor.Name; - string yShipDopColor = yContainerShip.DopColor.Name; - var dopColorCompare = xShipDopColor.CompareTo(yShipDopColor); + string xAirplaneDopColor = xAirbus.DopColor.Name; + string yAirplaneDopColor = yAirbus.DopColor.Name; + var dopColorCompare = xAirplaneDopColor.CompareTo(yAirplaneDopColor); if (dopColorCompare != 0) { return dopColorCompare; diff --git a/Airbus/Airbus/DrawningObjectAirplane.cs b/Airbus/Airbus/DrawningObjectAirplane.cs index cf2c6d1..7f5ff50 100644 --- a/Airbus/Airbus/DrawningObjectAirplane.cs +++ b/Airbus/Airbus/DrawningObjectAirplane.cs @@ -49,6 +49,10 @@ namespace Airbus } var airplane = _airplane.airplane; var otherAirplaneAirplane = otherAirplane._airplane.airplane; + if (airplane.GetType() != otherAirplaneAirplane.GetType()) + { + return false; + } if (airplane.Speed != otherAirplaneAirplane.Speed) { return false; diff --git a/Airbus/Airbus/SetAirplaneGeneric.cs b/Airbus/Airbus/SetAirplaneGeneric.cs index 82104a2..da02b91 100644 --- a/Airbus/Airbus/SetAirplaneGeneric.cs +++ b/Airbus/Airbus/SetAirplaneGeneric.cs @@ -72,11 +72,11 @@ namespace Airbus } public IEnumerable GetAirplanes() { - foreach (var car in _places) + foreach (var airplane in _places) { - if (car != null) + if (airplane != null) { - yield return car; + yield return airplane; } else {