fixed bug with Remove
This commit is contained in:
parent
62a9296290
commit
3a6d87df27
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user