Добавление конструктуров вместо методов Init
This commit is contained in:
parent
5c1444b66c
commit
f5cb1bfbe2
@ -39,10 +39,9 @@
|
|||||||
/// <param name="speed">Скорость</param>
|
/// <param name="speed">Скорость</param>
|
||||||
/// <param name="weight">Вес самолета</param>
|
/// <param name="weight">Вес самолета</param>
|
||||||
/// <param name="bodyColor">Цвет обшивки</param>
|
/// <param name="bodyColor">Цвет обшивки</param>
|
||||||
public void Init(int speed, float weight, Color bodyColor)
|
public DrawningAirplane(int speed, float weight, Color bodyColor)
|
||||||
{
|
{
|
||||||
Airplane = new EntityAirplane();
|
Airplane = new EntityAirplane(speed, weight, bodyColor);
|
||||||
Airplane.Init(speed, weight, bodyColor);
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Установка позиции самолета
|
/// Установка позиции самолета
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
/// <param name="weight"></param>
|
/// <param name="weight"></param>
|
||||||
/// <param name="bodyColor"></param>
|
/// <param name="bodyColor"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public void Init(int speed, float weight, Color bodyColor)
|
public EntityAirplane(int speed, float weight, Color bodyColor)
|
||||||
{
|
{
|
||||||
Random rnd = new();
|
Random rnd = new();
|
||||||
Speed = speed <= 0 ? rnd.Next(50, 150) : speed;
|
Speed = speed <= 0 ? rnd.Next(50, 150) : speed;
|
||||||
|
Loading…
Reference in New Issue
Block a user