diff --git a/DrawningLocomotive.java b/DrawningLocomotive.java index cf537eb..19497c3 100644 --- a/DrawningLocomotive.java +++ b/DrawningLocomotive.java @@ -80,8 +80,32 @@ class DrawningLocomotive { } } - public void DrawTransport() { - //TODO: do! + public void DrawTransport(Graphics g) { + if (_startPosX < 0 || _startPosY < 0 + || _pictureHeight == null || _pictureWidth == null) + { + return; + } + //тело + g.setColor(Color.BLACK); + g.drawRect((int)_startPosX , (int)_startPosY, _locomotiveWidth - 10, _locomotiveHeight - 10); + //окна + g.setColor(Locomotive.getBodyColor()); + g.fillRect((int)_startPosX + 10, (int)_startPosY + 10, 10, 10); + g.fillRect((int)_startPosX + 30, (int)_startPosY + 10, 10, 10); + g.fillRect((int)_startPosX + 80, (int)_startPosY + 10, 10, 10); + //дверь + g.setColor(Color.BLACK); + g.drawRect( (int)_startPosX + 50, (int)_startPosY + 10, 10, 20); + //колеса + g.drawOval((int) _startPosX, (int)_startPosY + 40, 10, 10); + g.drawOval((int) _startPosX + 20, (int)_startPosY + 40, 10, 10); + g.drawOval((int) _startPosX + 70, (int)_startPosY + 40, 10, 10); + g.drawOval((int) _startPosX + 90, (int)_startPosY + 40, 10, 10); + //движок + g.setColor(Locomotive.getBodyColor()); + g.fillRect((int)_startPosX + 100, (int)_startPosY + 10, 10, 30); + } public void ChangeBorders(int width, int height) diff --git a/EntityLocomotive.java b/EntityLocomotive.java index 7d58451..440b8a1 100644 --- a/EntityLocomotive.java +++ b/EntityLocomotive.java @@ -37,10 +37,4 @@ public class EntityLocomotive { } BodyColor = bodyColor; } - - - - - - }