ready lab 8 for pul request

This commit is contained in:
ekallin 2023-12-19 14:25:00 +04:00
parent af1f332edc
commit 58521edbd2
2 changed files with 9 additions and 6 deletions

View File

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

View File

@ -9,9 +9,8 @@ using ProjectElectricLocomotive.MovementStrategy;
namespace ProjectElectricLocomotive.Generics namespace ProjectElectricLocomotive.Generics
{ {
internal class LocomotiveGenericStorage internal class LocomotiveGenericStorage
{ {
//create lab 7 //create lab 7
/// <summary> /// <summary>
/// Словарь (хранилище) /// Словарь (хранилище)