Skip to content

Commit

Permalink
6
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikNarozhnyi committed Nov 17, 2024
1 parent 5b21dd3 commit 8263bee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/core/basesyntax/FigureSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ public Figure getRandomFigure() {
switch (randomed) {
case 0:
double squareSide = random.nextDouble() * MAX_SIZE + 1;
return new Square(squareSide, color);
return new Square(squareSide, randomColor);
case 1:
double rectangleWidth = random.nextDouble() * MAX_SIZE + 1;
double rectangleHeight = random.nextDouble() * MAX_SIZE + 1;
return new Rectangle(rectangleWidth, rectangleHeight, color);
return new Rectangle(rectangleWidth, rectangleHeight, randomColor);
case 2:
double firstLeg = random.nextDouble() * MAX_SIZE + 1;
double secondLeg = random.nextDouble() * MAX_SIZE + 1;
return new RightTriangle(firstLeg, secondLeg, color);
return new RightTriangle(firstLeg, secondLeg, randomColor);
case 3:
double base1 = random.nextDouble() * MAX_SIZE + 1;
double base2 = random.nextDouble() * MAX_SIZE + 1;
double height = random.nextDouble() * MAX_SIZE + 1;
return new IsoscelesTrapezoid(base1, base2, height, color);
return new IsoscelesTrapezoid(base1, base2, height, randomColor);
default:
double radius = random.nextDouble() * MAX_SIZE + 1;
return new Circle(radius, color);
return new Circle(radius, randomColor);
}
}
public Figure getDefaultFigure() {
Expand Down

0 comments on commit 8263bee

Please sign in to comment.