чуть чуть исправила, думаю готово

This commit is contained in:
Казначеева Елизавета 2023-11-05 23:44:22 +04:00
parent 7686622b37
commit 7eaadef863

View File

@ -40,9 +40,9 @@ namespace Battleship.Generics
} }
public bool Remove(int position) public bool Remove(int position)
{ {
if (!(position >= 0 && position < Count)) if (position < 0 || position >= Count)
return false; return false;
_places[position] = null; _places.RemoveAt(position);
return true; return true;
} }
public T? this[int position] public T? this[int position]