PIbd-12_Karamushko_M.K._Air.../DrawingObjectAircraft.java

43 lines
1.0 KiB
Java
Raw Normal View History

2022-11-10 16:44:45 +04:00
import java.awt.*;
public class DrawingObjectAircraft implements IDrawingObject
{
private DrawingAircraft _aircraft = null;
public DrawingObjectAircraft(DrawingAircraft aircraft){
_aircraft = aircraft;
}
public void MoveObject(Direction direction) {
if(_aircraft == null) return;
_aircraft.MoveTransport(direction);
}
@Override
public float getStep() {
if(_aircraft == null) return 0;
return _aircraft.AirFighter.Step;
}
public void SetObject(int x, int y, int width, int height)
{
_aircraft.SetPosition(x, y, width, height);
}
public void DrawningObject(Graphics2D g)
{
// TODO
_aircraft.DrawTransport(g);
}
@Override
public Point GetLeftTop() {
if(_aircraft == null) return new Point(0,0);
return _aircraft.getLeftTop();
}
@Override
public Point GetRightBottom() {
if(_aircraft == null) return new Point(0,0);
return _aircraft.getRightBottom();
}
}