2022-12-05 23:41:28 +04:00

25 lines
841 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; private set; } //Скорость
public float Weight { get; private set; } //Вес
public Color BodyColor { get; private 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;
}
}
}