PIbd-21_Potapov_N.S._Stormt.../ProjectStormtrooper/DrawingEnginesSimple.java

34 lines
914 B
Java
Raw Normal View History

package ProjectStormtrooper;
import java.awt.*;
public class DrawingEnginesSimple implements IDrawingEngines {
private EnumEnginesCount _enumEnginesCount;
@Override
public void SetEnumEnginesCount(int enginesCount) {
for (EnumEnginesCount val : EnumEnginesCount.values()) {
if (val.count == enginesCount) {
this._enumEnginesCount = val;
return;
}
}
this._enumEnginesCount = EnumEnginesCount.Two;
}
@Override
public EnumEnginesCount GetEnumEnginesCount() {
return _enumEnginesCount;
}
@Override
public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) {
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);
}
}