Emelyanov A.S. LabWork02 #6

Merged
eegov merged 4 commits from LabWork02 into LabWork01 2022-10-21 09:02:46 +04:00
3 changed files with 5 additions and 6 deletions
Showing only changes of commit 928fa3a1df - Show all commits

View File

@ -45,10 +45,10 @@ namespace Airbus
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес самолета</param>
/// <param name="bodyColor">Цвет кузова</param>
public void Init(int speed, float weight, Color bodyColor)
public DrawningPlane(int speed, float weight, Color bodyColor)
{
Plane = new EntityPlane();
Plane.Init(speed, weight, bodyColor);
Plane = new EntityPlane(speed, weight, bodyColor);
}
/// <summary>
/// Установка позиции самолета

View File

@ -31,7 +31,7 @@ namespace Airbus
/// <param name="weight"></param>
/// <param name="bodyColor"></param>
/// <returns></returns>
public void Init(int speed, float weight, Color bodyColor)
public EntityPlane(int speed, float weight, Color bodyColor)
{
Random rnd = new();
Speed = speed <= 0 ? rnd.Next(50, 150) : speed;

View File

@ -37,8 +37,7 @@ namespace Airbus
{
Random rnd = new();
_plane = new DrawningPlane();
_plane.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
_plane = new DrawningPlane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
_plane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxAirbus.Width, pictureBoxAirbus.Height);
toolStripStatusLabelSpeed.Text = $"Скорость: {_plane.Plane.Speed}";
toolStripStatusLabelWeight.Text = $"Вес: {_plane.Plane.Weight}";