x
This commit is contained in:
parent
cb2629af90
commit
3ff0237fe7
@ -46,15 +46,15 @@ namespace ProjectTrain
|
||||
/// <summary>
|
||||
/// Добавление самолета в коллекцию
|
||||
/// </summary>
|
||||
/// <param name="plane"></param>
|
||||
private void SetTrain(DrawningTrain? plane)
|
||||
/// <param name="train"></param>
|
||||
private void SetTrain(DrawningTrain? train)
|
||||
{
|
||||
if (_company == null || plane == null)
|
||||
if (_company == null || train == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_company + plane != -1)
|
||||
if (_company + train != -1)
|
||||
{
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBoxTrain.Image = _company.Show();
|
||||
@ -100,24 +100,24 @@ namespace ProjectTrain
|
||||
return;
|
||||
}
|
||||
|
||||
DrawningTrain? plane = null;
|
||||
DrawningTrain? train = null;
|
||||
int counter = 100;
|
||||
while (plane == null)
|
||||
while (train == null)
|
||||
{
|
||||
plane = _company.GetRandomObject();
|
||||
train = _company.GetRandomObject();
|
||||
counter--;
|
||||
if (counter <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (plane == null)
|
||||
if (train == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
FormTrain form = new()
|
||||
{
|
||||
SetTrain = plane
|
||||
SetTrain = train
|
||||
};
|
||||
form.ShowDialog();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user