PIbd-23_Dolgov_D.A._Airbus..../DrawingAdvancedAirbus.java
2022-12-05 18:09:08 +04:00

45 lines
1.4 KiB
Java

import java.awt.*;
public class DrawingAdvancedAirbus extends DrawingAirbus{
public DrawingAdvancedAirbus(int speed, float weight, Color bodyColor, Color extraColor, boolean superTurbine, boolean extraCell)
{
super(speed, weight, bodyColor, 145, 55);
Airbus = new EntityAdvancedAirbus(speed, weight, bodyColor, extraColor, superTurbine, extraCell);
}
@Override
public void DrawTransport(Graphics2D g)
{
if (Airbus instanceof EntityAdvancedAirbus)
{
EntityAdvancedAirbus advancedAirbus = (EntityAdvancedAirbus) Airbus;
g.setColor(advancedAirbus.ExtraColor);
if (advancedAirbus.SuperTurbine)
{
g.fillRect((int)_startPosX, (int)_startPosY + 20, 30, 22);
g.drawLine((int)_startPosX, (int)_startPosY + 42, (int)_startPosX + 30, (int)_startPosY + 42);
}
_startPosX += 10;
_startPosY += 5;
super.DrawTransport((Graphics2D)g);
_startPosX -= 10;
_startPosY -= 5;
if (advancedAirbus.ExtraCell)
{
g.fillRect((int)_startPosX + 50, (int)_startPosY, 20, 15);
for (int i = (int)_startPosX + 50; i < (int)_startPosX + 70; i += 3)
{
g.setColor(Color.BLUE);
g.fillRect(i, (int)_startPosY + 7, 2, 2);
}
}
}
}
}