Лаб3
This commit is contained in:
parent
e85221a51b
commit
b66c25c7ab
@ -149,7 +149,7 @@
|
||||
buttonSelectTruck.Name = "buttonSelectTruck";
|
||||
buttonSelectTruck.Size = new Size(110, 43);
|
||||
buttonSelectTruck.TabIndex = 9;
|
||||
buttonSelectTruck.Text = "button1";
|
||||
buttonSelectTruck.Text = "Выбрать";
|
||||
buttonSelectTruck.UseVisualStyleBackColor = true;
|
||||
buttonSelectTruck.Click += buttonSelectTruck_Click;
|
||||
//
|
||||
|
@ -52,7 +52,7 @@ namespace Project_DumpTruck
|
||||
return;
|
||||
}
|
||||
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
|
||||
if (_trucks - pos != null)
|
||||
if (_trucks - pos)
|
||||
{
|
||||
MessageBox.Show("Объект удален");
|
||||
pictureBoxCollection.Image = _trucks.ShowTrucks();
|
||||
|
@ -66,14 +66,14 @@ namespace Project_DumpTruck.Generics
|
||||
/// <param name="collect"></param>
|
||||
/// <param name="pos"></param>
|
||||
/// <returns></returns>
|
||||
public static T? operator -(TrucksGenericCollection<T, U> collect, int pos)
|
||||
public static bool operator -(TrucksGenericCollection<T, U> collect, int pos)
|
||||
{
|
||||
T? obj = collect._collection.Get(pos);
|
||||
if (obj != null)
|
||||
{
|
||||
collect._collection.Remove(pos);
|
||||
return collect._collection.Remove(pos);
|
||||
}
|
||||
return obj;
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Получение объекта IMoveableObject
|
||||
@ -123,7 +123,6 @@ namespace Project_DumpTruck.Generics
|
||||
private void DrawObjects(Graphics g)
|
||||
{
|
||||
int width = _pictureWidth / _placeSizeWidth;
|
||||
int height = _pictureHeight / _placeSizeHeight;
|
||||
|
||||
for (int i = 0; i < _collection.Count; i++)
|
||||
{
|
||||
@ -133,7 +132,7 @@ namespace Project_DumpTruck.Generics
|
||||
DrawningTruck? truck = _collection.Get(i);
|
||||
if (truck == null)
|
||||
continue;
|
||||
truck.SetPosition(i % width * _placeSizeWidth, i / height * _placeSizeHeight);
|
||||
truck.SetPosition(i % width * _placeSizeWidth, i / width * _placeSizeHeight);
|
||||
truck.DrawTransport(g);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user