65 lines
2.5 KiB
Java
65 lines
2.5 KiB
Java
package Classes;
|
|
|
|
|
|
import java.awt.*;
|
|
|
|
public class DrawingEngines
|
|
{
|
|
private Engines enginesCount;
|
|
|
|
public void setEngines(int count)
|
|
{
|
|
enginesCount = Engines.getEnginesEnum(count);
|
|
}
|
|
|
|
public void drawEngines(Graphics g,int startPosX,int startPosY,Color bodyColor)
|
|
{
|
|
if(enginesCount != null)
|
|
{
|
|
switch(enginesCount)
|
|
{
|
|
case TwoEngines -> {
|
|
g.setColor((Color.BLACK));
|
|
g.drawOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 90,30,10);
|
|
g.setColor((bodyColor));
|
|
g.fillOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 90,30,10);
|
|
}
|
|
|
|
case FourEngines -> {
|
|
|
|
g.setColor((Color.BLACK));
|
|
g.drawOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 90,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 20,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 75,30,10);
|
|
g.setColor(bodyColor);
|
|
g.fillOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 90,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 20,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 75,30,10);
|
|
}
|
|
|
|
case SixEngines -> {
|
|
|
|
g.setColor((Color.BLACK));
|
|
g.drawOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 90,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 20,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 75,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 35,30,10);
|
|
g.drawOval(startPosX + 40,startPosY + 60,30,10);
|
|
g.setColor(bodyColor);
|
|
g.fillOval(startPosX + 40,startPosY + 5,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 90,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 20,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 75,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 35,30,10);
|
|
g.fillOval(startPosX + 40,startPosY + 60,30,10);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|