PIbd-23_Panina_A.D.Cruiser..../DrawingAdvancedCruiser.java
2023-12-09 15:09:27 +04:00

40 lines
1.5 KiB
Java

import java.awt.*;
public class DrawingAdvancedCruiser extends DrawingCruiser{
EntityAdvancedCruiser EntityCruiser;
public DrawingAdvancedCruiser(int speed, double weight, Color bodyColor, Color additionalColor, boolean helicopterPad, boolean coating, boolean ornamentWheels, int width, int height) {
super(speed, weight, bodyColor, width, height, 110, 60);
{
EntityCruiser = new EntityAdvancedCruiser(speed, weight, bodyColor, additionalColor, helicopterPad, coating);
}
}
@Override
public void DrawTransport(Graphics g)
{
if (!(EntityCruiser instanceof EntityAdvancedCruiser)) {
return;
}
super.DrawTransport(g);
EntityAdvancedCruiser advancedCruiser = (EntityAdvancedCruiser) EntityCruiser;
if (advancedCruiser == null )
{
return;
}
Color addBrush = advancedCruiser.AdditionalColor;
Color brush = advancedCruiser.BodyColor;
if (advancedCruiser.HelicopterPad)
{
g.setColor(addBrush);
g.drawRect(_startPosX + 35,
_startPosY + 23, 15, 15);
g.drawRect(_startPosX + 50,
_startPosY + 19, 30, 25);
}
if (advancedCruiser.Coating)
{
g.drawOval(_startPosX + 70,
_startPosY + 29, 20, 20);
}
if (wheels == null){return;}
wheels.drawWheels(g, _startPosX, _startPosY, brush);
}
}