Skip to content

Commit

Permalink
Implement Lottery
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeTI committed Nov 29, 2024
1 parent c424503 commit e8d358e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions src/main/java/core/basesyntax/Ball.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package core.basesyntax;

public class Ball {
private Colors color;
private Color color;
private int number;

public Ball(Colors randomColor, int number) {
public Ball(Color randomColor, int number) {
this.color = randomColor;
this.number = number;
}

public Color getColor() {
return color;
}

public int getNumber() {
return number;
}

@Override
public String toString() {
return "Ball{"
Expand All @@ -17,11 +25,4 @@ public String toString() {
+ '}';
}

public Colors getColor() {
return color;
}

public int getNumber() {
return number;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package core.basesyntax;

public enum Colors {
public enum Color {
RED,
GREEN,
BLUE,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/ColorSupplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Random;

public class ColorSupplier {
public static Colors getRandomColor() {
return Colors.values()[new Random().nextInt(Colors.values().length)];
public static Color getRandomColor() {
return Color.values()[new Random().nextInt(Color.values().length)];
}
}

0 comments on commit e8d358e

Please sign in to comment.