Перевод на конструкторы 2
This commit is contained in:
parent
5e6e077ef5
commit
2fd750d255
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user