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

42 lines
1.0 KiB
Java

import java.awt.*;
public class DrawingObjectArtillery implements IDrawingObject {
private DrawingArtillery _artillery;
public DrawingObjectArtillery(DrawingArtillery artillery) {
_artillery = artillery;
}
public DrawingArtillery getArtillery() {
return _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);
}
}