diff --git a/ProjectSportCar/ProjectSportCar.sln b/ProjectSportCar/ProjectSportCar.sln
index bb797c9..d685847 100644
--- a/ProjectSportCar/ProjectSportCar.sln
+++ b/ProjectSportCar/ProjectSportCar.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectSportCar", "ProjectSportCar\ProjectSportCar.csproj", "{42AA0D5D-C1B5-4758-9837-1557C2CFD37D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectLinkor", "ProjectSportCar\ProjectLinkor.csproj", "{42AA0D5D-C1B5-4758-9837-1557C2CFD37D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/ProjectSportCar/ProjectSportCar/DirectionType.cs b/ProjectSportCar/ProjectSportCar/DirectionType.cs
new file mode 100644
index 0000000..0aaf8c7
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/DirectionType.cs
@@ -0,0 +1,27 @@
+namespace ProjectLinkor;
+
+///
+/// Направление перемещения
+///
+public enum DirectionType
+{
+ ///
+ /// Вверх
+ ///
+ Up = 1,
+
+ ///
+ /// Вниз
+ ///
+ Down = 2,
+
+ ///
+ /// Влево
+ ///
+ Left = 3,
+
+ ///
+ /// Вправо
+ ///
+ Right = 4
+}
diff --git a/ProjectSportCar/ProjectSportCar/DrawningLinkor.cs b/ProjectSportCar/ProjectSportCar/DrawningLinkor.cs
new file mode 100644
index 0000000..317c331
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/DrawningLinkor.cs
@@ -0,0 +1,271 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ProjectLinkor;
+
+///
+/// Класс отвечающий за прорисовку и перемещение объекта-сущности
+///
+public class DrawningLinkor
+{
+ ///
+ /// Класс-сущность
+ ///
+ public EntityLinkor? EntityLinkor { get; private set; }
+
+ ///
+ /// Ширина окна
+ ///
+ private int? _pictureWidth;
+
+ ///
+ /// Высота окна
+ ///
+ private int? _pictureHeight;
+
+ ///
+ /// Левая кордината прорисовки линкора
+ ///
+ private int? _startPosX;
+
+ ///
+ /// Верхняя кордината прорисовки линкора
+ ///
+ private int? _startPosY;
+
+ ///
+ /// Ширина прорисовки линкора
+ ///
+ private readonly int _drawningLinkorWidth = 150;
+
+ ///
+ /// Высота прорисовки линкора
+ ///
+ private readonly int _drawningLinkorHeight = 80;
+
+ ///
+ /// Иницилизация полей объекта-класса линкора
+ ///
+ /// Скорость
+ /// Вес линкора
+ /// Основной цвет
+ /// Дополнительный цвет
+ /// Признак наличия орудийной башни
+ /// Признак наличия отсека под ракеты
+ /// Признак наличия
+ public void Init(int speed, double weigth, Color bodyColor, Color additionalColor, bool gunTurret, bool compartment, bool linkorMotor)
+ {
+ EntityLinkor = new EntityLinkor();
+ EntityLinkor.Init(speed, weigth, bodyColor, additionalColor, gunTurret, compartment, linkorMotor);
+ _pictureWidth = null;
+ _pictureHeight = null;
+ _startPosX = null;
+ _startPosY = null;
+ }
+
+ ///
+ /// Установка границ поля
+ ///
+ /// Ширина поля
+ /// Высота поля
+ /// true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах
+ public bool SetPictureSize(int width, int height)
+ {
+ // TODO проверка, что объект "влезает" в размеры поля
+ // если влезает, сохраняем границы и корректируем позицию объекта, если она была уже устоновлена
+ if (_drawningLinkorWidth <= width && _drawningLinkorHeight <= height)
+ {
+ _pictureWidth = width;
+ _pictureHeight = height;
+
+ if (_startPosX.HasValue && _startPosY.HasValue)
+ {
+ if (_startPosX + _drawningLinkorWidth > _pictureWidth )
+ {
+ _startPosX = _pictureWidth - _drawningLinkorWidth;
+ }
+
+ if (_startPosY + _drawningLinkorWidth <= _pictureHeight)
+ {
+ _startPosY = _pictureHeight - _drawningLinkorHeight;
+ }
+
+ }
+ return true;
+ }
+ return false;
+ }
+
+ ///
+ /// Установка позиции
+ ///
+ /// Кордината X
+ /// Кордината Y
+ public void SetPosition(int x, int y)
+ {
+ if (!_pictureHeight.HasValue || !_pictureWidth.HasValue)
+ {
+ return;
+ }
+ // TODO если при установке объекта в эти координаты, он будет "выходить" за границы формы
+ // то надо изменить координаты, чтобы он оставался в этих границах
+
+ if (x < 0)
+ {
+ x = 0;
+ }
+
+ else if (x + _drawningLinkorWidth > _pictureWidth)
+ {
+ x = _pictureWidth.Value - _drawningLinkorWidth;
+ }
+
+ if (y < 0)
+ {
+ y = 0;
+ }
+ else if (y + _drawningLinkorHeight > _pictureHeight)
+ {
+ y = _pictureHeight.Value - _drawningLinkorHeight;
+ }
+
+ _startPosX = x;
+ _startPosY = y;
+ }
+
+ ///
+ /// изменение направления перемещения
+ ///
+ /// Направление
+ /// true - перемещение выполнено, false - перемещение невозможно
+ public bool MoveTransport(DirectionType direction)
+ {
+ if (EntityLinkor == null || !_startPosX.HasValue || !_startPosY.HasValue)
+ {
+ return false;
+ }
+
+ switch (direction)
+ {
+ //влево
+ case DirectionType.Left:
+ if (_startPosX.Value - EntityLinkor.Step > 0)
+ {
+ _startPosX -= (int)EntityLinkor.Step;
+ }
+ return true;
+ //вверх
+ case DirectionType.Up:
+ if (_startPosY.Value - EntityLinkor.Step > 0)
+ {
+ _startPosY -= (int)EntityLinkor.Step;
+ }
+ return true;
+ //вправо
+ case DirectionType.Right:
+ if (_startPosX.Value+_drawningLinkorWidth + EntityLinkor.Step < _pictureWidth)
+ {
+ _startPosX += (int)EntityLinkor.Step;
+ }
+ return true;
+ //вниз
+ case DirectionType.Down:
+ if (_startPosY.Value+_drawningLinkorHeight + EntityLinkor.Step < _pictureHeight)
+ {
+ _startPosY += (int)EntityLinkor.Step;
+ }
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ ///
+ /// Прорисовка объекта
+ ///
+ ///
+ public void DrawTransport(Graphics g)
+ {
+ if (EntityLinkor == null || !_startPosX.HasValue || !_startPosY.HasValue)
+ {
+ return;
+ }
+
+ Pen pen = new(Color.Black);
+ Brush additionalBrush = new SolidBrush(EntityLinkor.AdditionalColor);
+ Brush bodybrush = new SolidBrush(EntityLinkor.BodyColor);
+
+
+ //Заливка лодки
+ Point point1 = new Point(_startPosX.Value + 5, _startPosY.Value + 5);
+ Point point2 = new Point(_startPosX.Value + 110, _startPosY.Value + 5);
+ Point point3 = new Point(_startPosX.Value + 150, _startPosY.Value + 42);
+ Point point4 = new Point(_startPosX.Value + 110, _startPosY.Value + 80);
+ Point point5 = new Point(_startPosX.Value + 5, _startPosY.Value + 80);
+ Point point6 = new Point(_startPosX.Value + 5, _startPosY.Value + 5);
+
+ Point[] LinkorLine = { point1, point2, point3, point4, point5, point6 };
+ g.FillPolygon(additionalBrush, LinkorLine);
+
+ //границы линкора
+ g.DrawLine(pen, _startPosX.Value + 5, _startPosY.Value + 5, _startPosX.Value + 110, _startPosY.Value + 5);
+ g.DrawLine(pen, _startPosX.Value + 5, _startPosY.Value + 80, _startPosX.Value + 110, _startPosY.Value + 80);
+ g.DrawLine(pen, _startPosX.Value + 5, _startPosY.Value + 5, _startPosX.Value + 5, _startPosY.Value + 80);
+ g.DrawLine(pen, _startPosX.Value + 110, _startPosY.Value + 5, _startPosX.Value + 150, _startPosY.Value + 42);
+ g.DrawLine(pen, _startPosX.Value + 110, _startPosY.Value + 80, _startPosX.Value + 150, _startPosY.Value + 42);
+ g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 59, 15, 15);
+ g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 64, 15, 5);
+ g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 12, 15, 15);
+ g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 17, 15, 5);
+ //Парус
+ g.DrawArc(pen, _startPosX.Value + 45, _startPosY.Value + 15, 35, 60, 280, 160);
+ g.DrawLine(pen, _startPosX.Value + 67, _startPosY.Value + 17, _startPosX.Value + 67, _startPosY.Value + 72);
+ g.DrawLine(pen, _startPosX.Value + 50, _startPosY.Value + 45, _startPosX.Value + 67, _startPosY.Value + 72);
+ g.DrawLine(pen, _startPosX.Value + 50, _startPosY.Value + 45, _startPosX.Value + 67, _startPosY.Value + 17);
+ g.DrawLine(pen, _startPosX.Value + 50, _startPosY.Value + 45, _startPosX.Value + 67, _startPosY.Value + 45);
+ g.DrawLine(pen, _startPosX.Value + 50, _startPosY.Value + 45, _startPosX.Value + 67, _startPosY.Value + 35);
+ g.DrawLine(pen, _startPosX.Value + 50, _startPosY.Value + 45, _startPosX.Value + 67, _startPosY.Value + 55);
+
+
+ //заливка ракет
+ Brush br = new SolidBrush(Color.Black);
+ g.FillRectangle(bodybrush, _startPosX.Value + 25, _startPosY.Value + 59, 15, 15);
+ g.FillRectangle(bodybrush, _startPosX.Value + 10, _startPosY.Value + 64, 15, 5);
+ g.FillRectangle(bodybrush, _startPosX.Value + 25, _startPosY.Value + 12, 15, 15);
+ g.FillRectangle(bodybrush, _startPosX.Value + 10, _startPosY.Value + 17, 15, 5);
+
+ //Орудийная башня
+ if (EntityLinkor.GunTurret)
+ {
+ Brush bri = new SolidBrush(Color.Gray);
+ g.DrawEllipse(pen, _startPosX.Value + 90, _startPosY.Value + 27, 30, 30);
+ g.DrawEllipse(pen, _startPosX.Value + 95, _startPosY.Value + 32, 20, 20);
+ g.FillEllipse(bri, _startPosX.Value + 90, _startPosY.Value + 27, 30, 30);
+ g.FillEllipse(br, _startPosX.Value + 95, _startPosY.Value + 32, 20, 20);
+ }
+
+ //Дополнительная ракета
+ if (EntityLinkor.Сompartment)
+ {
+ Brush brfara = new SolidBrush(Color.Blue);
+ g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 35, 15, 15);
+ g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 40, 15, 5);
+ g.FillRectangle(brfara, _startPosX.Value + 25, _startPosY.Value + 35, 15, 15);
+ g.FillRectangle(brfara, _startPosX.Value + 10, _startPosY.Value + 40, 15, 5);
+
+ }
+
+ //Мотор
+ if (EntityLinkor.LinkorMotor)
+ {
+ g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 59, 5, 15);
+ g.FillRectangle(br, _startPosX.Value, _startPosY.Value + 59, 5, 15);
+ g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 10, 5, 15);
+ g.FillRectangle(br, _startPosX.Value, _startPosY.Value + 10, 5, 15);
+ }
+
+ }
+}
diff --git a/ProjectSportCar/ProjectSportCar/EntityLinkor.cs b/ProjectSportCar/ProjectSportCar/EntityLinkor.cs
new file mode 100644
index 0000000..9f433ec
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/EntityLinkor.cs
@@ -0,0 +1,71 @@
+namespace ProjectLinkor;
+
+///
+/// Класс-сущность "Линкор"
+///
+public class EntityLinkor
+{
+
+ ///
+ /// Скорость
+ ///
+ public int Speed { get; private set; }
+
+ ///
+ /// Вес
+ ///
+ public double Weigth { get; private set; }
+
+ ///
+ /// Основной цвет
+ ///
+ public Color BodyColor { get; private set; }
+
+ ///
+ /// Дополнительный цвет (для опциональных элементов)
+ ///
+ public Color AdditionalColor { get; private set; }
+
+ ///
+ /// Признак (опция) наличия орудийной башни
+ ///
+ public bool GunTurret { get; private set; }
+
+ ///
+ /// Признак (опция) наличия отсека под ракеты
+ ///
+ public bool Сompartment { get; private set; }
+
+ ///
+ /// Признак (опция) наличия
+ ///
+ public bool LinkorMotor { get; private set; }
+
+ ///
+ /// Шаг перемещения линкора
+ ///
+ public double Step => Speed * 100 / Weigth;
+
+ ///
+ /// Иницилизация полей объекта-класса линкора
+ ///
+ ///
+ /// Скорость
+ /// Вес линкора
+ /// Основной цвет
+ /// Дополнительный цвет
+ /// Признак наличия орудийной башни
+ /// Признак наличия отсека под ракеты
+ /// Признак наличия
+ public void Init(int speed, double weigth, Color bodyColor, Color additionalColor, bool gunTurret, bool compartment, bool linkorMotor)
+ {
+ Speed = speed;
+ Weigth = weigth;
+ BodyColor = bodyColor;
+ AdditionalColor = additionalColor;
+ GunTurret = gunTurret;
+ Сompartment = compartment;
+ LinkorMotor = linkorMotor;
+ }
+
+}
diff --git a/ProjectSportCar/ProjectSportCar/Form1.Designer.cs b/ProjectSportCar/ProjectSportCar/Form1.Designer.cs
deleted file mode 100644
index f731df8..0000000
--- a/ProjectSportCar/ProjectSportCar/Form1.Designer.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace ProjectSportCar
-{
- 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/ProjectSportCar/ProjectSportCar/Form1.cs b/ProjectSportCar/ProjectSportCar/Form1.cs
deleted file mode 100644
index e71d17a..0000000
--- a/ProjectSportCar/ProjectSportCar/Form1.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace ProjectSportCar
-{
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/FormLinkor.Designer.cs b/ProjectSportCar/ProjectSportCar/FormLinkor.Designer.cs
new file mode 100644
index 0000000..4597716
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/FormLinkor.Designer.cs
@@ -0,0 +1,134 @@
+namespace ProjectLinkor
+{
+ partial class FormLinkor
+ {
+ ///
+ /// 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()
+ {
+ pictureBoxLinkor = new PictureBox();
+ buttonCreate = new Button();
+ buttonLeft = new Button();
+ buttonRight = new Button();
+ buttonUp = new Button();
+ buttonDown = new Button();
+ ((System.ComponentModel.ISupportInitialize)pictureBoxLinkor).BeginInit();
+ SuspendLayout();
+ //
+ // pictureBoxLinkor
+ //
+ pictureBoxLinkor.Dock = DockStyle.Fill;
+ pictureBoxLinkor.Location = new Point(0, 0);
+ pictureBoxLinkor.Name = "pictureBoxLinkor";
+ pictureBoxLinkor.Size = new Size(857, 474);
+ pictureBoxLinkor.TabIndex = 0;
+ pictureBoxLinkor.TabStop = false;
+ //
+ // buttonCreate
+ //
+ buttonCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ buttonCreate.Location = new Point(12, 433);
+ buttonCreate.Name = "buttonCreate";
+ buttonCreate.Size = new Size(94, 29);
+ buttonCreate.TabIndex = 1;
+ buttonCreate.Text = "Создать";
+ buttonCreate.UseVisualStyleBackColor = true;
+ buttonCreate.Click += ButtonCreate_Click;
+ //
+ // buttonLeft
+ //
+ buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonLeft.BackgroundImage = Properties.Resources.str_Left;
+ buttonLeft.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonLeft.Location = new Point(732, 427);
+ buttonLeft.Name = "buttonLeft";
+ buttonLeft.Size = new Size(35, 35);
+ buttonLeft.TabIndex = 2;
+ buttonLeft.UseVisualStyleBackColor = true;
+ buttonLeft.Click += ButtonMove_Click;
+ //
+ // buttonRight
+ //
+ buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonRight.BackgroundImage = Properties.Resources.str_Right;
+ buttonRight.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonRight.Location = new Point(814, 427);
+ buttonRight.Name = "buttonRight";
+ buttonRight.Size = new Size(35, 35);
+ buttonRight.TabIndex = 3;
+ buttonRight.UseVisualStyleBackColor = true;
+ buttonRight.Click += ButtonMove_Click;
+ //
+ // buttonUp
+ //
+ buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonUp.BackgroundImage = Properties.Resources.str_Up;
+ buttonUp.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonUp.Location = new Point(773, 387);
+ buttonUp.Name = "buttonUp";
+ buttonUp.Size = new Size(35, 35);
+ buttonUp.TabIndex = 4;
+ buttonUp.UseVisualStyleBackColor = true;
+ buttonUp.Click += ButtonMove_Click;
+ //
+ // buttonDown
+ //
+ buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ buttonDown.BackgroundImage = Properties.Resources.str_Down;
+ buttonDown.BackgroundImageLayout = ImageLayout.Stretch;
+ buttonDown.Location = new Point(773, 427);
+ buttonDown.Name = "buttonDown";
+ buttonDown.Size = new Size(35, 35);
+ buttonDown.TabIndex = 5;
+ buttonDown.UseVisualStyleBackColor = true;
+ buttonDown.Click += ButtonMove_Click;
+ //
+ // FormLinkor
+ //
+ AutoScaleDimensions = new SizeF(8F, 20F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(857, 474);
+ Controls.Add(buttonDown);
+ Controls.Add(buttonUp);
+ Controls.Add(buttonRight);
+ Controls.Add(buttonLeft);
+ Controls.Add(buttonCreate);
+ Controls.Add(pictureBoxLinkor);
+ Name = "FormLinkor";
+ Text = "Линкор";
+ ((System.ComponentModel.ISupportInitialize)pictureBoxLinkor).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private PictureBox pictureBoxLinkor;
+ private Button buttonCreate;
+ private Button buttonLeft;
+ private Button buttonRight;
+ private Button buttonUp;
+ private Button buttonDown;
+ }
+}
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/FormLinkor.cs b/ProjectSportCar/ProjectSportCar/FormLinkor.cs
new file mode 100644
index 0000000..a7c126b
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/FormLinkor.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ProjectLinkor
+{
+ public partial class FormLinkor : Form
+ {
+ private DrawningLinkor? _drawningLinkor;
+
+ public FormLinkor()
+ {
+ InitializeComponent();
+ }
+
+ private void Draw()
+ {
+
+ if (_drawningLinkor == null)
+ {
+ return;
+ }
+
+ Bitmap bmp = new(pictureBoxLinkor.Width, pictureBoxLinkor.Height);
+ Graphics gr = Graphics.FromImage(bmp);
+ _drawningLinkor.DrawTransport(gr);
+ pictureBoxLinkor.Image = bmp;
+ }
+
+ private void ButtonCreate_Click(object sender, EventArgs e)
+ {
+ Random random = new();
+ _drawningLinkor = new DrawningLinkor();
+ _drawningLinkor.Init(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)), Convert.ToBoolean(random.Next(0, 2)));
+ _drawningLinkor.SetPictureSize(pictureBoxLinkor.Width, pictureBoxLinkor.Height);
+ _drawningLinkor.SetPosition(random.Next(10, 100), random.Next(10, 100));
+
+ Draw();
+
+ }
+
+ private void ButtonMove_Click(object sender, EventArgs e)
+ {
+ if (_drawningLinkor == null)
+ {
+ return;
+ }
+
+ string name = ((Button)sender)?.Name ?? string.Empty;
+ bool result = false;
+ switch (name)
+ {
+ case "buttonUp":
+ result = _drawningLinkor.MoveTransport(DirectionType.Up);
+ break;
+ case "buttonDown":
+ result = _drawningLinkor.MoveTransport(DirectionType.Down);
+ break;
+ case "buttonLeft":
+ result = _drawningLinkor.MoveTransport(DirectionType.Left);
+ break;
+ case "buttonRight":
+ result = _drawningLinkor.MoveTransport(DirectionType.Right);
+ break;
+ }
+ if (result)
+ {
+ Draw();
+ }
+ }
+ }
+}
diff --git a/ProjectSportCar/ProjectSportCar/Form1.resx b/ProjectSportCar/ProjectSportCar/FormLinkor.resx
similarity index 93%
rename from ProjectSportCar/ProjectSportCar/Form1.resx
rename to ProjectSportCar/ProjectSportCar/FormLinkor.resx
index 1af7de1..af32865 100644
--- a/ProjectSportCar/ProjectSportCar/Form1.resx
+++ b/ProjectSportCar/ProjectSportCar/FormLinkor.resx
@@ -1,17 +1,17 @@
-
diff --git a/ProjectSportCar/ProjectSportCar/Program.cs b/ProjectSportCar/ProjectSportCar/Program.cs
index 8103843..47c425a 100644
--- a/ProjectSportCar/ProjectSportCar/Program.cs
+++ b/ProjectSportCar/ProjectSportCar/Program.cs
@@ -1,4 +1,4 @@
-namespace ProjectSportCar
+namespace ProjectLinkor
{
internal static class Program
{
@@ -11,7 +11,7 @@ namespace ProjectSportCar
// 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 FormLinkor());
}
}
}
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/ProjectLinkor.csproj b/ProjectSportCar/ProjectSportCar/ProjectLinkor.csproj
new file mode 100644
index 0000000..244387d
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/ProjectLinkor.csproj
@@ -0,0 +1,26 @@
+
+
+
+ WinExe
+ net7.0-windows
+ enable
+ true
+ enable
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/ProjectSportCar.csproj b/ProjectSportCar/ProjectSportCar/ProjectSportCar.csproj
deleted file mode 100644
index e1a0735..0000000
--- a/ProjectSportCar/ProjectSportCar/ProjectSportCar.csproj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- WinExe
- net7.0-windows
- enable
- true
- enable
-
-
-
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/Properties/Resources.Designer.cs b/ProjectSportCar/ProjectSportCar/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..39c8623
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/Properties/Resources.Designer.cs
@@ -0,0 +1,103 @@
+//------------------------------------------------------------------------------
+//
+// Этот код создан программой.
+// Исполняемая версия:4.0.30319.42000
+//
+// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+// повторной генерации кода.
+//
+//------------------------------------------------------------------------------
+
+namespace ProjectLinkor.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("ProjectLinkor.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 str_Down {
+ get {
+ object obj = ResourceManager.GetObject("str.Down", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap str_Left {
+ get {
+ object obj = ResourceManager.GetObject("str.Left", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap str_Right {
+ get {
+ object obj = ResourceManager.GetObject("str.Right", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Поиск локализованного ресурса типа System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap str_Up {
+ get {
+ object obj = ResourceManager.GetObject("str.Up", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/ProjectSportCar/ProjectSportCar/Properties/Resources.resx b/ProjectSportCar/ProjectSportCar/Properties/Resources.resx
new file mode 100644
index 0000000..49d6c3f
--- /dev/null
+++ b/ProjectSportCar/ProjectSportCar/Properties/Resources.resx
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+
+ ..\Resources\str.Down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\str.Left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\str.Right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\str.Up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/ProjectSportCar/ProjectSportCar/Resources/str.Down.png b/ProjectSportCar/ProjectSportCar/Resources/str.Down.png
new file mode 100644
index 0000000..53b123f
Binary files /dev/null and b/ProjectSportCar/ProjectSportCar/Resources/str.Down.png differ
diff --git a/ProjectSportCar/ProjectSportCar/Resources/str.Left.png b/ProjectSportCar/ProjectSportCar/Resources/str.Left.png
new file mode 100644
index 0000000..e0c5f06
Binary files /dev/null and b/ProjectSportCar/ProjectSportCar/Resources/str.Left.png differ
diff --git a/ProjectSportCar/ProjectSportCar/Resources/str.Right.png b/ProjectSportCar/ProjectSportCar/Resources/str.Right.png
new file mode 100644
index 0000000..32e9aa4
Binary files /dev/null and b/ProjectSportCar/ProjectSportCar/Resources/str.Right.png differ
diff --git a/ProjectSportCar/ProjectSportCar/Resources/str.Up.png b/ProjectSportCar/ProjectSportCar/Resources/str.Up.png
new file mode 100644
index 0000000..ae99fbe
Binary files /dev/null and b/ProjectSportCar/ProjectSportCar/Resources/str.Up.png differ