Беда не приходит одна, но и удача тоже.

— Ромен Роллан, французский писатель
This commit is contained in:
gg12 darfren 2023-12-12 12:44:12 +04:00
parent a89cb3e112
commit 4a64cc1bb5

View File

@ -18,9 +18,9 @@ namespace Monorail.Generics
if (y == null || y.EntityMonorail == null)
throw new ArgumentNullException(nameof(y));
if (x.EntityMonorail.BodyColor.GetBrightness() != y.EntityMonorail.BodyColor.GetBrightness())
if (x.EntityMonorail.BodyColor.Name != y.EntityMonorail.BodyColor.Name)
{
return x.EntityMonorail.BodyColor.GetBrightness().CompareTo(y.EntityMonorail.BodyColor.GetBrightness());
return x.EntityMonorail.BodyColor.Name.CompareTo(y.EntityMonorail.BodyColor.Name);
}
if (x.GetType().Name != y.GetType().Name)
{
@ -33,9 +33,9 @@ namespace Monorail.Generics
{
EntityLocomotive EntityX = (EntityLocomotive)x.EntityMonorail;
EntityLocomotive EntityY = (EntityLocomotive)y.EntityMonorail;
if(EntityX.AdditionalColor.GetBrightness() != EntityY.AdditionalColor.GetBrightness())
if(EntityX.AdditionalColor.Name != EntityY.AdditionalColor.Name)
{
return EntityX.AdditionalColor.GetBrightness().CompareTo(EntityY.AdditionalColor.GetBrightness());
return EntityX.AdditionalColor.Name.CompareTo(EntityY.AdditionalColor.Name);
}
}
var speedCompare = x.EntityMonorail.Speed.CompareTo(y.EntityMonorail.Speed);