Еще немного изменений.
This commit is contained in:
parent
7132f8f322
commit
cc7aadb10d
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user