Добавлены методы сортировки

This commit is contained in:
Никита Потапов 2023-12-16 23:28:08 +04:00
parent 85829c9c39
commit 44887378b2
2 changed files with 11 additions and 1 deletions

View File

@ -49,6 +49,11 @@ namespace ProjectStormtrooper
_collection = new SetGeneric<T>(horizontalObjectsCount * verticalObjectsCount);
}
/// <summary>
/// Сортировка
/// </summary>
/// <param name="comparer"></param>
public void Sort(IComparer<T?> comparer) => _collection.SortSet(comparer);
/// <summary>
/// Перегрузка оператора сложения
/// </summary>
/// <param name="collect"></param>
@ -60,7 +65,7 @@ namespace ProjectStormtrooper
{
return -1;
}
return collect?._collection.Insert(obj) ?? -1;
return collect?._collection.Insert(obj, new DrawingPlaneEqutables()) ?? -1;
}
/// <summary>
/// Перегрузка оператора вычитания

View File

@ -34,6 +34,11 @@ namespace ProjectStormtrooper
_places = new List<T?>(count);
}
/// <summary>
/// Сортировка набора объектов
/// </summary>
/// <param name="comparer"></param>
public void SortSet(IComparer<T?> comparer) => _places.Sort(comparer);
/// <summary>
/// Добавления объекта в набор
/// </summary>
/// <param name="plane"></param>