diff --git a/Liner/Liner/DrawingLiner.cs b/Liner/Liner/DrawingLiner.cs index 28d4270..9ae0a3f 100644 --- a/Liner/Liner/DrawingLiner.cs +++ b/Liner/Liner/DrawingLiner.cs @@ -13,14 +13,7 @@ namespace Liner { Ship = new EntityLiner(speed, weight, bodyColor, dopColor, dopDeck, pool); } - public void SetDopColor(Color color) - { - if (Ship is not EntityLiner liner) - { - return; - } - liner.DopColor = color; - } + public override void DrawTransport(Graphics g) { if (Ship is not EntityLiner liner) diff --git a/Liner/Liner/DrawingShip.cs b/Liner/Liner/DrawingShip.cs index 156fc36..427c1ac 100644 --- a/Liner/Liner/DrawingShip.cs +++ b/Liner/Liner/DrawingShip.cs @@ -25,10 +25,7 @@ namespace Liner _ShipWidth = shipWidth; _ShipHeight = shipHeight; } - public void SetColor(Color color) - { - Ship.BodyColor = color; - } + public void SetPosition(int x, int y, int width, int height) { if (width <= _ShipWidth + x || height <= _ShipHeight + y || x<0 || y<0) diff --git a/Liner/Liner/FormShipConfig.cs b/Liner/Liner/FormShipConfig.cs index 169e877..64b7914 100644 --- a/Liner/Liner/FormShipConfig.cs +++ b/Liner/Liner/FormShipConfig.cs @@ -97,16 +97,16 @@ namespace Liner { return; } - _ship.SetColor((Color)e.Data.GetData(typeof(Color))); + _ship.Ship.BodyColor=(Color)e.Data.GetData(typeof(Color)); DrawShip(); } private void LabelDopColor_DragDrop(object sender, DragEventArgs e) { - if (_ship == null || _ship is not DrawningLiner liner) + if (_ship == null || _ship.Ship is not EntityLiner liner) { return; } - liner.SetDopColor((Color)e.Data.GetData(typeof(Color))); + liner.DopColor=(Color)e.Data.GetData(typeof(Color)); DrawShip(); } private void ButtonAdd_Click(object sender, EventArgs e)