Ievlewa_lab8_Base #8

Closed
chtzsch wants to merge 3 commits from lab_8 into lab_7
2 changed files with 5 additions and 9 deletions
Showing only changes of commit e544555b7b - Show all commits

View File

@ -25,13 +25,6 @@ namespace speed_Boat.Generics
{
return x._entityBoat.MainColor.Name.CompareTo(y._entityBoat.MainColor.Name);
}
if(x.GetType().Name != y.GetType().Name)
{
if (x is DrawingBoat)
return -1;
else
return 1;
}
if(x.GetType().Name == y.GetType().Name && x is DrawingSpeedBoat)
{
EntitySpeedboat _speedboatX = (EntitySpeedboat)x._entityBoat;

View File

@ -18,11 +18,14 @@ namespace speed_Boat.Generics
public bool Equals(BoatsCollectionInfo? other)
{
// TODO прописать логику сравнения по свойству Name
return Name == other.Name;
if (Name == other?.Name)
return true;
return false;
}
public override int GetHashCode()
{
return this.Name.GetHashCode();
return Name.GetHashCode();
}
}
}