2022-10-08 18:36:19 +04:00
|
|
|
import java.awt.*;
|
|
|
|
public class DrawningWarmlyLocomotive extends DrawningLocomotive{
|
|
|
|
public DrawningWarmlyLocomotive(int speed, float weight, Color bodyColor, Color extraColor, boolean pipe, boolean storage)
|
|
|
|
{
|
2022-10-08 18:55:47 +04:00
|
|
|
super(speed, weight, bodyColor, 130, 70);
|
2022-10-08 18:36:19 +04:00
|
|
|
Locomotive = new EntityWarmlyLocomotive(speed, weight, bodyColor, extraColor, pipe, storage);
|
|
|
|
}
|
2022-10-08 18:55:47 +04:00
|
|
|
@Override
|
|
|
|
public void DrawTransport(Graphics2D g)
|
2022-10-08 18:36:19 +04:00
|
|
|
{
|
|
|
|
if (Locomotive instanceof EntityWarmlyLocomotive)
|
|
|
|
{
|
|
|
|
EntityWarmlyLocomotive warmlyLocomotive = (EntityWarmlyLocomotive) Locomotive;
|
2022-10-08 18:55:47 +04:00
|
|
|
|
|
|
|
g.setColor(warmlyLocomotive.ExtraColor);
|
2022-10-08 18:36:19 +04:00
|
|
|
|
|
|
|
if (warmlyLocomotive.Pipe)
|
|
|
|
{
|
2022-10-08 18:55:47 +04:00
|
|
|
g.fillRect((int)_startPosX + 10, (int)_startPosY, 30, 20);
|
|
|
|
g.fillRect((int)_startPosX + 60, (int)_startPosY, 20, 20);
|
|
|
|
g.fillRect((int)_startPosX + 60, (int)_startPosY + 10, 30, 10);
|
2022-10-08 18:36:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (warmlyLocomotive.FuelStorage)
|
|
|
|
{
|
2022-10-08 18:55:47 +04:00
|
|
|
g.fillRect((int)_startPosX + 110, (int)_startPosY + 10, 10, 50);
|
|
|
|
g.fillRect((int)_startPosX + 110, (int)_startPosY + 40, 20, 20);
|
|
|
|
g.fillRect((int)_startPosX + 110, (int)_startPosY, 30, 10);
|
2022-10-08 18:36:19 +04:00
|
|
|
}
|
2022-10-08 18:55:47 +04:00
|
|
|
|
|
|
|
_startPosY += 20;
|
|
|
|
|
|
|
|
super.DrawTransport((Graphics2D)g);
|
|
|
|
|
|
|
|
_startPosY -= 20;
|
2022-10-08 18:36:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|