36 lines
853 B
Java
36 lines
853 B
Java
|
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;
|
||
|
}
|
||
|
|
||
|
}
|