From 504798d4c4853a3db22a25ff6cf613a36640f1c3 Mon Sep 17 00:00:00 2001 From: kaznacheeva Date: Wed, 25 Oct 2023 09:55:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Battleship/Battleship/SetGeneric.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Battleship/Battleship/SetGeneric.cs b/Battleship/Battleship/SetGeneric.cs index 8047a61..29da7ea 100644 --- a/Battleship/Battleship/SetGeneric.cs +++ b/Battleship/Battleship/SetGeneric.cs @@ -6,10 +6,7 @@ using System.Threading.Tasks; namespace Battleship.Generics { - /// - /// Параметризованный набор объектов - /// - /// + internal class SetGeneric where T : class { @@ -36,7 +33,6 @@ namespace Battleship.Generics /// public int Insert(T ship) { - // TODO вставка в начало набора if (_places[Count - 1] != null) return -1; return Insert(ship,0); @@ -49,11 +45,6 @@ namespace Battleship.Generics /// public int Insert(T ship, int position) { - // TODO проверка позиции - // TODO проверка, что элемент массива по этой позиции пустой, если нет, то - // проверка, что после вставляемого элемента в массиве есть пустой элемент - // сдвиг всех объектов, находящихся справа от позиции до первого пустого элемента - // TODO вставка по позиции_places[position] = car; if (!(position >= 0 && position < Count)) return -1; if (_places[position] != null) @@ -76,8 +67,6 @@ namespace Battleship.Generics /// public bool Remove(int position) { - // TODO проверка позиции - // TODO удаление объекта из массива, присвоив элементу массива значение null if (!(position >= 0 && position < Count) || _places[position] == null) return false; _places[position] = null; @@ -90,7 +79,6 @@ namespace Battleship.Generics /// public T? Get(int position) { - // TODO проверка позиции if (!(position >= 0 && position < Count)) return null; return _places[position];