diff --git a/Lab/CarsGenericCollection.cs b/Lab/CarsGenericCollection.cs index da5024b..958a110 100644 --- a/Lab/CarsGenericCollection.cs +++ b/Lab/CarsGenericCollection.cs @@ -35,7 +35,7 @@ namespace Lab.Generics { return false; } - return (bool)collect?._collection.Insert(obj); + return (bool)collect?._collection.Insert(obj, new DrawiningTankerEqutables()); } public static T? operator -(CarsGenericCollection collect, int pos) { diff --git a/Lab/TankerCompareByColor.cs b/Lab/TankerCompareByColor.cs index c22c9a7..3d2c0d2 100644 --- a/Lab/TankerCompareByColor.cs +++ b/Lab/TankerCompareByColor.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Lab.DrawningObjects; +using Lab.Entities; namespace Lab { @@ -23,6 +24,10 @@ namespace Lab { return x._gasolineTanker.BodyColor.Name.CompareTo(y._gasolineTanker.BodyColor.Name); } + if (x.GetType() == y.GetType() && x is DrawGasolineTanker) + { + return (x._gasolineTanker as GasolineTanker).AdditionalColor.Name.CompareTo((y._gasolineTanker as GasolineTanker).AdditionalColor.Name); + } var speedCompare = x._gasolineTanker.Speed.CompareTo(y._gasolineTanker.Speed); if (speedCompare != 0) {