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(); }