PIbd-23_Polevoy_S.V._SelfPr.../DrawingObjectArtillery.java

38 lines
971 B
Java
Raw Normal View History

2022-10-08 15:25:07 +04:00
import java.awt.*;
public class DrawingObjectArtillery implements IDrawingObject {
private DrawingArtillery _artillery = null;
public DrawingObjectArtillery(DrawingArtillery artillery) {
_artillery = artillery;
}
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);
}
}