fixed bug with Remove

This commit is contained in:
Nikita Potapov 2022-11-26 20:57:51 +04:00
parent 62a9296290
commit 3a6d87df27
2 changed files with 2 additions and 4 deletions

View File

@ -91,7 +91,6 @@ namespace Boats
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics g = Graphics.FromImage(bmp);
DrawBackground(g);
Shaking();
DrawBoats(g);
return bmp;
}
@ -136,8 +135,8 @@ namespace Boats
var boat = _setBoats[j];
if (boat != null)
{
boat = _setBoats.Remove(j);
_setBoats.Insert(boat, i);
_setBoats.Remove(j);
break;
}
}

View File

@ -74,8 +74,7 @@ namespace Boats
if (Count == 0 || position < 0 || position >= _maxCount || _places[position] == null)
throw new BoatNotFoundException(position);
T boat = _places[position];
_places[position] = null;
_places.RemoveAt(position);
return boat;
}
public T this[int position]