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

50 lines
1.8 KiB
Java
Raw Normal View History

2023-12-08 23:20:53 +04:00
import java.awt.*;
public class DrawingAdvancedCruiser extends DrawingCruiser{
2023-12-09 00:17:07 +04:00
EntityAdvancedCruiser EntityCruiser;
public DrawingAdvancedCruiser(int speed, double weight, Color bodyColor, Color additionalColor, boolean helicopterPad, boolean coating, boolean ornamentWheels, int width, int height) {
2023-12-08 23:20:53 +04:00
super(speed, weight, bodyColor, width, height, 110, 60);
{
2023-12-09 00:17:07 +04:00
EntityCruiser = new EntityAdvancedCruiser(speed, weight, bodyColor, additionalColor, helicopterPad, coating);
2023-12-08 23:20:53 +04:00
}
}
2023-12-09 21:01:39 +04:00
public DrawingAdvancedCruiser(EntityAdvancedCruiser entityAdvancedCruiser,IDop wheels)
2023-12-09 17:25:15 +04:00
{
2023-12-09 21:01:39 +04:00
super(entityAdvancedCruiser, wheels);
2023-12-09 17:25:15 +04:00
{
2023-12-09 21:01:39 +04:00
EntityCruiser = entityAdvancedCruiser;
2023-12-09 17:25:15 +04:00
this.wheels = wheels;
}
}
public EntityAdvancedCruiser getEntityCruiser(){
return EntityCruiser;
}
2023-12-08 23:20:53 +04:00
public void DrawTransport(Graphics g)
{
2023-12-09 15:09:27 +04:00
if (!(EntityCruiser instanceof EntityAdvancedCruiser)) {
2023-12-08 23:20:53 +04:00
return;
}
super.DrawTransport(g);
2023-12-09 15:09:27 +04:00
EntityAdvancedCruiser advancedCruiser = (EntityAdvancedCruiser) EntityCruiser;
if (advancedCruiser == null )
{
return;
}
Color addBrush = advancedCruiser.AdditionalColor;
Color brush = advancedCruiser.BodyColor;
if (advancedCruiser.HelicopterPad)
2023-12-08 23:20:53 +04:00
{
g.setColor(addBrush);
2023-12-09 00:17:07 +04:00
g.drawRect(_startPosX + 35,
_startPosY + 23, 15, 15);
g.drawRect(_startPosX + 50,
_startPosY + 19, 30, 25);
2023-12-08 23:20:53 +04:00
}
2023-12-09 15:09:27 +04:00
if (advancedCruiser.Coating)
2023-12-08 23:20:53 +04:00
{
2023-12-09 00:17:07 +04:00
g.drawOval(_startPosX + 70,
_startPosY + 29, 20, 20);
2023-12-08 23:20:53 +04:00
}
if (wheels == null){return;}
wheels.drawWheels(g, _startPosX, _startPosY, brush);
}
2023-12-09 00:17:07 +04:00
}