From 72031baf42de73c55e6cebe7639039ef3d1ecba1 Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sat, 22 Oct 2022 18:37:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/DrawingArmoredCar.java | 12 ++++-------- ...wningCaterpillar.java => DrawingCaterpillar.java} | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) rename src/main/java/{DrawningCaterpillar.java => DrawingCaterpillar.java} (96%) diff --git a/src/main/java/DrawingArmoredCar.java b/src/main/java/DrawingArmoredCar.java index 7e6ef22..a0e81b1 100644 --- a/src/main/java/DrawingArmoredCar.java +++ b/src/main/java/DrawingArmoredCar.java @@ -16,17 +16,16 @@ public class DrawingArmoredCar { private static final int carHeight = 50; - private DrawningCaterpillar drawningCaterpillar; + private DrawingCaterpillar drawingCaterpillar; public void Init(int speed, float weight, Color bodyColor) { this.armoredCar = new EntityArmoredCar(); this.armoredCar.init(speed, weight, bodyColor); Random r = new Random(); - this.drawningCaterpillar = new DrawningCaterpillar(); - this.drawningCaterpillar.Init(r.nextInt(4) + 3, bodyColor); + this.drawingCaterpillar = new DrawingCaterpillar(); + this.drawingCaterpillar.Init(r.nextInt(4) + 3, bodyColor); } - public void SetPosition(int x, int y, int width, int height) { if (x > 0 && y > 0 && x + carWidth < width && y + carHeight < height) { startPosX = x; @@ -36,7 +35,6 @@ public class DrawingArmoredCar { } } - public void MoveTransport(Direction direction) { if (pictureWidth < 1|| pictureHeight < 1) { @@ -75,7 +73,6 @@ public class DrawingArmoredCar { } } - public void DrawTransport(Graphics2D g2d) { if (startPosX < 0 || startPosY < 0 @@ -93,10 +90,9 @@ public class DrawingArmoredCar { g2d.fillOval((int ) startPosX + 80 - 20, (int ) startPosY + 30, 20, 20); g2d.fillRect((int ) startPosX + 15, (int ) startPosY + 20, 60, 30); // отрисовка катков в гусенице - drawningCaterpillar.DrawCaterpillar(g2d, (int)startPosX, (int)startPosY); + drawingCaterpillar.DrawCaterpillar(g2d, (int)startPosX, (int)startPosY); } - public void ChangeBorders(int width, int height) { pictureWidth = width; diff --git a/src/main/java/DrawningCaterpillar.java b/src/main/java/DrawingCaterpillar.java similarity index 96% rename from src/main/java/DrawningCaterpillar.java rename to src/main/java/DrawingCaterpillar.java index 3dc9840..3a1e4be 100644 --- a/src/main/java/DrawningCaterpillar.java +++ b/src/main/java/DrawingCaterpillar.java @@ -1,6 +1,6 @@ import java.awt.*; -public class DrawningCaterpillar { +public class DrawingCaterpillar { private NumRinks numRinks = NumRinks.Four; private Color color;