From 2fd750d255a7962846ffe65d2b00b6fe7381bb7a Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sat, 22 Oct 2022 22:46:44 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D1=8B=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/DrawingArmoredCar.java | 3 +-- src/main/java/DrawingCaterpillar.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/DrawingArmoredCar.java b/src/main/java/DrawingArmoredCar.java index 005bfc6..5e25e8b 100644 --- a/src/main/java/DrawingArmoredCar.java +++ b/src/main/java/DrawingArmoredCar.java @@ -25,8 +25,7 @@ public class DrawingArmoredCar { public DrawingArmoredCar(int speed, float weight, Color bodyColor) { this.armoredCar = new EntityArmoredCar(speed, weight, bodyColor); Random r = new Random(); - this.drawingCaterpillar = new DrawingCaterpillar(); - this.drawingCaterpillar.Init(r.nextInt(4, 7), bodyColor); + this.drawingCaterpillar = new DrawingCaterpillar(r.nextInt(4, 7), bodyColor); } protected DrawingArmoredCar(int speed, float weight, Color bodyColor, int carWidth, int carHeight) { diff --git a/src/main/java/DrawingCaterpillar.java b/src/main/java/DrawingCaterpillar.java index ae2fb0c..2270ca6 100644 --- a/src/main/java/DrawingCaterpillar.java +++ b/src/main/java/DrawingCaterpillar.java @@ -4,7 +4,7 @@ public class DrawingCaterpillar { private NumRinks numRinks = NumRinks.Four; private Color color; - public void Init(int n, Color color) { + public DrawingCaterpillar(int n, Color color) { setNumRinks(n); this.color = color; }