2023-09-13 14:19:11 +04:00
|
|
|
package ProjectStormtrooper;
|
|
|
|
|
|
|
|
import java.awt.*;
|
|
|
|
|
2023-10-10 12:26:20 +04:00
|
|
|
public class DrawingEnginesSimple implements IDrawingEngines {
|
2023-09-13 14:19:11 +04:00
|
|
|
private EnumEnginesCount _enumEnginesCount;
|
|
|
|
|
2023-10-09 22:31:20 +04:00
|
|
|
@Override
|
2023-09-26 13:41:56 +04:00
|
|
|
public void SetEnumEnginesCount(int enginesCount) {
|
2023-09-13 14:19:11 +04:00
|
|
|
for (EnumEnginesCount val : EnumEnginesCount.values()) {
|
|
|
|
if (val.count == enginesCount) {
|
|
|
|
this._enumEnginesCount = val;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2023-09-26 13:41:56 +04:00
|
|
|
this._enumEnginesCount = EnumEnginesCount.Two;
|
2023-09-13 14:19:11 +04:00
|
|
|
}
|
|
|
|
|
2023-10-09 22:31:20 +04:00
|
|
|
@Override
|
|
|
|
public EnumEnginesCount GetEnumEnginesCount() {
|
|
|
|
return _enumEnginesCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) {
|
2023-09-13 14:19:11 +04:00
|
|
|
g2d.setColor(Color.WHITE);
|
|
|
|
g2d.fillRect(x, y, w, h);
|
|
|
|
g2d.setColor(Color.BLACK);
|
|
|
|
g2d.drawRect(x, y, w, h);
|
|
|
|
g2d.setColor(color);
|
|
|
|
g2d.fillRect(x, y, 6, h);
|
|
|
|
}
|
|
|
|
}
|