diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln b/RPP_FirstLaba_Tractor/RPP_Firsov_Kirill_Tractor_basis.sln similarity index 84% rename from RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln rename to RPP_FirstLaba_Tractor/RPP_Firsov_Kirill_Tractor_basis.sln index a1ae33d..0be4f9c 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln +++ b/RPP_FirstLaba_Tractor/RPP_Firsov_Kirill_Tractor_basis.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32602.215 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RPP_FirstLaba_Tractor", "RPP_FirstLaba_Tractor\RPP_FirstLaba_Tractor.csproj", "{EF413F48-FFBF-4510-BA11-FAEBE7C0142A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectTractor", "RPP_FirstLaba_Tractor\ProjectTractor.csproj", "{EF413F48-FFBF-4510-BA11-FAEBE7C0142A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/AbstractStrategy.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/AbstractStrategy.cs new file mode 100644 index 0000000..f3605ef --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/AbstractStrategy.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectTractor.DrawningObjects; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Класс-стратегия перемещения объекта + /// + public abstract class AbstractStrategy + { + /// + /// Перемещаемый объект + /// + private IMoveableObject? _moveableObject; + /// + /// Статус перемещения + /// + private Status _state = Status.NotInit; + /// + /// Ширина поля + /// + protected int FieldWidth { get; private set; } + /// + /// Высота поля + /// + protected int FieldHeight { get; private set; } + /// + /// Статус перемещения + /// + public Status GetStatus() { return _state; } + /// + /// Установка данных + /// + /// Перемещаемый объект + /// Ширина поля + /// Высота поля + public void SetData(IMoveableObject moveableObject, int width, int + height) + { + if (moveableObject == null) + { + _state = Status.NotInit; + return; + } + _state = Status.InProgress; + _moveableObject = moveableObject; + FieldWidth = width; + FieldHeight = height; + } + /// + /// Шаг перемещения + /// + public void MakeStep() + { + if (_state != Status.InProgress) + { + return; + } + if (IsTargetDestinaion()) + { + _state = Status.Finish; + return; + } + MoveToTarget(); + } + /// + /// Перемещение влево + /// + /// Результат перемещения (true - удалось переместиться, false -неудача) + protected bool MoveLeft() => MoveTo(DirectionType.Left); + /// + /// Перемещение вправо + /// + /// Результат перемещения (true - удалось переместиться,false - неудача) + protected bool MoveRight() => MoveTo(DirectionType.Right); + /// + /// Перемещение вверх + /// + /// Результат перемещения (true - удалось переместиться,false - неудача) + protected bool MoveUp() => MoveTo(DirectionType.Up); + /// + /// Перемещение вниз + /// + /// Результат перемещения (true - удалось переместиться,false - неудача) + protected bool MoveDown() => MoveTo(DirectionType.Down); + /// + /// Параметры объекта + /// + protected ObjectParameters? GetObjectParameters => + _moveableObject?.GetObjectPosition; + /// + /// Шаг объекта + /// + /// + protected int? GetStep() + { + if (_state != Status.InProgress) + { + return null; + } + return _moveableObject?.GetStep; + } + /// + /// Перемещение к цели + /// + protected abstract void MoveToTarget(); + /// + /// Достигнута ли цель + /// + /// + protected abstract bool IsTargetDestinaion(); + /// + /// Попытка перемещения в требуемом направлении + /// + /// Направление + /// Результат попытки (true - удалось переместиться, false -неудача) + private bool MoveTo(DirectionType directionType) + { + if (_state != Status.InProgress) + { + return false; + } + if (_moveableObject?.CheckCanMove(directionType) ?? false) + { + _moveableObject.MoveObject(directionType); + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs new file mode 100644 index 0000000..5489883 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor +{ + public enum DirectionType + { + /// + /// /// Вверх + /// /// + Up = 1, + /// + /// Вниз + /// + Down = 2, + /// + /// Влево + /// + Left = 3, + /// + /// Вправо + /// + Right = 4 + + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs new file mode 100644 index 0000000..ca3eb8a --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectTractor.Entities; + +namespace ProjectTractor.DrawningObjects +{ + /// + /// Класс, отвечающий за прорисовку и перемещение объекта-сущности + /// + public class DrawningBulldoser : DrawningTractor + { + /// + /// Конструктор + /// + /// Скорость + /// Вес + /// Основной цвет + /// Дополнительный цвет + /// Признак наличия орнамента на колесах + /// Признак наличия отвала + /// Ширина картинки + /// Высота картинки + public DrawningBulldoser(int speed, double weight, Color bodyColor, Color + additionalColor, bool wheelsOrnament, bool blade, int width, int height) : + base(speed, weight, bodyColor, width, height, 110, 60) + { + if (EntityTractor != null) + { + EntityTractor = new EntityBulldoser(speed, weight, bodyColor, + additionalColor, wheelsOrnament, blade); + } + } + public override void DrawTransport(Graphics g) + { + if (EntityTractor is not EntityBulldoser bulldoser) + { + return; + } + Pen pen = new(Color.Black); + Brush additionalBrush = new + SolidBrush(bulldoser.AdditionalColor); + + base.DrawTransport(g); + // орнамент на колесах + if (bulldoser.WheelsOrnament) + { + 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.DrawLine(pen, _startPosX + 7, _startPosY + 47, _startPosX + 7, _startPosY + 58); + g.DrawLine(pen, _startPosX + 2, _startPosY + 53, _startPosX + 13, _startPosY + 53); + + g.DrawLine(pen, _startPosX + 73, _startPosY + 47, _startPosX + 73, _startPosY + 58); + g.DrawLine(pen, _startPosX + 67, _startPosY + 53, _startPosX + 78, _startPosY + 53); + + g.DrawLine(pen, _startPosX + 40, _startPosY + 57, _startPosX + 40, _startPosY + 62); + g.DrawLine(pen, _startPosX + 37, _startPosY + 60, _startPosX + 43, _startPosY + 60); + + g.DrawLine(pen, _startPosX + 25, _startPosY + 57, _startPosX + 25, _startPosY + 62); + g.DrawLine(pen, _startPosX + 22, _startPosY + 60, _startPosX + 28, _startPosY + 60); + + g.DrawLine(pen, _startPosX + 55, _startPosY + 57, _startPosX + 55, _startPosY + 62); + g.DrawLine(pen, _startPosX + 52, _startPosY + 60, _startPosX + 58, _startPosY + 60); + + g.DrawLine(pen, _startPosX + 30, _startPosY + 42, _startPosX + 30, _startPosY + 48); + g.DrawLine(pen, _startPosX + 27, _startPosY + 45, _startPosX + 33, _startPosY + 45); + + g.DrawLine(pen, _startPosX + 50, _startPosY + 42, _startPosX + 50, _startPosY + 48); + g.DrawLine(pen, _startPosX + 47, _startPosY + 45, _startPosX + 53, _startPosY + 45); + } + // отвал + if (bulldoser.Blade) + { + g.FillRectangle(additionalBrush, _startPosX + 82, _startPosY + 30, 10, 40); + g.FillRectangle(additionalBrush, _startPosX + 82, _startPosY + 60, 40, 10); + + for (int i = 0; i < 15; i++) + { + g.FillRectangle(additionalBrush, _startPosX + 82, _startPosY + 60 - i * 2, 40 - i * 2, 10); + } + + g.FillRectangle(additionalBrush, _startPosX + 50, _startPosY + 25, 10, 10); + + for (int i = 0; i < 16; i++) + { + g.FillRectangle(additionalBrush, _startPosX + 50 + i * 2, _startPosY + 25 + i, 10, 10); + } + } + } + + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs new file mode 100644 index 0000000..48469c8 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectTractor.DrawningObjects; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Реализация интерфейса IDrawningObject для работы с объектом DrawningTractor(паттерн Adapter) + /// + public class DrawningObjectTractor : IMoveableObject + { + private readonly DrawningTractor? _drawningTractor = null; + public DrawningObjectTractor(DrawningTractor drawningTractor) + { + _drawningTractor = drawningTractor; + } + public ObjectParameters? GetObjectPosition + { + get + { + if (_drawningTractor == null || _drawningTractor.EntityTractor == + null) + { + return null; + } + return new ObjectParameters(_drawningTractor.GetPosX, + _drawningTractor.GetPosY, _drawningTractor.GetWidth, _drawningTractor.GetHeight); + } + } + public int GetStep => (int)(_drawningTractor?.EntityTractor?.Step ?? 0); + public bool CheckCanMove(DirectionType direction) => + _drawningTractor?.CanMove(direction) ?? false; + public void MoveObject(DirectionType direction) => + _drawningTractor?.MoveTransport(direction); + + public void getData() + { + + } + } + +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningTractor.cs new file mode 100644 index 0000000..c5af8d8 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningTractor.cs @@ -0,0 +1,229 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectTractor.Entities; + +namespace ProjectTractor.DrawningObjects { + +/// +/// Класс, отвечающий за прорисовку и перемещение объекта-сущности +/// + public class DrawningTractor +{ + /// + /// Класс-сущность + /// + public EntityTractor? EntityTractor { get; protected set; } + /// + /// Ширина окна + /// + private int _pictureWidth; + /// + /// Высота окна + /// + private int _pictureHeight; + /// + /// Левая координата прорисовки автомобиля + /// + protected int _startPosX; + /// + /// Верхняя кооридната прорисовки автомобиля + /// + protected int _startPosY; + /// + /// Ширина прорисовки автомобиля + /// + protected readonly int _tractorWidth = 75; + /// + /// Высота прорисовки автомобиля + /// + protected readonly int _tractorHeight = 60; + /// + /// Конструктор + /// + /// Скорость + /// Вес + /// Основной цвет + /// Ширина картинки + /// Высота картинки + public DrawningTractor(int speed, double weight, Color bodyColor, int + width, int height) + { + if (width <= _tractorWidth || height <= _tractorHeight) + return; + _pictureWidth = width; + _pictureHeight = height; + EntityTractor = new EntityTractor(speed, weight, bodyColor); + } + /// + /// Конструктор + /// + /// Скорость + /// Вес + /// Основной цвет + /// Ширина картинки + /// Высота картинки + /// Ширина прорисовки автомобиля + /// Высота прорисовки автомобиля + protected DrawningTractor(int speed, double weight, Color bodyColor, int + width, int height, int tractorWidth, int tractorHeight) + { + if (width <= _tractorWidth || height <= _tractorHeight) + return; + _pictureWidth = width; + _pictureHeight = height; + _tractorWidth = tractorWidth; + _tractorHeight = tractorHeight; + EntityTractor = new EntityTractor(speed, weight, bodyColor); + } + + + /// + /// Координата X объекта + /// + public int GetPosX => _startPosX; + /// + /// Координата Y объекта + /// + public int GetPosY => _startPosY; + /// + /// Ширина объекта + /// + public int GetWidth => _tractorWidth; + /// + /// Высота объекта + /// + public int GetHeight => _tractorHeight; + /// + /// Проверка, что объект может переместится по указанному направлению + /// + /// Направление + /// true - можно переместится по указанномнаправлению + public bool CanMove(DirectionType direction) + { + if (EntityTractor == null) + { + return false; + } + return direction switch + { + //влево + DirectionType.Left => _startPosX - EntityTractor.Step > 0, + //вверх + DirectionType.Up => _startPosY - EntityTractor.Step > 0, + // вправо + DirectionType.Right => _startPosX + EntityTractor.Step + _tractorWidth < _pictureWidth, + // вниз + DirectionType.Down => _startPosY + EntityTractor.Step + _tractorHeight < _pictureHeight, + _ => false, + }; + } + /// + /// Изменение направления перемещения + /// + /// Направление + public void MoveTransport(DirectionType direction) + { + if (!CanMove(direction) || EntityTractor == null) + { + return; + } + switch (direction) + { + //влево + case DirectionType.Left: + _startPosX -= (int)EntityTractor.Step; + break; + //вверх + case DirectionType.Up: + _startPosY -= (int)EntityTractor.Step; + break; + // вправо + case DirectionType.Right: + _startPosX += (int)EntityTractor.Step; + break; + //вниз + case DirectionType.Down: + _startPosY += (int)EntityTractor.Step; + break; + } + } + + + /// + /// Установка позиции + /// + /// Координата X + /// Координата Y + public void SetPosition(int x, int y) + { + if (EntityTractor == null) + return; + _startPosX = x; + _startPosY = y; + if (x + _tractorWidth >= _pictureWidth || y + _tractorHeight >= _pictureHeight) + { + _startPosX = 1; + _startPosY = (_tractorHeight + _tractorHeight) / 2; + } + } + + /// + /// Прорисовка объекта + /// + /// + public virtual 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/EntityBulldoser.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs new file mode 100644 index 0000000..b71fcd3 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.Entities +{ + /// + /// Класс-сущность "Спортивный автомобиль" + /// + public class EntityBulldoser : EntityTractor + { + /// + /// Дополнительный цвет (для опциональных элементов) + /// + public Color AdditionalColor { get; private set; } + /// + /// Признак (опция) наличия обвеса + /// + public bool WheelsOrnament { get; private set; } + /// + /// Признак (опция) наличия антикрыла + /// + public bool Blade { get; private set; } + + /// + /// Инициализация полей объекта-класса спортивного автомобиля + /// + /// Скорость + /// Вес автомобиля + /// Основной цвет + /// Дополнительный цвет + /// Признак наличия обвеса + /// Признак наличия отвала + + public EntityBulldoser(int speed, double weight, Color bodyColor, Color + additionalColor, bool wheelsOrnament, bool blade) : base(speed, weight, bodyColor) + { + AdditionalColor = additionalColor; + WheelsOrnament = wheelsOrnament; + Blade = blade; + } + } + +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs new file mode 100644 index 0000000..17d046f --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.Entities +{ + /// + /// Класс-сущность "Автомобиль" + /// + 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 EntityTractor(int speed, double weight, Color bodyColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + } + + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.Designer.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.Designer.cs deleted file mode 100644 index 25ca53f..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace RPP_FirstLaba_Tractor -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.cs deleted file mode 100644 index 4f2d728..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace RPP_FirstLaba_Tractor -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs new file mode 100644 index 0000000..4dcb86d --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs @@ -0,0 +1,303 @@ + +using ProjectTractor.MovementStrategy; +using ProjectTractor.DrawningObjects; + +namespace ProjectTractor +{ + + /// + /// " " + /// + public partial class FormTractor : Form + { + private PictureBox pictureBoxTractor; + private Button buttonCreateTractor; + private Button buttonTop; + private Button buttonLeft; + private Button buttonDown; + private Button buttonCreateBulldoserTractor; + private Button buttonStep; + private ComboBox comboBoxStrategy; + private Button buttonRight; + + /// + /// + /// + private AbstractStrategy? _abstractStrategy; + + public int getPictureWidth() + { + return pictureBoxTractor.Width; + } + public int getPictureHeight() + { + return pictureBoxTractor.Height; + } + + /// + /// - + /// + private DrawningTractor? _drawningTractor; + /// + /// + /// + public FormTractor() + { + InitializeComponent(); + } + /// + /// + /// + private void Draw() + { + if (_drawningTractor == null) + { + return; + } + Bitmap bmp = new(pictureBoxTractor.Width, + pictureBoxTractor.Height); + Graphics gr = Graphics.FromImage(bmp); + _drawningTractor.DrawTransport(gr); + pictureBoxTractor.Image = bmp; + } + /// + /// "" + /// + /// + /// + private void ButtonCreate_Click(object sender, EventArgs e) + { + Random random = new(); + _drawningTractor = new DrawningTractor(random.Next(100, 300), + random.Next(1000, 3000), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), + pictureBoxTractor.Width, pictureBoxTractor.Height); + _drawningTractor.SetPosition(random.Next(10, 100), + random.Next(10, 100)); + Draw(); + } + + /// + /// + /// + /// + /// + private void ButtonMove_Click(object sender, EventArgs e) + { + if (_drawningTractor == null) + { + return; + } + string name = ((Button)sender)?.Name ?? string.Empty; + switch (name) + { + case "buttonTop": + _drawningTractor.MoveTransport(DirectionType.Up); + break; + case "buttonDown": + _drawningTractor.MoveTransport(DirectionType.Down); + break; + case "buttonLeft": + _drawningTractor.MoveTransport(DirectionType.Left); + break; + case "buttonRight": + _drawningTractor.MoveTransport(DirectionType.Right); + break; + } + Draw(); + } + + private void InitializeComponent() + { + this.pictureBoxTractor = new System.Windows.Forms.PictureBox(); + this.buttonCreateTractor = new System.Windows.Forms.Button(); + this.buttonTop = new System.Windows.Forms.Button(); + this.buttonLeft = new System.Windows.Forms.Button(); + this.buttonDown = new System.Windows.Forms.Button(); + this.buttonRight = new System.Windows.Forms.Button(); + this.buttonCreateBulldoserTractor = new System.Windows.Forms.Button(); + this.buttonStep = new System.Windows.Forms.Button(); + this.comboBoxStrategy = new System.Windows.Forms.ComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTractor)).BeginInit(); + this.SuspendLayout(); + // + // pictureBoxTractor + // + this.pictureBoxTractor.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBoxTractor.Location = new System.Drawing.Point(0, 0); + this.pictureBoxTractor.Name = "pictureBoxTractor"; + this.pictureBoxTractor.Size = new System.Drawing.Size(882, 453); + this.pictureBoxTractor.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBoxTractor.TabIndex = 0; + this.pictureBoxTractor.TabStop = false; + // + // buttonCreateTractor + // + this.buttonCreateTractor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCreateTractor.Location = new System.Drawing.Point(12, 403); + this.buttonCreateTractor.Name = "buttonCreateTractor"; + this.buttonCreateTractor.Size = new System.Drawing.Size(246, 29); + this.buttonCreateTractor.TabIndex = 1; + this.buttonCreateTractor.Text = " "; + this.buttonCreateTractor.UseVisualStyleBackColor = true; + this.buttonCreateTractor.Click += new System.EventHandler(this.ButtonCreate_Click); + // + // buttonTop + // + this.buttonTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonTop.BackgroundImage = global::ProjectTractor.Properties.Resources.arrowUp; + this.buttonTop.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.buttonTop.Location = new System.Drawing.Point(804, 375); + this.buttonTop.Name = "buttonTop"; + this.buttonTop.Size = new System.Drawing.Size(30, 30); + this.buttonTop.TabIndex = 2; + this.buttonTop.UseVisualStyleBackColor = true; + this.buttonTop.Click += new System.EventHandler(this.ButtonMove_Click); + // + // buttonLeft + // + this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLeft.BackgroundImage = global::ProjectTractor.Properties.Resources.arrowLeft; + this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.buttonLeft.Location = new System.Drawing.Point(768, 411); + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.Size = new System.Drawing.Size(30, 30); + this.buttonLeft.TabIndex = 3; + this.buttonLeft.UseVisualStyleBackColor = true; + this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click); + // + // buttonDown + // + this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDown.BackgroundImage = global::ProjectTractor.Properties.Resources.arrowDown; + this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.buttonDown.Location = new System.Drawing.Point(804, 411); + this.buttonDown.Name = "buttonDown"; + this.buttonDown.Size = new System.Drawing.Size(30, 30); + this.buttonDown.TabIndex = 4; + this.buttonDown.UseVisualStyleBackColor = true; + this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click); + // + // buttonRight + // + this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRight.BackgroundImage = global::ProjectTractor.Properties.Resources.arrowRight; + this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.buttonRight.Location = new System.Drawing.Point(840, 411); + this.buttonRight.Name = "buttonRight"; + this.buttonRight.Size = new System.Drawing.Size(30, 30); + this.buttonRight.TabIndex = 5; + this.buttonRight.UseVisualStyleBackColor = true; + this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click); + // + // buttonCreateBulldoserTractor + // + this.buttonCreateBulldoserTractor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCreateBulldoserTractor.Location = new System.Drawing.Point(264, 403); + this.buttonCreateBulldoserTractor.Name = "buttonCreateBulldoserTractor"; + this.buttonCreateBulldoserTractor.Size = new System.Drawing.Size(199, 29); + this.buttonCreateBulldoserTractor.TabIndex = 6; + this.buttonCreateBulldoserTractor.Text = " "; + this.buttonCreateBulldoserTractor.UseVisualStyleBackColor = true; + this.buttonCreateBulldoserTractor.Click += new System.EventHandler(this.buttonCreateBulldoserTractor_Click); + // + // buttonStep + // + this.buttonStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonStep.Location = new System.Drawing.Point(776, 46); + this.buttonStep.Name = "buttonStep"; + this.buttonStep.Size = new System.Drawing.Size(94, 29); + this.buttonStep.TabIndex = 7; + this.buttonStep.Text = ""; + this.buttonStep.UseVisualStyleBackColor = true; + this.buttonStep.Click += new System.EventHandler(this.buttonStep_Click); + // + // comboBoxStrategy + // + this.comboBoxStrategy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxStrategy.FormattingEnabled = true; + this.comboBoxStrategy.Items.AddRange(new object[] { + " ", + " "}); + this.comboBoxStrategy.Location = new System.Drawing.Point(719, 12); + this.comboBoxStrategy.Name = "comboBoxStrategy"; + this.comboBoxStrategy.Size = new System.Drawing.Size(151, 28); + this.comboBoxStrategy.TabIndex = 8; + // + // FormTractor + // + this.ClientSize = new System.Drawing.Size(882, 453); + this.Controls.Add(this.comboBoxStrategy); + this.Controls.Add(this.buttonStep); + this.Controls.Add(this.buttonCreateBulldoserTractor); + this.Controls.Add(this.buttonRight); + this.Controls.Add(this.buttonDown); + this.Controls.Add(this.buttonLeft); + this.Controls.Add(this.buttonTop); + this.Controls.Add(this.buttonCreateTractor); + this.Controls.Add(this.pictureBoxTractor); + this.Name = "FormTractor"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxTractor)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + private void buttonCreateBulldoserTractor_Click(object sender, EventArgs e) + { + Random random = new(); + _drawningTractor = new DrawningBulldoser(random.Next(100, 300), + random.Next(1000, 3000), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), + Convert.ToBoolean(random.Next(0, 2)), + Convert.ToBoolean(random.Next(0, 2)), + pictureBoxTractor.Width, pictureBoxTractor.Height); + _drawningTractor.SetPosition(random.Next(10, 100), random.Next(10, + 100)); + Draw(); + + } + + private void buttonStep_Click(object sender, EventArgs e) + { + if (_drawningTractor == null) + { + return; + } + if (comboBoxStrategy.Enabled) + { + _abstractStrategy = comboBoxStrategy.SelectedIndex + switch + { + 0 => new MoveToCenter(), + 1 => new MoveToBorder(), + _ => null, + }; + if (_abstractStrategy == null) + { + return; + } + _abstractStrategy.SetData(new + DrawningObjectTractor(_drawningTractor), pictureBoxTractor.Width, + pictureBoxTractor.Height); + comboBoxStrategy.Enabled = false; + } + if (_abstractStrategy == null) + { + return; + } + _abstractStrategy.MakeStep(); + Draw(); + if (_abstractStrategy.GetStatus() == Status.Finish) + { + comboBoxStrategy.Enabled = true; + _abstractStrategy = null; + } + } + } +} \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.resx b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs new file mode 100644 index 0000000..0c9d616 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Интерфейс для работы с перемещаемым объектом + /// + public interface IMoveableObject + { + /// + /// Получение координаты X объекта + /// + ObjectParameters? GetObjectPosition { get; } + /// + /// Шаг объекта + /// + int GetStep { get; } + /// + /// Проверка, можно ли переместиться по нужному направлению + /// + /// + /// + bool CheckCanMove(DirectionType direction); + /// + /// Изменение направления пермещения объекта + /// + /// Направление + void MoveObject(DirectionType direction); + + + } + +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs new file mode 100644 index 0000000..362ec52 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Стратегия перемещения объекта в центр экрана + /// + public class MoveToBorder : AbstractStrategy + { + protected override bool IsTargetDestinaion() + { + var objParams = GetObjectParameters; + if (objParams == null) + { + return false; + } + return objParams.RightBorder <= FieldWidth + && objParams.RightBorder + GetStep() >= FieldWidth + && objParams.DownBorder + GetStep() >= FieldHeight; + } + protected override void MoveToTarget() + { + var objParams = GetObjectParameters; + if (objParams == null) + { + return; + } + var diffX = objParams.RightBorder - (FieldWidth - 1); + if (Math.Abs(diffX) > GetStep()) + { + if (diffX < 0) + { + MoveRight(); + } + } + var diffY = objParams.DownBorder - (FieldHeight - 1); + if (Math.Abs(diffY) > GetStep()) + { + if (diffY < 0) + { + MoveDown(); + } + } + } + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs new file mode 100644 index 0000000..48d09d4 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Стратегия перемещения объекта в центр экрана + /// + public class MoveToCenter : AbstractStrategy + { + protected override bool IsTargetDestinaion() + { + var objParams = GetObjectParameters; + if (objParams == null) + { + return false; + } + return objParams.ObjectMiddleHorizontal <= FieldWidth / 2 && + objParams.ObjectMiddleHorizontal + GetStep() >= FieldWidth / 2 && + objParams.ObjectMiddleVertical <= FieldHeight / 2 && + objParams.ObjectMiddleVertical + GetStep() >= FieldHeight / 2; + } + protected override void MoveToTarget() + { + var objParams = GetObjectParameters; + if (objParams == null) + { + return; + } + var diffX = objParams.ObjectMiddleHorizontal - FieldWidth / 2; + if (Math.Abs(diffX) > GetStep()) + { + if (diffX > 0) + { + MoveLeft(); + } + else + { + MoveRight(); + } + } + var diffY = objParams.ObjectMiddleVertical - FieldHeight / 2; + if (Math.Abs(diffY) > GetStep()) + { + if (diffY > 0) + { + MoveUp(); + } + else + { + MoveDown(); + } + } + } + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs new file mode 100644 index 0000000..e75f70f --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Параметры-координаты объекта + /// + public class ObjectParameters + { + private readonly int _x; + private readonly int _y; + private readonly int _width; + private readonly int _height; + /// + /// Левая граница + /// + public int LeftBorder => _x; + /// + /// Верхняя граница + /// + public int TopBorder => _y; + /// + /// Правая граница + /// + public int RightBorder => _x + _width; + /// + /// Нижняя граница + /// + public int DownBorder => _y + _height; + /// + /// Середина объекта + /// + public int ObjectMiddleHorizontal => _x + _width / 2; + /// + /// Середина объекта + /// + public int ObjectMiddleVertical => _y + _height / 2; + /// + /// Конструктор + /// + /// Координата X + /// Координата Y + /// Ширина + /// Высота + public ObjectParameters(int x, int y, int width, int height) + { + _x = x; + _y = y; + _width = width; + _height = height; + } + } + +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs index c61cbe8..61dbba1 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs @@ -1,4 +1,4 @@ -namespace RPP_FirstLaba_Tractor +namespace ProjectTractor { internal static class Program { @@ -11,7 +11,7 @@ namespace RPP_FirstLaba_Tractor // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormTractor()); } } } \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ProjectTractor.csproj b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ProjectTractor.csproj new file mode 100644 index 0000000..13ee123 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ProjectTractor.csproj @@ -0,0 +1,26 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs new file mode 100644 index 0000000..112e027 --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace ProjectTractor.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectTractor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrowDown { + get { + object obj = ResourceManager.GetObject("arrowDown", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrowLeft { + get { + object obj = ResourceManager.GetObject("arrowLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrowRight { + get { + object obj = ResourceManager.GetObject("arrowRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrowUp { + get { + object obj = ResourceManager.GetObject("arrowUp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.resx b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.resx similarity index 84% rename from RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.resx rename to RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.resx index 1af7de1..55894d3 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Form1.resx +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.resx @@ -117,4 +117,17 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\arrowDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\arrowUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\arrowLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\arrowRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.csproj b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.csproj deleted file mode 100644 index b57c89e..0000000 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - enable - - - \ No newline at end of file diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs new file mode 100644 index 0000000..6cb1b3d --- /dev/null +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectTractor.MovementStrategy +{ + /// + /// Статус выполнения операции перемещения + /// + public enum Status + { + NotInit, + InProgress, + Finish + } + +} diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png new file mode 100644 index 0000000..6bc5f35 Binary files /dev/null and b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowDown.png differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png new file mode 100644 index 0000000..71da8a3 Binary files /dev/null and b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowLeft.png differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png new file mode 100644 index 0000000..69bd44f Binary files /dev/null and b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowRight.png differ diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png new file mode 100644 index 0000000..47c62f6 Binary files /dev/null and b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/arrowUp.png differ