Skip to content

Commit

Permalink
was added randomValue2, randomValue2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsumaroka committed Oct 9, 2023
1 parent 10f5b3e commit decf57f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/core/basesyntax/FigureSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@ public class FigureSupplier {

public Figure getRandomFigure() {
int index = random.nextInt(NUMBER_OF_FIGURES);
int randomValue = random.nextInt((100) + 1);
int randomValue1 = random.nextInt((100) + 1);
int randomValue2 = random.nextInt((100) + 1);
int randomValue3 = random.nextInt((100) + 1);
switch (index) {
case 0:
randomFigure = new Circle(randomValue);
randomFigure = new Circle(randomValue1);
randomFigure.setColor(colorSupplier.getRandomColor());
break;
case 1:
randomFigure = new Rectangle(randomValue, randomValue);
randomFigure = new Rectangle(randomValue1, randomValue2);
randomFigure.setColor(colorSupplier.getRandomColor());
break;
case 2:
randomFigure = new Square(randomValue);
randomFigure = new Square(randomValue1);
randomFigure.setColor(colorSupplier.getRandomColor());
break;
case 3:
randomFigure = new IsoscelesTrapezoid(randomValue, randomValue, randomValue);
randomFigure = new IsoscelesTrapezoid(randomValue1, randomValue2, randomValue3);
randomFigure.setColor(colorSupplier.getRandomColor());
break;
case 4:
randomFigure = new RightTriangle(randomValue, randomValue);
randomFigure = new RightTriangle(randomValue1, randomValue2);
randomFigure.setColor(colorSupplier.getRandomColor());
break;
default:
Expand Down

0 comments on commit decf57f

Please sign in to comment.