2022-11-03 23:34:20 +04:00
|
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
|
|
public class DrawingAirbus extends DrawingPlane
|
|
|
|
|
{
|
|
|
|
|
//Инициализаци свойств
|
|
|
|
|
public DrawingAirbus(int speed, int weight, Color corpusColor, Color addColor, boolean addCompartment, boolean addEngine)
|
|
|
|
|
{
|
2022-11-05 01:24:27 +04:00
|
|
|
|
super(speed, weight, corpusColor, 70, 30);
|
2022-11-03 23:34:20 +04:00
|
|
|
|
Plane = new EntityAirbus(speed, weight, corpusColor, addColor, addCompartment, addEngine);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void DrawTransport(Graphics g)
|
|
|
|
|
{
|
|
|
|
|
Graphics2D g2d = (Graphics2D) g;
|
|
|
|
|
EntityAirbus airbus;
|
|
|
|
|
|
|
|
|
|
if (!(GetPlane() instanceof EntityAirbus))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
airbus = (EntityAirbus) Plane;
|
|
|
|
|
_startPosX += 10;
|
|
|
|
|
_startPosY += 5;
|
|
|
|
|
super.DrawTransport(g);
|
|
|
|
|
_startPosX -= 10;
|
|
|
|
|
_startPosY -= 5;
|
|
|
|
|
|
|
|
|
|
//дополнительный пассажирский отсек
|
|
|
|
|
if (airbus.AddСompartment)
|
|
|
|
|
{
|
|
|
|
|
g2d.setPaint(airbus.AddColor);
|
|
|
|
|
g.fillRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
|
|
|
|
|
g2d.setPaint(Color.BLACK);
|
|
|
|
|
g.drawRect((int)_startPosX + 30, (int)_startPosY + 12, 14, 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//дополнительный двигатель
|
|
|
|
|
if (airbus.AddEngine)
|
|
|
|
|
{
|
|
|
|
|
g2d.setPaint(airbus.AddColor);
|
|
|
|
|
g.fillOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
|
|
|
|
|
g2d.setPaint(Color.BLACK);
|
|
|
|
|
g.drawOval((int)_startPosX + 24, (int)_startPosY + 22, 10, 5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|