2022-11-29 00:25:21 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class DrawningObjectPlane implements IDrawningObject {
|
|
|
|
private DrawningPlane _plane = null;
|
|
|
|
|
|
|
|
public DrawningObjectPlane(DrawningPlane plane)
|
|
|
|
{
|
|
|
|
_plane = plane;
|
|
|
|
}
|
2022-11-29 20:49:03 +04:00
|
|
|
@Override
|
2022-11-29 00:25:21 +04:00
|
|
|
public float Step() {
|
|
|
|
if(_plane != null && _plane.Plane != null)
|
2022-11-29 20:49:03 +04:00
|
|
|
return _plane.Plane.GetStep();
|
2022-11-29 00:25:21 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void SetObject(int x, int y, int width, int height) {
|
|
|
|
_plane.SetPosition(x,y,width,height);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void MoveObject(Direction direction) {
|
|
|
|
_plane.MoveTransport(direction);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-11-29 20:49:03 +04:00
|
|
|
public void DrawningObject(Graphics g) {
|
2022-11-29 00:25:21 +04:00
|
|
|
_plane.DrawTransport(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float[] GetCurrentPosition() {
|
|
|
|
if(_plane!=null)
|
|
|
|
return _plane.GetCurrentPosition();
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|