изменения
This commit is contained in:
parent
974fa03ade
commit
319fa1298d
@ -53,7 +53,7 @@ MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
|
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
|
||||||
if (_ships - pos != null)
|
if (!(_ships - pos))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект удален");
|
MessageBox.Show("Объект удален");
|
||||||
pictureBoxCollection.Image = _ships.ShowShips();
|
pictureBoxCollection.Image = _ships.ShowShips();
|
||||||
|
@ -67,15 +67,15 @@ namespace Lab1ContainersShip
|
|||||||
/// <param name="collect"></param>
|
/// <param name="collect"></param>
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static T operator -(ShipGenericCollection<T, U> collect, int
|
public static bool operator -(ShipGenericCollection<T, U> collect, int
|
||||||
pos)
|
pos)
|
||||||
{
|
{
|
||||||
T obj = collect._collection.Get(pos);
|
T obj = collect._collection.Get(pos);
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
collect._collection.Remove(pos);
|
return collect._collection.Remove(pos);
|
||||||
}
|
}
|
||||||
return obj;
|
return false;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Получение объекта IMoveableObject
|
/// Получение объекта IMoveableObject
|
||||||
|
Loading…
Reference in New Issue
Block a user