27 lines
689 B
Java
Raw Permalink Normal View History

package ProjectElectricLocomotive;
import java.awt.*;
2023-10-10 01:30:20 +04:00
public class DrawingWheel implements IDrawingWheels {
private WheelsCount _wheelsCount;
2023-10-08 20:20:04 +04:00
public void SetWheelsCount(int wheelsCount) {
for (WheelsCount val : WheelsCount.values()) {
2023-10-08 20:20:04 +04:00
if (val.count == wheelsCount) {
_wheelsCount = val;
return;
}
}
2023-10-10 01:30:20 +04:00
this._wheelsCount = WheelsCount.Three;
}
2023-10-10 01:30:20 +04:00
@Override
public WheelsCount GetWheelsCount() {
return _wheelsCount;
}
2023-10-10 01:30:20 +04:00
public void DrawWheel(Graphics2D g2d, Color color, int x, int y, int w, int h) {
g2d.setColor(Color.BLACK);
g2d.fillOval(x, y, w, h);
}
}