39 lines
994 B
Java
39 lines
994 B
Java
|
import javax.print.DocFlavor;
|
||
|
import java.awt.*;
|
||
|
|
||
|
public class DrawningObjectExcavator implements IDrawningObject{
|
||
|
private DrawningTracktor _tracktor = null;
|
||
|
|
||
|
public DrawningObjectExcavator(DrawningTracktor tracktor) {
|
||
|
this._tracktor = tracktor;
|
||
|
}
|
||
|
|
||
|
public float getStep() {
|
||
|
if (_tracktor != null && _tracktor.Tracktor != null) {
|
||
|
return _tracktor.Tracktor.getStep();
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
public float[] getCurrentPosition() {
|
||
|
if (_tracktor != null) {
|
||
|
return _tracktor.getCurrentPosition();
|
||
|
}
|
||
|
return new float[] { 0, 0, 0, 0 };
|
||
|
}
|
||
|
|
||
|
public void moveObject(Direction direction) {
|
||
|
if (_tracktor != null) {
|
||
|
_tracktor.MoveTransport(direction);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setObject(int x, int y, int width, int height) {
|
||
|
_tracktor.SetPosition(x, y, width, height);
|
||
|
}
|
||
|
|
||
|
public void drawningObject(Graphics2D g) {
|
||
|
_tracktor.DrawTransport(g);
|
||
|
}
|
||
|
}
|