Лабараторная работа №5 1
This commit is contained in:
parent
330dffaa87
commit
6434af34fa
@ -14,10 +14,6 @@ public class DrawningWarmlyShip : DrawningShip
|
|||||||
{
|
{
|
||||||
EntityShip = new EntityWarmlyShip(speed, weight, bodycolor, additionalcolor, shpipipes, fueltank); //дописать конструктор
|
EntityShip = new EntityWarmlyShip(speed, weight, bodycolor, additionalcolor, shpipipes, fueltank); //дописать конструктор
|
||||||
}
|
}
|
||||||
public void setAdditionalColor(Color color)
|
|
||||||
{
|
|
||||||
((EntityWarmlyShip)EntityShip).setAdditionalColor(color);
|
|
||||||
}
|
|
||||||
public override void DrawTransport(Graphics g)
|
public override void DrawTransport(Graphics g)
|
||||||
{
|
{
|
||||||
//оператор is совместимость объекта с заданным типом
|
//оператор is совместимость объекта с заданным типом
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using ProjectWarmlyShip.Drawnings;
|
using ProjectWarmlyShip.Drawnings;
|
||||||
|
using ProjectWarmlyShip.Entities;
|
||||||
|
|
||||||
namespace ProjectWarmlyShip;
|
namespace ProjectWarmlyShip;
|
||||||
|
|
||||||
@ -114,10 +115,9 @@ public partial class FormShipConfig : Form
|
|||||||
|
|
||||||
private void labelAdditionalColor_DragDrop(object sender, DragEventArgs e)
|
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)));
|
_warmlyship.setAdditionalColor((Color)e.Data.GetData(typeof(Color)));
|
||||||
|
|
||||||
}
|
}
|
||||||
DrawObject();
|
DrawObject();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user