PIbd-11 Valiulov I.A. LabWork05 Simple #5

Closed
Ilyas wants to merge 3 commits from LabWork05 into LabWork04
2 changed files with 2 additions and 6 deletions
Showing only changes of commit 6434af34fa - Show all commits

View File

@ -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 совместимость объекта с заданным типом

View File

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