ISEbd-21 Nikolay Gapon LabWork08 #13

Closed
NikGapon wants to merge 4 commits from LabWork08 into LabWork07
3 changed files with 11 additions and 7 deletions
Showing only changes of commit a09e502cd7 - Show all commits

View File

@ -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;

View File

@ -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;

View File

@ -72,11 +72,11 @@ namespace Airbus
}
public IEnumerable<T> GetAirplanes()
{
foreach (var car in _places)
foreach (var airplane in _places)
{
if (car != null)
if (airplane != null)
{
yield return car;
yield return airplane;
}
else
{