37 lines
875 B
Java
37 lines
875 B
Java
import java.awt.*;
|
|
|
|
public class DrawingObjectShip implements IDrawingObject {
|
|
private DrawingShip _ship = null;
|
|
|
|
public DrawingObjectShip(DrawingShip ship) {
|
|
_ship = ship;
|
|
}
|
|
|
|
public float getStep() {
|
|
if (_ship != null && _ship.ship != null) {
|
|
return _ship.ship.getStep();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public float[] getCurrentPosition() {
|
|
if (_ship != null) {
|
|
return _ship.getCurrentPosition();
|
|
}
|
|
return new float[] { 0, 0, 0, 0 };
|
|
}
|
|
|
|
public void moveObject(Direction direction) {
|
|
if (_ship != null) {
|
|
_ship.moveTransport(direction);
|
|
}
|
|
}
|
|
|
|
public void setObject(int x, int y, int width, int height) {
|
|
_ship.SetPosition(x, y, width, height);
|
|
}
|
|
|
|
public void drawingObject(Graphics2D g) {
|
|
_ship.drawTransport(g);
|
|
}
|
|
} |