DraeningSeaplane без рисовки
This commit is contained in:
parent
71d01b9f6e
commit
7feba0a042
@ -22,61 +22,25 @@ public class DrawingSeaplane : DrawningPlane
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Изменение направления перемещения
|
|
||||||
/// </summary>
|
public override void DrawTransport(Graphics g)
|
||||||
/// <param name="direction"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool MoveTransport(DirectionType direction)
|
|
||||||
{
|
{
|
||||||
if (EntitySeaplane == null || !_startPosX.HasValue || !_startPosY.HasValue)
|
if (EntityPlane == null || EntityPlane is not EntitySeaplane seaplane || !_startPosX.HasValue! || _startPosY.HasValue )
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
|
||||||
switch (direction)
|
|
||||||
{
|
|
||||||
//влево
|
|
||||||
case DirectionType.Left:
|
|
||||||
if (_startPosX.Value - EntitySeaplane.Step > 0)
|
|
||||||
{
|
|
||||||
_startPosX -= (int)EntitySeaplane.Step;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
//вверх
|
|
||||||
case DirectionType.Up:
|
|
||||||
if (_startPosY.Value - EntitySeaplane.Step > 0)
|
|
||||||
{
|
|
||||||
_startPosY -= (int)EntitySeaplane.Step;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
// вправо
|
|
||||||
case DirectionType.Right:
|
|
||||||
if (_startPosX.Value + _drawningPlaneWidth + EntitySeaplane.Step < _pictureWidth)
|
|
||||||
{
|
|
||||||
_startPosX += (int)EntitySeaplane.Step;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
//вниз
|
|
||||||
case DirectionType.Down:
|
|
||||||
if (_startPosY.Value + _drawningPlaneHeight + EntitySeaplane.Step < _pictureHeight)
|
|
||||||
{
|
|
||||||
_startPosY += (int)EntitySeaplane.Step;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base.DrawTransport(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Прорисовка объекта
|
/// Прорисовка объекта
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="g"></param>
|
/// <param name="g"></param>
|
||||||
public void DrawTransport(Graphics g)
|
public void DrawTransport(Graphics g)
|
||||||
{
|
{
|
||||||
if (EntitySeaplane == null || !_startPosX.HasValue || !_startPosY.HasValue)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pen pen = new(Color.Black);
|
Pen pen = new(Color.Black);
|
||||||
Pen additionalpen = new(EntitySeaplane.AdditionalColor);
|
Pen additionalpen = new(EntitySeaplane.AdditionalColor);
|
||||||
|
@ -210,7 +210,9 @@ public class DrawningPlane
|
|||||||
g.FillEllipse(darkBrush, _startPosX.Value + 87, _startPosY.Value + 45, 6, 6);
|
g.FillEllipse(darkBrush, _startPosX.Value + 87, _startPosY.Value + 45, 6, 6);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user