From 2b2a373f1aa8310b90f25f70c8cfb285d56d7bbd Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Fri, 6 Oct 2023 20:40:01 +0400 Subject: [PATCH 1/5] =?UTF-8?q?=D0=B8=D1=82=D0=BE=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Form1.Designer.cs => FormContainerShip.Designer.cs} | 0 .../{Form1.cs => FormContainerShip.cs} | 0 .../{Form1.resx => FormContainerShip.resx} | 0 .../Lab1ContainersShip/Lab1ContainersShip.csproj | 10 +++++----- Lab1ContainersShip/Lab1ContainersShip/Program.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename Lab1ContainersShip/Lab1ContainersShip/{Form1.Designer.cs => FormContainerShip.Designer.cs} (100%) rename Lab1ContainersShip/Lab1ContainersShip/{Form1.cs => FormContainerShip.cs} (100%) rename Lab1ContainersShip/Lab1ContainersShip/{Form1.resx => FormContainerShip.resx} (100%) diff --git a/Lab1ContainersShip/Lab1ContainersShip/Form1.Designer.cs b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs similarity index 100% rename from Lab1ContainersShip/Lab1ContainersShip/Form1.Designer.cs rename to Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs diff --git a/Lab1ContainersShip/Lab1ContainersShip/Form1.cs b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs similarity index 100% rename from Lab1ContainersShip/Lab1ContainersShip/Form1.cs rename to Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs diff --git a/Lab1ContainersShip/Lab1ContainersShip/Form1.resx b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.resx similarity index 100% rename from Lab1ContainersShip/Lab1ContainersShip/Form1.resx rename to Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.resx diff --git a/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj b/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj index 9456ae0..1a1e0d6 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj +++ b/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj @@ -53,11 +53,11 @@ - + Form - - Form1.cs + + FormContainerShip.cs @@ -66,8 +66,8 @@ - - Form1.cs + + FormContainerShip.cs ResXFileCodeGenerator diff --git a/Lab1ContainersShip/Lab1ContainersShip/Program.cs b/Lab1ContainersShip/Lab1ContainersShip/Program.cs index c4c1a15..e6271c4 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/Program.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/Program.cs @@ -16,7 +16,7 @@ namespace Lab1ContainersShip { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new FormContainerShip()); } } } From ec4543b521162795022e51e4e452d333a407f9d9 Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Fri, 6 Oct 2023 20:40:43 +0400 Subject: [PATCH 2/5] =?UTF-8?q?=D0=B8=D1=82=D0=BE=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lab1ContainersShip/FormContainerShip.Designer.cs | 2 +- Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs index 9b828dc..767edb8 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.Designer.cs @@ -1,6 +1,6 @@ namespace Lab1ContainersShip { - partial class Form1 + partial class FormContainerShip { /// /// Обязательная переменная конструктора. diff --git a/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs index 184991b..1c4c918 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/FormContainerShip.cs @@ -12,7 +12,7 @@ using Lab1ContainersShip.MovementStrategy; namespace Lab1ContainersShip { - public partial class Form1 : Form + public partial class FormContainerShip : Form { private DrawingShip _drawingShip; @@ -20,7 +20,7 @@ namespace Lab1ContainersShip private AbstractStrategy _abstractStrategy; - public Form1() + public FormContainerShip() { InitializeComponent(); } From 92cdbb3813c79100007f08c7fcb502d831b96bef Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Tue, 10 Oct 2023 12:10:05 +0400 Subject: [PATCH 3/5] =?UTF-8?q?=D1=81=D0=B4=D0=B0=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs | 3 ++- Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs | 4 ++++ Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs index a080e88..3eec57f 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs @@ -151,8 +151,9 @@ namespace Lab1ContainersShip.DrawingObjects Pen pen = new Pen(Color.Black); //Brush adbrush = new SolidBrush(EntityShip.AdditionalColor); Brush brBlue = new SolidBrush(Color.Blue); + Brush brBody = new SolidBrush(EntityShip.BodyColor); // заполнение борта - g.FillPolygon(brBlue, new PointF[] + g.FillPolygon(brBody, new PointF[] { new PointF(_startPosX, _startPosY+45), new PointF(_startPosX+20, _startPosY+65), diff --git a/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs b/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs index 6cd7276..a936e3a 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs @@ -32,5 +32,9 @@ namespace Lab1ContainersShip.MovementStrategy _drawingShip?.CanMove(direction) ?? false; public void MoveObject(Direction direction) => _drawingShip?.MoveTransport(direction); + public void DopMeth(Direction direction) + { + Console.WriteLine("метод работает" + direction); + } } } diff --git a/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs b/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs index 80123fa..13e9fda 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs @@ -31,6 +31,7 @@ namespace Lab1ContainersShip.MovementStrategy /// /// Направление void MoveObject(Direction direction); + void DopMeth(Direction direction); } } From 72b2d823c71d7d938b36262aeef910434fdcd81f Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Tue, 10 Oct 2023 12:10:43 +0400 Subject: [PATCH 4/5] =?UTF-8?q?=D1=81=D0=B4=D0=B0=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs | 5 +---- Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs b/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs index a936e3a..ab6de85 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/DrawningObjectShip.cs @@ -32,9 +32,6 @@ namespace Lab1ContainersShip.MovementStrategy _drawingShip?.CanMove(direction) ?? false; public void MoveObject(Direction direction) => _drawingShip?.MoveTransport(direction); - public void DopMeth(Direction direction) - { - Console.WriteLine("метод работает" + direction); - } + } } diff --git a/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs b/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs index 13e9fda..3522b86 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/IMoveableObject.cs @@ -31,7 +31,7 @@ namespace Lab1ContainersShip.MovementStrategy /// /// Направление void MoveObject(Direction direction); - void DopMeth(Direction direction); + } } From 811e02b7bd2a5f18c0c38dff55ff400cda48cc9a Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Fri, 20 Oct 2023 17:22:41 +0400 Subject: [PATCH 5/5] =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs | 3 +-- Lab1ContainersShip/Lab1ContainersShip/EntityShip.cs | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs index 3eec57f..aa1e6b8 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs @@ -149,8 +149,7 @@ namespace Lab1ContainersShip.DrawingObjects return; } Pen pen = new Pen(Color.Black); - //Brush adbrush = new SolidBrush(EntityShip.AdditionalColor); - Brush brBlue = new SolidBrush(Color.Blue); + Brush brBody = new SolidBrush(EntityShip.BodyColor); // заполнение борта g.FillPolygon(brBody, new PointF[] diff --git a/Lab1ContainersShip/Lab1ContainersShip/EntityShip.cs b/Lab1ContainersShip/Lab1ContainersShip/EntityShip.cs index c3cc52e..1410765 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/EntityShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/EntityShip.cs @@ -24,17 +24,16 @@ namespace Lab1ContainersShip.Entities /// /// Дополнительный цвет (для опциональных элементов) /// - //public Color AdditionalColor { get; private set; } - + /// /// Признак (опция) наличия крана /// - //public bool Crane { get; private set; } + /// /// Признак (опция) наличия контейнеров /// - //public bool Conteiners { get; private set; } + public double Step => (double)Speed * 100 / Weight; public EntityShip(int speed, double weight, Color bodyColor) {