2022-11-29 19:01:22 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class DrawningObjectShip implements IDrawningObject {
|
|
|
|
|
|
|
|
private DrawingShip _warmlyShip = null;
|
|
|
|
|
|
|
|
public DrawningObjectShip(DrawingShip warmlyShip)
|
|
|
|
{
|
|
|
|
_warmlyShip = warmlyShip;
|
|
|
|
}
|
|
|
|
|
2022-12-15 22:31:51 +04:00
|
|
|
public DrawingShip getDrawingShip() {return _warmlyShip;}
|
|
|
|
|
2022-11-29 19:01:22 +04:00
|
|
|
@Override
|
|
|
|
public float getStep() {
|
|
|
|
if (_warmlyShip == null || _warmlyShip.warmlyShip == null) return 0;
|
|
|
|
return _warmlyShip.warmlyShip.GetStep();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void SetObject(int x, int y, int width, int height) {
|
|
|
|
_warmlyShip.SetPosition(x, y, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void MoveObject(Direction direction) {
|
|
|
|
_warmlyShip.MoveTransport(direction);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void DrawningObject(Graphics g) {
|
|
|
|
_warmlyShip.DrawTransport(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float[] GetCurrentPosition() {
|
|
|
|
if (_warmlyShip == null || _warmlyShip.warmlyShip == null) return null;
|
|
|
|
return _warmlyShip.GetCurrentPosition();
|
|
|
|
}
|
|
|
|
}
|