62 lines
1.7 KiB
Java
62 lines
1.7 KiB
Java
package src.DrawningObjects;
|
|
|
|
import src.NumberType;
|
|
|
|
import javax.swing.*;
|
|
import java.awt.*;
|
|
|
|
public class DrawningIlluminatorsQuad implements IDraw {
|
|
private NumberType IlluminatorNumb;
|
|
private Color IlluminatorColor;
|
|
private int Width, Height;
|
|
protected int CurX, CurY;
|
|
public DrawningIlluminatorsQuad(int width, int height, int curX, int curY){
|
|
Width = width;
|
|
Height = height;
|
|
CurX = curX;
|
|
CurY = curY;
|
|
}
|
|
public void ChangeIlluminatorNumb(int x){
|
|
if(x <= 10)
|
|
IlluminatorNumb = NumberType.Ten;
|
|
if(x == 20)
|
|
IlluminatorNumb = NumberType.Twenty;
|
|
if(x >= 30)
|
|
IlluminatorNumb = NumberType.Thirty;
|
|
}
|
|
public void ChangeX(int x){
|
|
CurX = x;
|
|
}
|
|
public void ChangeY(int y){
|
|
CurY = y;
|
|
}
|
|
public NumberType IlluminatorNumb(){
|
|
return IlluminatorNumb;
|
|
}
|
|
public void DrawIlluminators(Graphics2D g2d) {
|
|
g2d.setColor(Color.BLUE);
|
|
int x = CurX;
|
|
int y = CurY;
|
|
for (int i = 0; i < 10; i++) {
|
|
g2d.fillRect(x + 34, y + 29, 5, 5);
|
|
x += 7;
|
|
}
|
|
//20 иллюминаторов
|
|
if (IlluminatorNumb == NumberType.Twenty || IlluminatorNumb == NumberType.Thirty) {
|
|
x = CurX;
|
|
for (int i = 0; i < 10; i++) {
|
|
g2d.fillRect(x + 34, y + 37, 5, 5);
|
|
x += 7;
|
|
}
|
|
}
|
|
//30 иллюминаторов
|
|
if (IlluminatorNumb == NumberType.Thirty) {
|
|
x = CurX;
|
|
for (int i = 0; i < 10; i++) {
|
|
g2d.fillRect(x + 34, y + 45, 5, 5);
|
|
x += 7;
|
|
}
|
|
}
|
|
}
|
|
}
|