2022-10-08 15:25:07 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class DrawingObjectArtillery implements IDrawingObject {
|
2022-11-05 19:18:29 +04:00
|
|
|
private DrawingArtillery _artillery;
|
2022-10-08 15:25:07 +04:00
|
|
|
|
|
|
|
public DrawingObjectArtillery(DrawingArtillery artillery) {
|
|
|
|
_artillery = artillery;
|
|
|
|
}
|
|
|
|
|
2022-11-05 19:18:29 +04:00
|
|
|
public DrawingArtillery getArtillery() {
|
|
|
|
return _artillery;
|
|
|
|
}
|
|
|
|
|
2022-10-08 15:25:07 +04:00
|
|
|
public float getStep() {
|
|
|
|
if (_artillery != null && _artillery.artillery != null) {
|
|
|
|
return _artillery.artillery.getStep();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float[] getCurrentPosition() {
|
|
|
|
if (_artillery != null) {
|
|
|
|
return _artillery.getCurrentPosition();
|
|
|
|
}
|
|
|
|
return new float[] { 0, 0, 0, 0 };
|
|
|
|
}
|
|
|
|
|
|
|
|
public void moveObject(Direction direction) {
|
|
|
|
if (_artillery != null) {
|
|
|
|
_artillery.moveTransport(direction);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setObject(int x, int y, int width, int height) {
|
|
|
|
_artillery.setPosition(x, y, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void drawingObject(Graphics2D g) {
|
|
|
|
_artillery.drawTransport(g);
|
|
|
|
}
|
|
|
|
}
|