2022-11-19 17:21:37 +04:00

25 lines
820 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}
}