35 lines
1.4 KiB
Java
35 lines
1.4 KiB
Java
import java.awt.*;
|
|
public class DrawingWarmlyShip extends DrawingShip{
|
|
public DrawingWarmlyShip(int speed, double weight, Color mainColor, Color optionalColor,
|
|
boolean pipes, boolean fuelCompartment, int width, int height, int numberDecks){
|
|
super(speed, weight, mainColor, width, height, numberDecks, 100, 60);
|
|
if (entityShip != null){
|
|
entityShip = new EntityWarmlyShip(speed, weight, mainColor, optionalColor, pipes, fuelCompartment);
|
|
}
|
|
}
|
|
@Override
|
|
public void DrawTransport(Graphics g){
|
|
if (!(entityShip instanceof EntityWarmlyShip entityWarmlyShip)) {
|
|
return;
|
|
}
|
|
|
|
if (entityWarmlyShip.GetPipes()){
|
|
g.setColor(entityWarmlyShip.GetOptionalColor());
|
|
g.fillRect(_startPosX + 70, _startPosY, 10, 30);
|
|
g.fillRect(_startPosX + 50, _startPosY + 10, 10, 20);
|
|
g.setColor(Color.black);
|
|
g.drawRect(_startPosX + 50, _startPosY + 10, 10, 20);
|
|
g.drawRect(_startPosX + 70, _startPosY, 10, 30);
|
|
}
|
|
if (entityWarmlyShip.GetFuelCompartment())
|
|
{
|
|
g.setColor(entityWarmlyShip.GetOptionalColor());
|
|
g.fillRect(_startPosX + 10, _startPosY + 30, 10, 10);
|
|
g.setColor(Color.black);
|
|
g.drawRect(_startPosX + 10, _startPosY + 30, 10, 10);
|
|
}
|
|
super.DrawTransport(g);
|
|
}
|
|
|
|
}
|