Лёвушкина Анна, ПИбд-21, лаб3 простая #6

Closed
AnnaLioness wants to merge 8 commits from лаб3 into лаб2
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 319fa1298d - Show all commits

View File

@ -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();

View File

@ -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