2022-10-08 23:13:09 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class ExtraRoundWheelDraw implements IDrawningExtra{
|
|
|
|
private WheelsCount wheelsCount = WheelsCount.Two;
|
2022-10-22 01:15:02 +04:00
|
|
|
private ExtraWheelsDraw extraWheelsDraw;
|
2022-10-08 23:13:09 +04:00
|
|
|
public void setExtraNum(int num) {
|
|
|
|
switch (num) {
|
|
|
|
case 0: {
|
|
|
|
wheelsCount = WheelsCount.Three;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: {
|
|
|
|
wheelsCount = WheelsCount.Four;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-22 01:15:02 +04:00
|
|
|
public ExtraRoundWheelDraw (int num, Color bodyColor) {
|
2022-10-08 23:13:09 +04:00
|
|
|
setExtraNum(num);
|
2022-10-22 01:15:02 +04:00
|
|
|
extraWheelsDraw = new ExtraWheelsDraw(num, bodyColor);
|
2022-10-08 23:13:09 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawExtra(int startPosX, int startPosY, Graphics2D g) {
|
2022-10-22 01:15:02 +04:00
|
|
|
extraWheelsDraw.DrawExtra(startPosX, startPosY, g);
|
2022-10-08 23:13:09 +04:00
|
|
|
g.setColor(Color.BLACK);
|
|
|
|
g.fillOval(startPosX + 5, startPosY + 35, 10, 10);
|
|
|
|
g.fillOval(startPosX + 95, startPosY + 35, 10, 10);
|
|
|
|
switch (wheelsCount) {
|
|
|
|
case Four: {
|
|
|
|
g.fillOval(startPosX + 75, startPosY + 35, 10, 10);
|
|
|
|
}
|
|
|
|
case Three: {
|
|
|
|
g.fillOval(startPosX + 25, startPosY + 35, 10, 10);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|