type sort fix and small name fix

This commit is contained in:
NikGapon 2022-12-08 19:51:28 +04:00
parent a617fa1730
commit a09e502cd7
3 changed files with 11 additions and 7 deletions

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
{