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)
throw new NotImplementedException(nameof(x));
if (y == null || y.EntityLocomotive == null)
throw new NotImplementedException(nameof(y));
var bodyColor = x.EntityLocomotive.BodyColor.Name.CompareTo(y.EntityLocomotive.BodyColor.Name);
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(
(y.EntityLocomotive as EntityElectricLocomotive).AdditionalColor.Name);
var addcolor = (x.EntityLocomotive as EntityElectricLocomotive).AdditionalColor.Name.CompareTo((y.EntityLocomotive
as EntityElectricLocomotive).AdditionalColor.Name);
if(addcolor != 0) return addcolor;
}
return 1;

View File

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