44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
import java.awt.*;
|
|
|
|
public class ExtraWheelsDraw {
|
|
private WheelsCount wheelsCount = WheelsCount.Two;
|
|
public void setWheelsNum(int num) {
|
|
switch (num) {
|
|
case 0: {
|
|
wheelsCount = WheelsCount.Three;
|
|
break;
|
|
}
|
|
case 1: {
|
|
wheelsCount = WheelsCount.Four;
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
private Color color;
|
|
|
|
public void Init(int num, Color color) {
|
|
setWheelsNum(num);
|
|
this.color = color;
|
|
}
|
|
|
|
public void DrawWheels(int startPosX, int startPosY, Graphics2D g) {
|
|
g.setColor(color);
|
|
g.drawOval(startPosX, startPosY + 40, 10, 10);
|
|
g.drawOval(startPosX + 90, startPosY + 40, 10, 10);
|
|
switch (wheelsCount) {
|
|
case Four: {
|
|
g.drawOval(startPosX + 70, startPosY + 40, 10, 10);
|
|
}
|
|
case Three: {
|
|
g.drawOval(startPosX + 20, startPosY + 40, 10, 10);
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|