From 48a9ca1a4493c2b774469b1094d075a94ed25025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=20=D0=91=D0=BE=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 30 Sep 2022 18:55:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarmlyShip/WarmlyShip/DrawingWarmlyShip.cs | 5 +++++ WarmlyShip/WarmlyShip/EntityMotorShip.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/WarmlyShip/WarmlyShip/DrawingWarmlyShip.cs b/WarmlyShip/WarmlyShip/DrawingWarmlyShip.cs index cb9311e..097b8b1 100644 --- a/WarmlyShip/WarmlyShip/DrawingWarmlyShip.cs +++ b/WarmlyShip/WarmlyShip/DrawingWarmlyShip.cs @@ -16,6 +16,7 @@ namespace WarmlyShip private readonly int _warmlyShipWidth = 125; //Ширина отрисовки корабля private readonly int _warmlyShipHeight = 50; //Высота отрисовки корабля + //Конструктор класса public DrawingWarmlyShip(int speed, float weight, Color bodyColor) { warmlyShip = new EntityWarmlyShip(speed, weight, bodyColor); @@ -27,6 +28,7 @@ namespace WarmlyShip _warmlyShipHeight = warmlyHeight; } + //Начальная позиция коробля public void SetPosition(int x, int y, int width, int height) { if (width < _warmlyShipWidth || height < _warmlyShipHeight) return; @@ -37,6 +39,7 @@ namespace WarmlyShip _pictureHeight = height; } + //Функция передвижения объекта public void MoveTransport(Direction direction) { if (!_pictureWidth.HasValue || !_pictureHeight.HasValue) return; @@ -57,6 +60,7 @@ namespace WarmlyShip } } + //Отрисовка транспорта public virtual void DrawTransport(Graphics g) { if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue) @@ -89,6 +93,7 @@ namespace WarmlyShip g.DrawEllipse(new(Color.Blue, 2), _startPosX + _warmlyShipWidth * 2 / 5 + 2.5f, _startPosY + 25, 20, 20); } + //Изменение границ отрисовки public void ChangeBorders(int width, int height) { _pictureWidth = width; diff --git a/WarmlyShip/WarmlyShip/EntityMotorShip.cs b/WarmlyShip/WarmlyShip/EntityMotorShip.cs index 55687e5..a2d5d38 100644 --- a/WarmlyShip/WarmlyShip/EntityMotorShip.cs +++ b/WarmlyShip/WarmlyShip/EntityMotorShip.cs @@ -12,6 +12,7 @@ namespace WarmlyShip public bool BodyKit { get; private set; } public bool Wing { get; private set; } public bool SportLine { get; private set; } + public EntityMotorShip(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : base(speed, weight, bodyColor) { DopColor = dopColor;