25 lines
820 B
C#
25 lines
820 B
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace Airbus
|
||
{
|
||
public class EntityAirplane
|
||
{
|
||
public int Speed { get; set; } //Скорость
|
||
public float Weight { get; set; } //Вес
|
||
public Color BodyColor { get; set; } //Цвет
|
||
public float Step => Speed * 100 / Weight; //Шаг при перемещении
|
||
//Инициализация
|
||
public EntityAirplane(int speed, float weight, Color bodyColor)
|
||
{
|
||
Random random = new Random();
|
||
Speed = speed <= 0 ? random.Next(50, 150) : speed;
|
||
Weight = weight <= 0 ? random.Next(40, 70) : weight;
|
||
BodyColor = bodyColor;
|
||
}
|
||
}
|
||
}
|