PIbd-14_Antonova_A.A.__Hard/DifferenceOfWheels/DrawningWheels.java

33 lines
741 B
Java
Raw Normal View History

2024-05-09 20:09:37 +04:00
package DifferenceOfWheels;
import java.util.Random;
import java.awt.*;
public class DrawningWheels implements IOrnaments{
int CountWeel;
private int count = 0;
Random rnd = new Random();
int ranOrnament = rnd.nextInt(0, 3);
@Override
public void SetCount(int n) {
for (EnumWheels count: EnumWheels.values()) {
if (count.get_number() == n) {
CountWeel = n;
return;
}
}
}
@Override
public int get_count_weels () {
return CountWeel;
}
@Override
public void DrawOrnament (Graphics2D g,int x, int y){
g.setColor(Color.BLACK);
g.fillOval(x, y, 25, 25);
}
}