Lab8 KozyrevSS PIbd-21 GasolineTanker #9

Closed
Serxionaft wants to merge 2 commits from Laba8 into Laba7
2 changed files with 6 additions and 1 deletions
Showing only changes of commit c6eb4525d9 - Show all commits

View File

@ -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<T, U> collect, int pos)
{

View File

@ -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)
{