PIbd-23_Panina_A.D.Cruiser..../DrawingAdvancedCruiser.java

78 lines
2.3 KiB
Java
Raw Normal View History

2023-12-08 23:20:53 +04:00
import java.awt.*;
public class DrawingAdvancedCruiser extends DrawingCruiser{
EntityAdvancedCruiser EntityCar;
public DrawingAdvancedCruiser(int speed, double weight, Color bodyColor, Color additionalColor, boolean bodyKit, boolean tent, boolean ornamentWheels, int width, int height) {
super(speed, weight, bodyColor, width, height, 110, 60);
{
EntityCar = new EntityAdvancedCruiser(speed, weight, bodyColor, additionalColor, bodyKit, tent);
}
}
public DrawingAdvancedCruiser(EntityAdvancedCruiser entityDumpTruck, IDop wheels)
{
super(entityDumpTruck, wheels);
{
EntityCar = entityDumpTruck;
this.wheels = wheels;
}
}
public EntityAdvancedCruiser getEntityDumpTruck(){
return EntityCar;
}
public void DrawTransport(Graphics g)
{
EntityAdvancedCruiser dumpTruck;
if (EntityCar == null )
{
return;
}
Color addBrush = EntityCar.AdditionalColor;
Color brush = EntityCar.BodyColor;
super.DrawTransport(g);
if (EntityCar.HelicopterPad)
{
g.setColor(addBrush);
int[] pointsX = new int[3];
int[] pointsY = new int[3];
pointsX[0] = _startPosX; pointsY[0] = _startPosY + 35;
pointsX[1] = _startPosX + 85; pointsY[1] = _startPosY;
pointsX[2] = _startPosX + 85; pointsY[2] = _startPosY + 35;
g.fillPolygon(pointsX, pointsY, 3);
}
if (EntityCar.Coating)
{
g.setColor(addBrush);
int[] pointsX = new int[4];
int[] pointsY = new int[4];
pointsX[0] = _startPosX; pointsY[0] = _startPosY + 35;
pointsX[1] = _startPosX; pointsY[1] = _startPosY;
pointsX[2] = _startPosX + 85; pointsY[2] = _startPosY;
pointsX[3] = _startPosX + 85; pointsY[3] = _startPosY + 35;
g.fillPolygon(pointsX, pointsY, 4);
}
if (EntityCar.HelicopterPad && EntityCar.Coating)
{
g.setColor(brush);
int x = _startPosX;
int y = _startPosY - 8;
g.fillRect(_startPosX, _startPosY, 95, 3);
}
if (wheels == null){return;}
wheels.drawWheels(g, _startPosX, _startPosY, brush);
}
}