так
This commit is contained in:
parent
0613fd9196
commit
63fda8d93d
@ -124,7 +124,7 @@ namespace WarmlyShip
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
||||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos == 1)
|
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект удален");
|
MessageBox.Show("Объект удален");
|
||||||
pictureBox.Image =
|
pictureBox.Image =
|
||||||
|
@ -32,7 +32,7 @@ namespace WarmlyShip
|
|||||||
return map._setShips.Insert(ship);
|
return map._setShips.Insert(ship);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int operator -(MapWithSetShipGeneric<T, U> map, int position)
|
public static T operator -(MapWithSetShipGeneric<T, U> map, int position)
|
||||||
{
|
{
|
||||||
return map._setShips.Remove(position);
|
return map._setShips.Remove(position);
|
||||||
}
|
}
|
||||||
|
@ -27,15 +27,16 @@ namespace WarmlyShip
|
|||||||
|
|
||||||
public int Insert(T ship, int position)
|
public int Insert(T ship, int position)
|
||||||
{
|
{
|
||||||
if (position < 0 || position > Count || Count == _maxCount) return 0;
|
if (position < 0 || position > Count || Count == _maxCount) return -1;
|
||||||
_places.Insert(position, ship);
|
_places.Insert(position, ship);
|
||||||
return 1;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Remove(int position)
|
public T Remove(int position)
|
||||||
{
|
{
|
||||||
|
T DelElement = _places[position];
|
||||||
_places[position] = null;
|
_places[position] = null;
|
||||||
return 1;
|
return DelElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T this[int position]
|
public T this[int position]
|
||||||
|
Loading…
Reference in New Issue
Block a user