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