Eliseev E.E. LabWork08 #9

Closed
ElEgEv wants to merge 8 commits from LabWork08 into LabWork07
2 changed files with 24 additions and 14 deletions
Showing only changes of commit 519ba5ef7a - Show all commits

View File

@ -75,7 +75,7 @@ namespace Airbus
return false;
}
if(plane.CorpusColor != otherPlanePlane.CorpusColor)
if (plane.CorpusColor != otherPlanePlane.CorpusColor)
{
return false;
}

View File

@ -43,26 +43,36 @@ namespace Airbus
return 1;
}
if(xPlane.GetPlane.Airbus.Speed != yPlane.GetPlane.Airbus.Speed)
{
return 1;
}
if (xPlane.GetPlane.Airbus.Weight != yPlane.GetPlane.Airbus.Weight)
{
return 1;
}
var xEntity = xPlane.GetPlane.Airbus;
var yEntity = yPlane.GetPlane.Airbus;
var colorCompare = xEntity.CorpusColor.Name.CompareTo(yEntity.CorpusColor.Name);
var colorCompare = xEntity.CorpusColor.ToArgb().CompareTo(yEntity.CorpusColor.ToArgb());
if (colorCompare != 0 || xEntity is not EntitySuperAirbus xEntityAirbus || yEntity is not EntitySuperAirbus yEntityAirbus)
int i = xEntity.CorpusColor.ToArgb();
int j = yEntity.CorpusColor.ToArgb();
if (colorCompare != 0)
{
return colorCompare;
}
return xEntityAirbus.AddColor.Name.CompareTo(yEntityAirbus.AddColor.Name);
if (xEntity is EntitySuperAirbus xEntityAirbus && yEntity is EntitySuperAirbus yEntityAirbus)
{
var addColorCompare = xEntityAirbus.AddColor.ToArgb().CompareTo(yEntityAirbus.AddColor.ToArgb());
if(addColorCompare != 0)
{
return addColorCompare;
}
}
var speedCompare = xPlane.GetPlane.Airbus.Speed.CompareTo(yPlane.GetPlane.Airbus.Speed);
if (speedCompare != 0)
{
return speedCompare;
}
return xPlane.GetPlane.Airbus.Weight.CompareTo(yPlane.GetPlane.Airbus.Weight);
}
}
}