Исправил класс доп прорисовки
This commit is contained in:
parent
27859f9317
commit
a15eaf4b35
@ -4,9 +4,7 @@ public enum CountEngines {
|
|||||||
Four(4),
|
Four(4),
|
||||||
Six(6);
|
Six(6);
|
||||||
private int Count;
|
private int Count;
|
||||||
public int getCount() {
|
public int getCount() { return Count; }
|
||||||
return Count;
|
|
||||||
}
|
|
||||||
CountEngines(int num){
|
CountEngines(int num){
|
||||||
this.Count = num;
|
this.Count = num;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class DrawningAirFighter {
|
|||||||
_pictureHeight = null;
|
_pictureHeight = null;
|
||||||
_startPosX = null;
|
_startPosX = null;
|
||||||
_startPosY = null;
|
_startPosY = null;
|
||||||
DrawningEngines = new DrawningEngines(EntityAirFighter);
|
DrawningEngines = new DrawningEngines();
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int Count = 2 * random.nextInt(4);
|
int Count = 2 * random.nextInt(4);
|
||||||
DrawningEngines.SetCountEngines(Count);
|
DrawningEngines.SetCountEngines(Count);
|
||||||
|
@ -2,21 +2,16 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class DrawningEngines {
|
public class DrawningEngines {
|
||||||
private CountEngines CountEngines;
|
private CountEngines CountEngines;
|
||||||
public CountEngines getCountEngines() {
|
|
||||||
return CountEngines;
|
|
||||||
}
|
|
||||||
private EntityAirFighter EntityAirFighter;
|
private EntityAirFighter EntityAirFighter;
|
||||||
public void SetCountEngines(int countEngines) {
|
public void SetCountEngines(int countEngines) {
|
||||||
for (CountEngines num : CountEngines.values()) {
|
for (CountEngines num : CountEngines.values()) {
|
||||||
if (num.getCount() == countEngines) {
|
if (num.getCount() == countEngines) {
|
||||||
CountEngines = num;
|
CountEngines = num;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public DrawningEngines(EntityAirFighter entityAirFighter) {
|
|
||||||
EntityAirFighter = entityAirFighter;
|
|
||||||
}
|
|
||||||
public void DrawEngines(Graphics2D g, Color color, int x, int y) {
|
public void DrawEngines(Graphics2D g, Color color, int x, int y) {
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
for (int i = CountEngines.getCount(); i > 0; i -= 2) {
|
for (int i = CountEngines.getCount(); i > 0; i -= 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user