import java.awt.*; public class DrawingModernAircraft extends DrawingAircraft { public DrawingModernAircraft(EntityAircraft airFighter, IDrawingEngines engines) { super(airFighter, engines); } public DrawingModernAircraft(int speed, float weight, Color bodyColor, Color dopColor, boolean dopWings, boolean rockets) { super(speed, weight, bodyColor, 195, 166); AirFighter = new EntityModernAircraft(speed, weight, bodyColor, dopColor, dopWings, rockets); } @Override public void DrawTransport(Graphics2D g) { if (!(AirFighter instanceof EntityModernAircraft)) { return; } EntityModernAircraft modernAircraft = (EntityModernAircraft)AirFighter; g.setPaint(modernAircraft.DopColor); if (modernAircraft.DopWings) { Polygon topDopWing = new Polygon(); topDopWing.addPoint((int)_startPosX + 78, (int)_startPosY + 56); topDopWing.addPoint((int)_startPosX + 75, (int)_startPosY + 70); topDopWing.addPoint((int)_startPosX + 55, (int)_startPosY + 50); topDopWing.addPoint((int)_startPosX + 60, (int)_startPosY + 45); Polygon bottomDopWing = new Polygon(); bottomDopWing.addPoint((int)_startPosX + 78, (int)_startPosY + 110); bottomDopWing.addPoint((int)_startPosX + 75, (int)_startPosY + 96); bottomDopWing.addPoint((int)_startPosX + 55, (int)_startPosY + 116); bottomDopWing.addPoint((int)_startPosX + 60, (int)_startPosY + 121); g.fillPolygon(topDopWing); g.fillPolygon(bottomDopWing); } if (modernAircraft.Rockets) { Polygon topRocket1 = new Polygon(); topRocket1.addPoint((int)_startPosX + 100, (int)_startPosY + 20); topRocket1.addPoint((int)_startPosX + 100, (int)_startPosY + 30); topRocket1.addPoint((int)_startPosX + 112, (int)_startPosY + 30); topRocket1.addPoint((int)_startPosX + 120, (int)_startPosY + 25); topRocket1.addPoint((int)_startPosX + 112, (int)_startPosY + 20); Polygon topRocket2 = new Polygon(); topRocket2.addPoint((int)_startPosX + 100, (int)_startPosY + 35); topRocket2.addPoint((int)_startPosX + 100, (int)_startPosY + 45); topRocket2.addPoint((int)_startPosX + 112, (int)_startPosY + 45); topRocket2.addPoint((int)_startPosX + 120, (int)_startPosY + 40); topRocket2.addPoint((int)_startPosX + 112, (int)_startPosY + 35); Polygon bottomRocket1 = new Polygon(); bottomRocket1.addPoint((int)_startPosX + 100, (int)_startPosY + 146); bottomRocket1.addPoint((int)_startPosX + 100, (int)_startPosY + 136); bottomRocket1.addPoint((int)_startPosX + 112, (int)_startPosY + 136); bottomRocket1.addPoint((int)_startPosX + 120, (int)_startPosY + 141); bottomRocket1.addPoint((int)_startPosX + 112, (int)_startPosY + 146); Polygon bottomRocket2 = new Polygon(); bottomRocket2.addPoint((int)_startPosX + 100, (int)_startPosY + 131); bottomRocket2.addPoint((int)_startPosX + 100, (int)_startPosY + 121); bottomRocket2.addPoint((int)_startPosX + 112, (int)_startPosY + 121); bottomRocket2.addPoint((int)_startPosX + 120, (int)_startPosY + 126); bottomRocket2.addPoint((int)_startPosX + 112, (int)_startPosY + 131); g.fillPolygon(topRocket1); g.fillPolygon(topRocket2); g.fillPolygon(bottomRocket1); g.fillPolygon(bottomRocket2); } super.DrawTransport(g); } }