Замена автомобиля на самолет
This commit is contained in:
parent
b53a7d4689
commit
710e7086b9
@ -14,14 +14,14 @@ namespace AirBomber
|
||||
/// <summary>
|
||||
/// Заполнение информации по объекту
|
||||
/// </summary>
|
||||
/// <param name="car"></param>
|
||||
private void SetData(DrawningAirplane car)
|
||||
/// <param name="airplane"></param>
|
||||
private void SetData(DrawningAirplane airplane)
|
||||
{
|
||||
toolStripStatusLabelSpeed.Text = $"Скорость: {car.Airplane.Speed}";
|
||||
toolStripStatusLabelWeight.Text = $"Вес: {car.Airplane.Weight}";
|
||||
toolStripStatusLabelBodyColor.Text = $"Цвет: {car.Airplane.BodyColor.Name}";
|
||||
toolStripStatusLabelSpeed.Text = $"Скорость: {airplane.Airplane.Speed}";
|
||||
toolStripStatusLabelWeight.Text = $"Вес: {airplane.Airplane.Weight}";
|
||||
toolStripStatusLabelBodyColor.Text = $"Цвет: {airplane.Airplane.BodyColor.Name}";
|
||||
pictureBoxAirplane.Image = _abstractMap.CreateMap(pictureBoxAirplane.Width, pictureBoxAirplane.Height,
|
||||
new DrawningObject(car));
|
||||
new DrawningObject(airplane));
|
||||
}
|
||||
/// <summary>
|
||||
/// Обработка нажатия кнопки "Создать"
|
||||
@ -31,8 +31,8 @@ namespace AirBomber
|
||||
private void ButtonCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random rnd = new();
|
||||
var car = new DrawningAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
SetData(car);
|
||||
var airplane = new DrawningAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
SetData(airplane);
|
||||
}
|
||||
/// <summary>
|
||||
/// Изменение размеров формы
|
||||
@ -69,11 +69,11 @@ namespace AirBomber
|
||||
private void ButtonCreateModif_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random rnd = new();
|
||||
var car = new DrawningAirBomber(rnd.Next(100, 300), rnd.Next(1000, 2000),
|
||||
var airplane = new DrawningAirBomber(rnd.Next(100, 300), rnd.Next(1000, 2000),
|
||||
Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
|
||||
Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)),
|
||||
Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
|
||||
SetData(car);
|
||||
SetData(airplane);
|
||||
}
|
||||
/// <summary>
|
||||
/// Смена карты
|
||||
|
Loading…
Reference in New Issue
Block a user