PIbd-23_Mochalov_D.V._Locom.../DrawningWarmlyLocomotive.java

45 lines
1.5 KiB
Java
Raw Permalink Normal View History

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);
Locomotive = new EntityWarmlyLocomotive(speed, weight, bodyColor, extraColor, pipe, storage);
}
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)
{
if (Locomotive instanceof EntityWarmlyLocomotive)
{
EntityWarmlyLocomotive warmlyLocomotive = (EntityWarmlyLocomotive) Locomotive;
2022-10-08 18:55:47 +04:00
g.setColor(warmlyLocomotive.ExtraColor);
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);
}
if (warmlyLocomotive.FuelStorage)
{
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:55:47 +04:00
_startPosY += 20;
super.DrawTransport((Graphics2D)g);
_startPosY -= 20;
}
}
}