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 20:32:35 +04:00
|
|
|
super(speed, weight, bodyColor, 140, 70);
|
2022-10-08 18:36:19 +04:00
|
|
|
Locomotive = new EntityWarmlyLocomotive(speed, weight, bodyColor, extraColor, pipe, storage);
|
|
|
|
}
|
2022-10-22 01:15:02 +04:00
|
|
|
|
|
|
|
public DrawningWarmlyLocomotive(EntityLocomotive locomotive, IDrawningExtra extra) {
|
|
|
|
super(locomotive, extra);
|
|
|
|
Locomotive = locomotive;
|
|
|
|
}
|
|
|
|
|
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 22:13:56 +04:00
|
|
|
g.fillRect((int)_startPosX + 120, (int)_startPosY + 10, 10, 50);
|
2022-10-08 18:55:47 +04:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|