Agliullov D. A. Lab Work 8 Advanced #9
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user