Borschevskaya A.A. Lab Work 2 Hard #2

Merged
eegov merged 16 commits from lab2 into lab1 2022-11-07 10:48:13 +04:00
2 changed files with 2 additions and 3 deletions
Showing only changes of commit 2fd750d255 - Show all commits

View File

@ -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);
Review

Требовалось создание объекта, а не массива объектов

Требовалось создание объекта, а не массива объектов
}
protected DrawingArmoredCar(int speed, float weight, Color bodyColor, int carWidth, int carHeight) {

View File

@ -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;
}