49 lines
1.4 KiB
Java
49 lines
1.4 KiB
Java
import java.awt.*;
|
|
|
|
public class ExtraRoundWheelDraw implements IDrawningExtra{
|
|
private WheelsCount wheelsCount = WheelsCount.Two;
|
|
private ExtraWheelsDraw extraWheelsDraw;
|
|
private Color color;
|
|
public void setExtraNum(int num) {
|
|
switch (num) {
|
|
case 0: {
|
|
wheelsCount = WheelsCount.Three;
|
|
break;
|
|
}
|
|
case 1: {
|
|
wheelsCount = WheelsCount.Four;
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
public ExtraRoundWheelDraw (int num, Color bodyColor) {
|
|
setExtraNum(num);
|
|
extraWheelsDraw = new ExtraWheelsDraw(num, bodyColor);
|
|
}
|
|
|
|
public void SetColor(Color color) {
|
|
this.color = color;
|
|
}
|
|
|
|
public void DrawExtra(int startPosX, int startPosY, Graphics2D g) {
|
|
extraWheelsDraw.DrawExtra(startPosX, startPosY, g);
|
|
g.setColor(color);
|
|
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;
|
|
}
|
|
}
|
|
}
|