PIbd-11 Valiulov I.A. LabWork05 Simple #5
@ -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 совместимость объекта с заданным типом
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user