PIbd-21_Markov_D.P._Contain.../DrawingObjectShip.java

36 lines
853 B
Java
Raw Permalink Normal View History

2022-12-02 00:06:03 +04:00
import java.awt.*;
public class DrawingObjectShip implements IDrawingObject {
private DrawingShip _ship = null;
public DrawingObjectShip(DrawingShip ship)
{
_ship=ship;
}
@Override
public float Step() {
if (_ship!=null && _ship.Ship != null) {
return _ship.Ship.GetStep();
}
return 0;
}
@Override
public void SetObject(int x, int y, int width, int height) {
_ship.SetPosition(x,y,width,height);
}
@Override
public void MoveObject(Direction direction) {
_ship.MoveTransport(direction);
}
@Override
public void DrawingObject(Graphics g) {
_ship.DrawTransport(g);
}
@Override
public float[] GetCurrentPosition() {
if(_ship!=null)
return _ship.GetCurrentPosition();
return null;
}
}