ready lab 8 for pul request
This commit is contained in:
parent
af1f332edc
commit
58521edbd2
@ -15,15 +15,19 @@ namespace ProjectElectricLocomotive
|
|||||||
|
|
||||||
if (x == null || x.EntityLocomotive == null)
|
if (x == null || x.EntityLocomotive == null)
|
||||||
throw new NotImplementedException(nameof(x));
|
throw new NotImplementedException(nameof(x));
|
||||||
|
|
||||||
if (y == null || y.EntityLocomotive == null)
|
if (y == null || y.EntityLocomotive == null)
|
||||||
throw new NotImplementedException(nameof(y));
|
throw new NotImplementedException(nameof(y));
|
||||||
|
|
||||||
var bodyColor = x.EntityLocomotive.BodyColor.Name.CompareTo(y.EntityLocomotive.BodyColor.Name);
|
var bodyColor = x.EntityLocomotive.BodyColor.Name.CompareTo(y.EntityLocomotive.BodyColor.Name);
|
||||||
|
|
||||||
if (bodyColor != 0) return bodyColor;
|
if (bodyColor != 0) return bodyColor;
|
||||||
if(x.EntityLocomotive is EntityElectricLocomotive xEntityElectricLocomotive &&
|
|
||||||
y.EntityLocomotive is EntityElectricLocomotive yEntityElectricLocomotive)
|
if(x.EntityLocomotive is EntityElectricLocomotive &&
|
||||||
|
y.EntityLocomotive is EntityElectricLocomotive)
|
||||||
{
|
{
|
||||||
var addcolor = (x.EntityLocomotive as EntityElectricLocomotive).AdditionalColor.Name.CompareTo(
|
var addcolor = (x.EntityLocomotive as EntityElectricLocomotive).AdditionalColor.Name.CompareTo((y.EntityLocomotive
|
||||||
(y.EntityLocomotive as EntityElectricLocomotive).AdditionalColor.Name);
|
as EntityElectricLocomotive).AdditionalColor.Name);
|
||||||
if(addcolor != 0) return addcolor;
|
if(addcolor != 0) return addcolor;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -11,7 +11,6 @@ namespace ProjectElectricLocomotive.Generics
|
|||||||
{
|
{
|
||||||
internal class LocomotiveGenericStorage
|
internal class LocomotiveGenericStorage
|
||||||
{
|
{
|
||||||
|
|
||||||
//create lab 7
|
//create lab 7
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Словарь (хранилище)
|
/// Словарь (хранилище)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user