From 6434af34fabc2b9b1ca6408b4e97ed4a840d4e8d Mon Sep 17 00:00:00 2001 From: IlyasValiulov <148232695+IlyasValiulov@users.noreply.github.com> Date: Sun, 31 Mar 2024 13:41:58 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=B0=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=965=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectWarmlyShip/Drawnings/DrawningWarmlyShip.cs | 4 ---- ProjectWarmlyShip/ProjectWarmlyShip/FormShipConfig.cs | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ProjectWarmlyShip/ProjectWarmlyShip/Drawnings/DrawningWarmlyShip.cs b/ProjectWarmlyShip/ProjectWarmlyShip/Drawnings/DrawningWarmlyShip.cs index b01d039..fd00dc6 100644 --- a/ProjectWarmlyShip/ProjectWarmlyShip/Drawnings/DrawningWarmlyShip.cs +++ b/ProjectWarmlyShip/ProjectWarmlyShip/Drawnings/DrawningWarmlyShip.cs @@ -14,10 +14,6 @@ public class DrawningWarmlyShip : DrawningShip { EntityShip = new EntityWarmlyShip(speed, weight, bodycolor, additionalcolor, shpipipes, fueltank); //дописать конструктор } - public void setAdditionalColor(Color color) - { - ((EntityWarmlyShip)EntityShip).setAdditionalColor(color); - } public override void DrawTransport(Graphics g) { //оператор is совместимость объекта с заданным типом diff --git a/ProjectWarmlyShip/ProjectWarmlyShip/FormShipConfig.cs b/ProjectWarmlyShip/ProjectWarmlyShip/FormShipConfig.cs index ecd4c08..c8740da 100644 --- a/ProjectWarmlyShip/ProjectWarmlyShip/FormShipConfig.cs +++ b/ProjectWarmlyShip/ProjectWarmlyShip/FormShipConfig.cs @@ -1,4 +1,5 @@ using ProjectWarmlyShip.Drawnings; +using ProjectWarmlyShip.Entities; namespace ProjectWarmlyShip; @@ -114,10 +115,9 @@ public partial class FormShipConfig : Form private void labelAdditionalColor_DragDrop(object sender, DragEventArgs e) { - if (_ship is DrawningWarmlyShip _warmlyship) + if (_ship.EntityShip is EntityWarmlyShip _warmlyship) { _warmlyship.setAdditionalColor((Color)e.Data.GetData(typeof(Color))); - } DrawObject(); }