ColorUpdate

This commit is contained in:
Sergey Kozyrev 2023-12-19 18:33:50 +04:00
parent 7159bf359b
commit c6eb4525d9
2 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ namespace Lab.Generics
{ {
return false; return false;
} }
return (bool)collect?._collection.Insert(obj); return (bool)collect?._collection.Insert(obj, new DrawiningTankerEqutables());
} }
public static T? operator -(CarsGenericCollection<T, U> collect, int pos) public static T? operator -(CarsGenericCollection<T, U> collect, int pos)
{ {

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Lab.DrawningObjects; using Lab.DrawningObjects;
using Lab.Entities;
namespace Lab namespace Lab
{ {
@ -23,6 +24,10 @@ namespace Lab
{ {
return x._gasolineTanker.BodyColor.Name.CompareTo(y._gasolineTanker.BodyColor.Name); 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); var speedCompare = x._gasolineTanker.Speed.CompareTo(y._gasolineTanker.Speed);
if (speedCompare != 0) if (speedCompare != 0)
{ {