Agliullov D. A. Lab Work 8 Advanced #9

Merged
eegov merged 8 commits from Lab8 into Lab7 2022-11-07 11:34:02 +04:00
Showing only changes of commit 8c6ce67917 - Show all commits

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace AirBomber
{
internal class MapWithSetAirplanesGeneric<T, U>
internal class MapWithSetAirplanesGeneric<T, U> : IComparable<MapWithSetAirplanesGeneric<T, U>>
where T : class, IEquatable<T>, IDrawningObject
where U : AbstractMap
{
@ -214,5 +214,18 @@ namespace AirBomber
{
SetAirplanes.SortSet(comparer);
}
public int CompareTo(MapWithSetAirplanesGeneric<T, U>? other)
{
if (other == null)
{
return 1;
}
if (this == other)
{
return 0;
}
return SetAirplanes.Count.CompareTo(other.SetAirplanes.Count);
}
}
}