2022-11-03 23:34:20 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class DrawningObjectPlane implements IDrawningObject
|
|
|
|
{
|
|
|
|
private DrawingPlane _plane = null;
|
|
|
|
|
2022-11-05 13:06:59 +04:00
|
|
|
public DrawningObjectPlane(DrawingPlane plane){ _plane = plane; }
|
2022-11-03 23:34:20 +04:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public float Step()
|
|
|
|
{
|
|
|
|
if(_plane != null && _plane.Plane != null)
|
|
|
|
{
|
|
|
|
return _plane.Plane.GetStep();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
public void DrawningObject(Graphics g)
|
|
|
|
{
|
|
|
|
_plane.DrawTransport(g);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float[] GetCurrentPosition()
|
|
|
|
{
|
|
|
|
if(_plane != null)
|
|
|
|
{
|
|
|
|
return _plane.GetCurrentPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|