Исправил класс доп прорисовки

This commit is contained in:
Иван Захаров 2024-03-25 14:17:41 +04:00
parent 27859f9317
commit a15eaf4b35
3 changed files with 4 additions and 11 deletions

View File

@ -4,9 +4,7 @@ public enum CountEngines {
Four(4),
Six(6);
private int Count;
public int getCount() {
return Count;
}
public int getCount() { return Count; }
CountEngines(int num){
this.Count = num;
}

View File

@ -20,7 +20,7 @@ public class DrawningAirFighter {
_pictureHeight = null;
_startPosX = null;
_startPosY = null;
DrawningEngines = new DrawningEngines(EntityAirFighter);
DrawningEngines = new DrawningEngines();
Random random = new Random();
int Count = 2 * random.nextInt(4);
DrawningEngines.SetCountEngines(Count);

View File

@ -2,21 +2,16 @@ import java.awt.*;
public class DrawningEngines {
private CountEngines CountEngines;
public CountEngines getCountEngines() {
return CountEngines;
}
private EntityAirFighter EntityAirFighter;
public void SetCountEngines(int countEngines) {
for (CountEngines num : CountEngines.values()) {
if (num.getCount() == countEngines) {
CountEngines = num;
return;
}
}
}
public DrawningEngines(EntityAirFighter entityAirFighter) {
EntityAirFighter = entityAirFighter;
}
public void DrawEngines(Graphics2D g, Color color, int x, int y) {
g.setColor(color);
for (int i = CountEngines.getCount(); i > 0; i -= 2) {