PIbd21.LyovushkinaA.A.Conta.../DrawningObjectShip.java
2023-10-09 23:11:13 +04:00

33 lines
942 B
Java

public class DrawningObjectShip implements IMoveableObject{
private DrawingShip _drawingShip = null;
public DrawningObjectShip(DrawingShip drawingShip)
{
_drawingShip = drawingShip;
}
public ObjectParameters GetObjectPosition()
{
if (_drawingShip == null || _drawingShip.EntityShip ==
null)
{
return null;
}
return new ObjectParameters(_drawingShip.GetPosX(),
_drawingShip.GetPosY(), _drawingShip.GetWidth(), _drawingShip.GetHeight());
}
public int GetStep()
{
return (int)(_drawingShip.EntityShip.Step);
}
public boolean CheckCanMove(Direction direction)
{
return _drawingShip.CanMove(direction);
}
public void MoveObject(Direction direction)
{
_drawingShip.MoveTransport(direction);
}
}