diff --git a/Sailboat/Sailboat/EntityBoat.cs b/Sailboat/Sailboat/EntityBoat.cs new file mode 100644 index 0000000..53f3dca --- /dev/null +++ b/Sailboat/Sailboat/EntityBoat.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sailboat.Entities +{ + /// + /// Класс-сущность "Лодка" + /// + public class EntityBoat + { + /// + /// Скорость + /// + public int Speed { get; private set; } + + /// + /// Вес + /// + public double Weight { get; private set; } + + /// + /// Основной цвет + /// + public Color BodyColor { get; private set; } + + /// + /// Шаг перемещения лодки + /// + public double Step => (double)Speed * 100 / Weight; + + /// + /// Конструктор с параметрами + /// + /// Скорость + /// Вес лодки + /// Основной цвет + public EntityBoat(int speed, double weight, Color bodyColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + } + } +} \ No newline at end of file