From 138eb45634d24032cbc1fee8427c847a508c81fb Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Fri, 6 Oct 2023 20:34:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=BD=D1=8B=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lab1ContainersShip/DrawingShip.cs | 6 + ...igner.cs => FormContainerShip.Designer.cs} | 0 .../{Form1.cs => FormContainerShip.cs} | 0 .../{Form1.resx => FormContainerShip.resx} | 0 .../Lab1ContainersShip.csproj | 12 +- .../Lab1ContainersShip/Program.cs | 2 +- .../Lab1ContainersShip/SetGeneric.cs | 12 ++ .../Lab1ContainersShip/ShipCollection.resx | 120 ++++++++++++++++++ .../ShipGenericCollection.cs | 12 ++ 9 files changed, 158 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%) create mode 100644 Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs create mode 100644 Lab1ContainersShip/Lab1ContainersShip/ShipCollection.resx create mode 100644 Lab1ContainersShip/Lab1ContainersShip/ShipGenericCollection.cs diff --git a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs index a080e88..f2c0173 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs +++ b/Lab1ContainersShip/Lab1ContainersShip/DrawingShip.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Lab1ContainersShip.Entities; +using Lab1ContainersShip.MovementStrategy; namespace Lab1ContainersShip.DrawingObjects { @@ -52,6 +53,11 @@ namespace Lab1ContainersShip.DrawingObjects /// Высота объекта /// public int GetHeight => _shipHeight; + /// + /// Получение объекта IMoveableObject из объекта DrawningCar + /// + public IMoveableObject GetMoveableObject => new + DrawningObjectShip(this); public bool CanMove(Direction direction) { if(EntityShip == null) return false; 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..7225e59 100644 --- a/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj +++ b/Lab1ContainersShip/Lab1ContainersShip/Lab1ContainersShip.csproj @@ -47,17 +47,18 @@ + - + Form - - Form1.cs + + FormContainerShip.cs @@ -65,9 +66,10 @@ + - - 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()); } } } diff --git a/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs b/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs new file mode 100644 index 0000000..495a8d2 --- /dev/null +++ b/Lab1ContainersShip/Lab1ContainersShip/SetGeneric.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lab1ContainersShip +{ + internal class SetGeneric + { + } +} diff --git a/Lab1ContainersShip/Lab1ContainersShip/ShipCollection.resx b/Lab1ContainersShip/Lab1ContainersShip/ShipCollection.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Lab1ContainersShip/Lab1ContainersShip/ShipCollection.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/Lab1ContainersShip/Lab1ContainersShip/ShipGenericCollection.cs b/Lab1ContainersShip/Lab1ContainersShip/ShipGenericCollection.cs new file mode 100644 index 0000000..6f54fb0 --- /dev/null +++ b/Lab1ContainersShip/Lab1ContainersShip/ShipGenericCollection.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lab1ContainersShip +{ + internal class CarsGenericCollection + { + } +}