From e90db55dcc1294e40a6c2d157762b40dc0a878d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A3=D1=87=D0=B5=D0=B1=D0=BD=D1=8B=D0=B9?= Date: Sun, 26 Nov 2023 17:32:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DrawningObjects/DrawningBoat.cs | 15 +++++---- .../DrawningObjects/DrawningMotorBoat.cs | 31 +++++++------------ .../ProjectBoat_bae/ExtentionBoat.cs | 2 +- .../FormBoatConfig.Designer.cs | 12 +++---- .../Generics/BoatsGenericCollection.cs | 6 ++-- 5 files changed, 29 insertions(+), 37 deletions(-) diff --git a/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningBoat.cs b/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningBoat.cs index 4b1a586..1932b36 100644 --- a/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningBoat.cs +++ b/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningBoat.cs @@ -33,10 +33,10 @@ namespace ProjectBoat_bae.DrawningObjects protected int _startPosY; // Ширина прорисовки - protected readonly int _boatWidth = 80; + protected readonly int _boatWidth = 70; // Высота прорисовки - protected readonly int _boatHeight = 50; + protected readonly int _boatHeight = 40; public int GetPosX => _startPosX; public int GetPosY => _startPosY; @@ -88,18 +88,17 @@ namespace ProjectBoat_bae.DrawningObjects Pen pen = new(Color.Black); //корпус Brush br = new SolidBrush(EntityBoat.BodyColor); - g.FillRectangle(br, _startPosX + 20, _startPosY + 5, 100, 50); + g.FillRectangle(br, _startPosX + 20, _startPosY + 65, 80, 50); //мотор Brush brRed = new SolidBrush(EntityBoat.BodyColor); - g.FillEllipse(brRed, _startPosX + 7, _startPosY + 12, 35, 35); + g.FillEllipse(brRed, _startPosX + 7, _startPosY + 72, 35, 35); //стекла Brush brBlue = new SolidBrush(Color.LightBlue); - g.FillRectangle(brBlue, _startPosX + 115, _startPosY + 10, 5, - 40); - g.FillRectangle(brBlue, _startPosX + 65, _startPosY + 8, 55, 2); - g.FillRectangle(brBlue, _startPosX + 65, _startPosY + 51, 55, 2); + g.FillRectangle(brBlue, _startPosX + 95, _startPosY + 67, 5, 45); + g.FillRectangle(brBlue, _startPosX + 45, _startPosY + 67, 55, 2); + g.FillRectangle(brBlue, _startPosX + 45, _startPosY + 111, 55, 2); } // Проверка, что объект может переместится по указанному направлению diff --git a/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningMotorBoat.cs b/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningMotorBoat.cs index dca6159..7ecc25d 100644 --- a/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningMotorBoat.cs +++ b/ProjectBoat_base/ProjectBoat_bae/DrawningObjects/DrawningMotorBoat.cs @@ -32,6 +32,7 @@ namespace ProjectBoat_bae.DrawningObjects { return; } + Point[] points; Pen pen = new(Color.Black); Brush additionalBrush = new SolidBrush(Boat.AdditionalColor); Brush brr = new SolidBrush(EntityBoat.BodyColor); @@ -39,26 +40,18 @@ namespace ProjectBoat_bae.DrawningObjects if (Boat.Wing) { //вёсла - g.FillRectangle(additionalBrush, _startPosX + 35, _startPosY - 5, 5, 65); - g.FillRectangle(additionalBrush, _startPosX + 28, _startPosY + 60, 12, 8); - g.FillRectangle(additionalBrush, _startPosX + 28, _startPosY - 5, 12, 8); - } - - //флажок - Point[] points; - if (Boat.Body) - { - points = new Point[] - { - new Point(Convert.ToInt32(_startPosX+70),Convert.ToInt32(_startPosY-20)), - new Point(Convert.ToInt32(_startPosX+70),Convert.ToInt32(_startPosY+10)), - new Point(Convert.ToInt32(_startPosX+90),Convert.ToInt32(_startPosY)), - new Point(Convert.ToInt32(_startPosX+90),Convert.ToInt32(_startPosY-20)), - }; - g.FillPolygon(additionalBrush, points); - g.DrawPolygon(pen, points); - } + g.FillRectangle(additionalBrush, _startPosX + 35, _startPosY + 40, 5, 100); + g.FillRectangle(additionalBrush, _startPosX + 28, _startPosY + 40, 12, 8); + g.FillRectangle(additionalBrush, _startPosX + 28, _startPosY + 135, 12, 8); + } + base.DrawTransport(g); + + //кресла + if (Boat.Body) + { + g.FillRectangle(additionalBrush, _startPosX + 58, _startPosY + 70, 25, 40); + } } } } diff --git a/ProjectBoat_base/ProjectBoat_bae/ExtentionBoat.cs b/ProjectBoat_base/ProjectBoat_bae/ExtentionBoat.cs index 333bd46..f089938 100644 --- a/ProjectBoat_base/ProjectBoat_bae/ExtentionBoat.cs +++ b/ProjectBoat_base/ProjectBoat_bae/ExtentionBoat.cs @@ -16,7 +16,7 @@ namespace ProjectBoat_bae private static readonly char _separatorForObject = ':'; // Создание объекта из строки - public static Drawningboat CreateDrawningBoat(this string info, char _separatorForObject, int _pictureWidth) + public static Drawningboat CreateDrawningBoat(this string info, char _separatorForObject, int _pictureWidth, int _pictureHeight) { string[] strs = info.Split(_separatorForObject); if (strs.Length == 3) diff --git a/ProjectBoat_base/ProjectBoat_bae/FormBoatConfig.Designer.cs b/ProjectBoat_base/ProjectBoat_bae/FormBoatConfig.Designer.cs index 14605c7..c2d26d7 100644 --- a/ProjectBoat_base/ProjectBoat_bae/FormBoatConfig.Designer.cs +++ b/ProjectBoat_base/ProjectBoat_bae/FormBoatConfig.Designer.cs @@ -64,9 +64,9 @@ // // pictureBoxObject // - pictureBoxObject.Location = new Point(38, 76); + pictureBoxObject.Location = new Point(38, 30); pictureBoxObject.Name = "pictureBoxObject"; - pictureBoxObject.Size = new Size(388, 282); + pictureBoxObject.Size = new Size(388, 328); pictureBoxObject.TabIndex = 0; pictureBoxObject.TabStop = false; // @@ -237,9 +237,9 @@ checkBoxBoat.AutoSize = true; checkBoxBoat.Location = new Point(21, 176); checkBoxBoat.Name = "checkBoxBoat"; - checkBoxBoat.Size = new Size(246, 29); + checkBoxBoat.Size = new Size(240, 29); checkBoxBoat.TabIndex = 6; - checkBoxBoat.Text = "Признак наличия флажка"; + checkBoxBoat.Text = "Признак наличия кресел"; checkBoxBoat.UseVisualStyleBackColor = true; // // Weight @@ -279,7 +279,7 @@ LabelAdditionalColor.AllowDrop = true; LabelAdditionalColor.AutoSize = true; LabelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; - LabelAdditionalColor.Location = new Point(333, 38); + LabelAdditionalColor.Location = new Point(333, 0); LabelAdditionalColor.Name = "LabelAdditionalColor"; LabelAdditionalColor.Size = new Size(93, 27); LabelAdditionalColor.TabIndex = 1; @@ -292,7 +292,7 @@ LabelColor.AllowDrop = true; LabelColor.AutoSize = true; LabelColor.BorderStyle = BorderStyle.FixedSingle; - LabelColor.Location = new Point(38, 38); + LabelColor.Location = new Point(38, 0); LabelColor.Name = "LabelColor"; LabelColor.Size = new Size(53, 27); LabelColor.TabIndex = 0; diff --git a/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericCollection.cs b/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericCollection.cs index 3d1a940..6ba6021 100644 --- a/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericCollection.cs +++ b/ProjectBoat_base/ProjectBoat_bae/Generics/BoatsGenericCollection.cs @@ -20,10 +20,10 @@ namespace ProjectBoat_bae.Generics /// /// Размер занимаемого объектом места (ширина) /// - private readonly int _placeSizeWidth = 100; + private readonly int _placeSizeWidth = 150; // Размер занимаемого объектом места (высота) - private readonly int _placeSizeHeight = 70; + private readonly int _placeSizeHeight = 150; // Набор объектов private readonly SetGeneric _collection; @@ -110,6 +110,6 @@ namespace ProjectBoat_bae.Generics } // Получение объектов коллекции - public IEnumerable GetCars => _collection.GetBoats(); + public IEnumerable GetBoats => _collection.GetBoats(); } }