From 679f01efecae25a2a120a6588120c2f028ace446 Mon Sep 17 00:00:00 2001 From: KirillFirsof <117719052+KirillFirsof@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:58:51 +0400 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BA=D0=BE=D0=BD=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln | 2 +- .../RPP_FirstLaba_Tractor/AbstractStrategy.cs | 4 ++-- .../RPP_FirstLaba_Tractor/DirectionType.cs | 2 +- .../RPP_FirstLaba_Tractor/DrawningBulldoser.cs | 5 +++-- .../DrawningObjectTractor.cs | 9 +++++++-- .../RPP_FirstLaba_Tractor/DrawningTractor.cs | 6 +++--- .../RPP_FirstLaba_Tractor/EntityBulldoser.cs | 2 +- .../RPP_FirstLaba_Tractor/EntityTractor.cs | 2 +- .../RPP_FirstLaba_Tractor/FormTractor.cs | 15 ++++++++------- .../RPP_FirstLaba_Tractor/IMoveableObject.cs | 4 +++- .../RPP_FirstLaba_Tractor/MoveToBorder.cs | 2 +- .../RPP_FirstLaba_Tractor/MoveToCenter.cs | 2 +- .../RPP_FirstLaba_Tractor/ObjectParameters.cs | 2 +- .../RPP_FirstLaba_Tractor/Program.cs | 2 +- ...tLaba_Tractor.csproj => ProjectTractor.csproj} | 0 .../Properties/Resources.Designer.cs | 4 ++-- .../RPP_FirstLaba_Tractor/Status.cs | 2 +- 17 files changed, 37 insertions(+), 28 deletions(-) rename RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/{RPP_FirstLaba_Tractor.csproj => ProjectTractor.csproj} (100%) diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln index f5b346e..0be4f9c 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.sln +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "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 index ac1f0f9..f3605ef 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/AbstractStrategy.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/AbstractStrategy.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using RPP_FirstLaba_Tractor.DrawningObjects; +using ProjectTractor.DrawningObjects; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Класс-стратегия перемещения объекта diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs index c561ded..5489883 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DirectionType.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor +namespace ProjectTractor { public enum DirectionType { diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs index f179a96..ca3eb8a 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningBulldoser.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using RPP_FirstLaba_Tractor.Entities; +using ProjectTractor.Entities; -namespace RPP_FirstLaba_Tractor.DrawningObjects +namespace ProjectTractor.DrawningObjects { /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности @@ -44,6 +44,7 @@ namespace RPP_FirstLaba_Tractor.DrawningObjects SolidBrush(bulldoser.AdditionalColor); base.DrawTransport(g); + // орнамент на колесах if (bulldoser.WheelsOrnament) { g.FillEllipse(additionalBrush, _startPosX + 2, _startPosY + 47, 11, 11); diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs index 969c4ee..48469c8 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningObjectTractor.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using RPP_FirstLaba_Tractor.DrawningObjects; +using ProjectTractor.DrawningObjects; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Реализация интерфейса IDrawningObject для работы с объектом DrawningTractor(паттерн Adapter) @@ -35,6 +35,11 @@ namespace RPP_FirstLaba_Tractor.MovementStrategy _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 index a888485..c5af8d8 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningTractor.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/DrawningTractor.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using RPP_FirstLaba_Tractor.Entities; +using ProjectTractor.Entities; -namespace RPP_FirstLaba_Tractor.DrawningObjects { +namespace ProjectTractor.DrawningObjects { /// /// Класс, отвечающий за прорисовку и перемещение объекта-сущности @@ -115,7 +115,7 @@ namespace RPP_FirstLaba_Tractor.DrawningObjects { DirectionType.Up => _startPosY - EntityTractor.Step > 0, // вправо DirectionType.Right => _startPosX + EntityTractor.Step + _tractorWidth < _pictureWidth, - //вниз + // вниз DirectionType.Down => _startPosY + EntityTractor.Step + _tractorHeight < _pictureHeight, _ => false, }; diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs index 29be4a0..b71fcd3 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityBulldoser.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.Entities +namespace ProjectTractor.Entities { /// /// Класс-сущность "Спортивный автомобиль" diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs index 8a7e41a..17d046f 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/EntityTractor.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.Entities +namespace ProjectTractor.Entities { /// /// Класс-сущность "Автомобиль" diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs index 551ed9f..4dcb86d 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/FormTractor.cs @@ -1,9 +1,10 @@ -using RPP_FirstLaba_Tractor.MovementStrategy; -using RPP_FirstLaba_Tractor.DrawningObjects; +using ProjectTractor.MovementStrategy; +using ProjectTractor.DrawningObjects; -namespace RPP_FirstLaba_Tractor +namespace ProjectTractor { + /// /// " " /// @@ -145,7 +146,7 @@ namespace RPP_FirstLaba_Tractor // buttonTop // this.buttonTop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonTop.BackgroundImage = global::RPP_FirstLaba_Tractor.Properties.Resources.arrowUp; + 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"; @@ -157,7 +158,7 @@ namespace RPP_FirstLaba_Tractor // buttonLeft // this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::RPP_FirstLaba_Tractor.Properties.Resources.arrowLeft; + 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"; @@ -169,7 +170,7 @@ namespace RPP_FirstLaba_Tractor // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::RPP_FirstLaba_Tractor.Properties.Resources.arrowDown; + 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"; @@ -181,7 +182,7 @@ namespace RPP_FirstLaba_Tractor // buttonRight // this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::RPP_FirstLaba_Tractor.Properties.Resources.arrowRight; + 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"; diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs index 7280b11..0c9d616 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/IMoveableObject.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Интерфейс для работы с перемещаемым объектом @@ -30,6 +30,8 @@ namespace RPP_FirstLaba_Tractor.MovementStrategy /// /// Направление void MoveObject(DirectionType direction); + + } } diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs index e199e27..362ec52 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToBorder.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Стратегия перемещения объекта в центр экрана diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs index 1e35672..48d09d4 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/MoveToCenter.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Стратегия перемещения объекта в центр экрана diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs index 0ccabc4..e75f70f 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ObjectParameters.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Параметры-координаты объекта diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Program.cs index 7556447..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 { diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.csproj b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ProjectTractor.csproj similarity index 100% rename from RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor.csproj rename to RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/ProjectTractor.csproj diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs index 86bf022..112e027 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace RPP_FirstLaba_Tractor.Properties { +namespace ProjectTractor.Properties { using System; @@ -39,7 +39,7 @@ namespace RPP_FirstLaba_Tractor.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RPP_FirstLaba_Tractor.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectTractor.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs index 9303eda..6cb1b3d 100644 --- a/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs +++ b/RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/Status.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace RPP_FirstLaba_Tractor.MovementStrategy +namespace ProjectTractor.MovementStrategy { /// /// Статус выполнения операции перемещения