import java.awt.*; public class DrawningWarmlyLocomotive extends DrawningLocomotive{ public DrawningWarmlyLocomotive(int speed, float weight, Color bodyColor, Color extraColor, boolean pipe, boolean storage) { super(speed, weight, bodyColor, 140, 70); Locomotive = new EntityWarmlyLocomotive(speed, weight, bodyColor, extraColor, pipe, storage); } @Override public void DrawTransport(Graphics2D g) { if (Locomotive instanceof EntityWarmlyLocomotive) { EntityWarmlyLocomotive warmlyLocomotive = (EntityWarmlyLocomotive) Locomotive; g.setColor(warmlyLocomotive.ExtraColor); if (warmlyLocomotive.Pipe) { 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); g.fillRect((int)_startPosX + 110, (int)_startPosY + 40, 20, 20); g.fillRect((int)_startPosX + 110, (int)_startPosY, 30, 10); } _startPosY += 20; super.DrawTransport((Graphics2D)g); _startPosY -= 20; } } }