diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs deleted file mode 100644 index 0df4961..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace RPP_FirstLaba_Tractor -{ - /// - /// Направление перемещения - /// - public enum DirectionType - { - /// - /// /// Вверх - /// /// - Up = 1, - /// - /// Вниз - /// - Down = 2, - /// - /// Влево - /// - Left = 3, - /// - /// Вправо - /// - Right = 4 - - } -} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawingTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawingTractor.cs deleted file mode 100644 index d354f33..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawingTractor.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace RPP_FirstLaba_Tractor -{ - internal class DrawningTractor - { - /// - /// Класс-сущность - /// - public EntityTractor? EntityTractor { get; private set; } - /// - /// Ширина окна - /// - private int _pictureWidth; - /// - /// Высота окна - /// - private int _pictureHeight; - /// - /// Левая координата прорисовки автомобиля - /// - private int _startPosX; - /// - /// Верхняя кооридната прорисовки автомобиля - /// - private int _startPosY; - /// - /// Ширина прорисовки автомобиля - /// - private readonly int _tractorWidth = 80; - /// - /// Высота прорисовки автомобиля - /// - private readonly int _tractorHeight = 60; - /// - /// Инициализация свойств - /// - /// Скорость - /// Вес - /// Цвет кузова - /// Дополнительный цвет - /// Признак наличия обвеса - /// Признак наличия антикрыла - /// Признак наличия гоночной полосы - /// Ширина картинки - /// Высота картинки - /// true - объект создан, false - проверка не пройдена,нельзя создать объект в этих размерах - public bool Init(int speed, double weight, Color bodyColor, int width, int height) - { - - _pictureWidth = width; - _pictureHeight = height; - if (_tractorWidth > _pictureHeight || _tractorHeight > _pictureHeight) - { - _pictureWidth = 2 * _tractorWidth; - _pictureHeight = 2 * _tractorHeight; - - } - EntityTractor = new EntityTractor(); - EntityTractor.Init(speed, weight, bodyColor); - return true; - } - /// - /// Установка позиции - /// - /// Координата X - /// Координата Y - public void SetPosition(int x, int y) - { - _startPosX = x; - _startPosY = y; - - if ((x + _tractorWidth > _pictureWidth) || (y + _pictureHeight > _pictureHeight)) - { - Random random = new(); - x = random.Next(0, _pictureWidth); - x = random.Next(0, _pictureHeight); - } - } - /// - /// Изменение направления перемещения - /// - /// Направление - /// - - public void MoveTransport(DirectionType direction) - { - if (EntityTractor == null) - { - return; - } - switch (direction) - { - //влево - case DirectionType.Left: - if (_startPosX - EntityTractor.Step > 0) - { - _startPosX -= (int)EntityTractor.Step; - } - break; - //вверх - case DirectionType.Up: - if (_startPosY - EntityTractor.Step > 0) - { - _startPosY -= (int)EntityTractor.Step; - } - break; - // вправо - case DirectionType.Right: - if (_startPosX + _tractorWidth + EntityTractor.Step < _pictureWidth) - { - _startPosX += (int)EntityTractor.Step; - } - break; - //вниз - case DirectionType.Down: - if (_startPosY + _tractorHeight + EntityTractor.Step < _pictureHeight) - { - _startPosY += (int)EntityTractor.Step; - } - break; - } - } - /// - /// Прорисовка объекта - /// - /// - public void DrawTransport(Graphics g) - { - if (EntityTractor == null) - { - return; - } - Pen pen = new(Color.Black); - Brush brGray = new SolidBrush(Color.Gray); - Brush brBlack = new SolidBrush(Color.Black); - Brush additionalBrush = new - SolidBrush(EntityTractor.BodyColor); - - //Гусеницы - g.FillEllipse(brGray, _startPosX, _startPosY + 41, 25, 25); - g.FillEllipse(brGray, _startPosX + 55, _startPosY + 41, 25, 25); - g.FillRectangle(brGray, _startPosX + 13, _startPosY + 41, 54, 25); - //колеса - g.FillEllipse(brBlack, _startPosX, _startPosY + 45, 15, 15); - g.FillEllipse(brBlack, _startPosX + 65, _startPosY + 45, 15, 15); - g.FillEllipse(brBlack, _startPosX + 35, _startPosY + 55, 10, 10); - g.FillEllipse(brBlack, _startPosX + 20, _startPosY + 55, 10, 10); - g.FillEllipse(brBlack, _startPosX + 50, _startPosY + 55, 10, 10); - g.FillEllipse(brBlack, _startPosX + 25, _startPosY + 40, 10, 10); - g.FillEllipse(brBlack, _startPosX + 45, _startPosY + 40, 10, 10); - //кузов - g.FillRectangle(additionalBrush, _startPosX, _startPosY + 20, 80, 20); - g.FillRectangle(additionalBrush, _startPosX + 60, _startPosY, 10, 20); - g.FillRectangle(additionalBrush, _startPosX, _startPosY, 40, 20); - - //Окно - Brush brBlue = new SolidBrush(Color.Blue); - g.FillRectangle(brBlue, _startPosX + 10, _startPosY + 3, 25, 15); - - //Колеса - g.FillEllipse(additionalBrush, _startPosX + 2, _startPosY + 47, 11, 11); - g.FillEllipse(additionalBrush, _startPosX + 67, _startPosY + 47, 11, 11); - g.FillEllipse(additionalBrush, _startPosX + 37, _startPosY + 57, 6, 6); - g.FillEllipse(additionalBrush, _startPosX + 22, _startPosY + 57, 6, 6); - g.FillEllipse(additionalBrush, _startPosX + 52, _startPosY + 57, 6, 6); - g.FillEllipse(additionalBrush, _startPosX + 27, _startPosY + 42, 6, 6); - g.FillEllipse(additionalBrush, _startPosX + 47, _startPosY + 42, 6, 6); - - //границы трактора - g.DrawRectangle(pen, _startPosX, _startPosY + 20, 80, 20); - g.DrawRectangle(pen, _startPosX + 60, _startPosY, 10, 20); - g.DrawRectangle(pen, _startPosX, _startPosY, 40, 20); - } - } -} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Tractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Tractor.cs deleted file mode 100644 index 843b95c..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Tractor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace RPP_FirstLaba_Tractor -{ - public class EntityTractor - { - /// - /// Скорость - /// - 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 void Init(int speed, double weight, Color bodyColor) - { - Speed = speed; - Weight = weight; - BodyColor = bodyColor; - } - - } -} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/TypeDirection.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/TypeDirection.cs deleted file mode 100644 index d555ecb..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/TypeDirection.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -public class Class1 -{ - public Class1() - { - } -} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png deleted file mode 100644 index 6bc5f35..0000000 Binary files a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png and /dev/null differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png deleted file mode 100644 index 71da8a3..0000000 Binary files a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png and /dev/null differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png deleted file mode 100644 index 69bd44f..0000000 Binary files a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png and /dev/null differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png deleted file mode 100644 index 47c62f6..0000000 Binary files a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png and /dev/null differ