diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 35eb1dd..8306744 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,5 +2,6 @@
+
\ No newline at end of file
diff --git a/ProjectAirFighter/src/DirectionType.java b/ProjectAirFighter/src/DirectionType.java
deleted file mode 100644
index 35657f0..0000000
--- a/ProjectAirFighter/src/DirectionType.java
+++ /dev/null
@@ -1,6 +0,0 @@
-public enum DirectionType {
- Up,
- Down,
- Left,
- Right
-}
diff --git a/ProjectAirFighter/src/DrawningAirFighter.java b/ProjectAirFighter/src/DrawningAirFighter.java
deleted file mode 100644
index b8ea825..0000000
--- a/ProjectAirFighter/src/DrawningAirFighter.java
+++ /dev/null
@@ -1,223 +0,0 @@
-import java.awt.*;
-import java.util.Random;
-public class DrawningAirFighter {
- private EntityAirFighter entityAirFighter;
- public EntityAirFighter getEntityAirFighter() {
- return entityAirFighter;
- }
- private Integer _pictureWidth;
- private Integer _pictureHeight;
- private Integer _startPosX;
- private Integer _startPosY;
- private final int _drawingAirFighterWidth = 76;
- private final int _drawingAirFighterHeight = 80;
- public DrawningAirFighterEngine _drawningAirFighterEngine;
-
- public void Init(int speed, float weight, Color bodyColor, Color additionalColor, boolean pgo, boolean rockets) {
- entityAirFighter = new EntityAirFighter();
- entityAirFighter.Init(speed, weight, bodyColor, additionalColor, pgo, rockets);
- _startPosY = null;
- _startPosX = null;
- _pictureWidth = null;
- _pictureHeight = null;
-
- _drawningAirFighterEngine = new DrawningAirFighterEngine();
- Random random = new Random();
- int[] countengine = {2, 4, 6};
- int engineCount = countengine[random.nextInt(countengine.length)];
- _drawningAirFighterEngine.setEnumNumber(engineCount);
-
- }
- public void setPosition(int x, int y) {
- if (_pictureHeight == null || _pictureWidth == null)
- return;
- _startPosX = x;
- _startPosY = y;
-
- if (_drawingAirFighterWidth + x > _pictureWidth || x < 0) {
- _startPosX = 0;
- }
- if (_drawingAirFighterHeight + y > _pictureHeight || y < 0) {
- _startPosY = 0;
- }
- }
-
- public boolean setPictureSize(int width, int height) {
-
- if (_drawingAirFighterHeight > height || _drawingAirFighterWidth > width)
- return false;
- _pictureHeight = height;
- _pictureWidth = width;
-
- if (_startPosX != null && _startPosY != null) {
- if (_startPosX + _drawingAirFighterWidth > width)
- _startPosX = width - _drawingAirFighterWidth;
- if (_startPosY + _drawingAirFighterHeight > height)
- _startPosY = height - _drawingAirFighterHeight;
- }
- return true;
- }
-
- public boolean moveTransport(DirectionType direction) {
- if (entityAirFighter == null || _pictureWidth == null || _pictureHeight == null)
- return false;
- switch (direction) {
- case Left:
- if (_startPosX - entityAirFighter.Step() > 0)
- _startPosX -= (int) entityAirFighter.Step();
- return true;
- case Up:
- if (_startPosY - entityAirFighter.Step() > 0)
- _startPosY -= (int) entityAirFighter.Step();
- return true;
- case Right:
- if (_startPosX + entityAirFighter.Step() < _pictureWidth - _drawingAirFighterWidth)
- _startPosX += (int) entityAirFighter.Step();
- return true;
- case Down:
- if (_startPosY + entityAirFighter.Step() < _pictureHeight - _drawingAirFighterHeight)
- _startPosY += (int) entityAirFighter.Step();
- return true;
- default:
- return false;
- }
- }
-
- public void drawAirFighter(Graphics g) {
- if (entityAirFighter == null || _startPosX == null || _startPosY == null) {
- return;
- }
-
- Graphics2D g2d = (Graphics2D) g;
-
- Point[] rtail = new Point[]{
- new Point (_startPosX + 10,_startPosY + 25),
- new Point (_startPosX + 10,_startPosY + 8),
- new Point (_startPosX + 20,_startPosY + 17),
- new Point (_startPosX + 20, _startPosY + 25),
- };
- Polygon rtailPolygon = new Polygon();
- for (Point point : rtail)
- rtailPolygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getBodyColor());
- g2d.fillPolygon(rtailPolygon);
-
- Point[] ltail = new Point[]{
- new Point (_startPosX + 10,_startPosY + 49),
- new Point (_startPosX + 10,_startPosY + 66),
- new Point (_startPosX + 20,_startPosY + 57),
- new Point (_startPosX + 20, _startPosY + 49),
- };
- Polygon ltailPolygon = new Polygon();
- for (Point point : ltail)
- ltailPolygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getBodyColor());
- g2d.fillPolygon(ltailPolygon);
-
- Point[] rwing = new Point[]{
- new Point (_startPosX + 45,_startPosY + 49),
- new Point (_startPosX + 45,_startPosY + 74),
- new Point (_startPosX + 37,_startPosY + 74),
- new Point (_startPosX + 30, _startPosY + 49),
- };
- Polygon rwingPolygon = new Polygon();
- for (Point point : rwing)
- rwingPolygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getBodyColor());
- g2d.fillPolygon(rwingPolygon);
-
- Point[] lwing = new Point[]{
- new Point (_startPosX + 45,_startPosY + 25),
- new Point (_startPosX + 45,_startPosY ),
- new Point (_startPosX + 37,_startPosY ),
- new Point (_startPosX + 30, _startPosY + 25),
- };
- Polygon lwingPolygon = new Polygon();
- for (Point point : lwing)
- lwingPolygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getBodyColor());
- g2d.fillPolygon(lwingPolygon);
-
- g2d.drawRect(_startPosX + 10, _startPosY+ 25, 50, 24);
- g2d.fillRect(_startPosX + 10, _startPosY+ 25, 50, 24);
-
- Point[] nose = new Point[]{
- new Point (_startPosX + 60,_startPosY + 25),
- new Point (_startPosX + 76,_startPosY + 37),
- new Point (_startPosX + 60,_startPosY + 49),
- };
- Polygon nosePolygon = new Polygon();
- for (Point point : nose)
- nosePolygon.addPoint(point.x, point.y);
-
- g2d.setColor(Color.GRAY);
- g2d.fillPolygon(nosePolygon);
-
- if (entityAirFighter.getPgo()) {
- Point[] pgo1 = new Point[]{
- new Point ( _startPosX + 50, _startPosY + 25),
- new Point ( _startPosX + 50, _startPosY + 15),
- new Point ( _startPosX + 55, _startPosY + 25),
- };
- Polygon pgo1Polygon = new Polygon();
- for (Point point : pgo1)
- pgo1Polygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getAdditionalColor());
- g2d.fillPolygon(pgo1Polygon);
-
- Point[] pgo2 = new Point[]{
- new Point (_startPosX + 50, _startPosY + 49),
- new Point (_startPosX + 50, _startPosY + 59),
- new Point (_startPosX + 55, _startPosY + 49),
- };
- Polygon pgo2Polygon = new Polygon();
- for (Point point : pgo2)
- pgo2Polygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getAdditionalColor());
- g2d.fillPolygon(pgo2Polygon);
- }
-
- if (entityAirFighter.getRockets()) {
- Point[] rocket1 = new Point[]{
- new Point (_startPosX + 50, _startPosY + 71),
- new Point (_startPosX + 50, _startPosY+ 74),
- new Point (_startPosX + 55, _startPosY + 69),
- new Point (_startPosX + 50, _startPosY + 64),
- };
- Polygon rocket1Polygon = new Polygon();
- for (Point point : rocket1)
- rocket1Polygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getAdditionalColor());
- g2d.fillPolygon(rocket1Polygon);
-
- g.drawRect(_startPosX + 45, _startPosY + 67, 5, 4);
- g.fillRect(_startPosX + 45, _startPosY + 67, 5, 4);
-
- Point[] rocket2 = new Point[]{
- new Point (_startPosX + 50, _startPosY + 7),
- new Point (_startPosX + 50, _startPosY+ 10),
- new Point (_startPosX + 55, _startPosY + 5),
- new Point (_startPosX + 50, _startPosY),
- };
- Polygon rocket2Polygon = new Polygon();
- for (Point point : rocket2)
- rocket2Polygon.addPoint(point.x, point.y);
-
- g2d.setColor(entityAirFighter.getAdditionalColor());
- g2d.fillPolygon(rocket2Polygon);
-
- g.drawRect(_startPosX + 45, _startPosY + 3, 5, 4);
- g.fillRect(_startPosX + 45, _startPosY + 3, 5, 4);
- }
-
- _drawningAirFighterEngine.drawAirFighterEngine(g, entityAirFighter.getAdditionalColor(), _startPosX, _startPosY);
- }
-}
-
diff --git a/ProjectAirFighter/src/DrawningAirFighterEngine.java b/ProjectAirFighter/src/DrawningAirFighterEngine.java
deleted file mode 100644
index 695d443..0000000
--- a/ProjectAirFighter/src/DrawningAirFighterEngine.java
+++ /dev/null
@@ -1,33 +0,0 @@
-import java.awt.*;
-
-public class DrawningAirFighterEngine {
- private EngineCount _engineCount;
- public void setEnumNumber(int engineCount) {
- for (EngineCount value : EngineCount.values()) {
- if (value.getEnumNumber() == engineCount) {
- _engineCount = value;
- return;
- }
- }
- }
- public void drawAirFighterEngine(Graphics g, Color color, float startPosX, float startPosY) {
- Graphics2D g2d = (Graphics2D) g;
- g2d.setColor(color);
- g2d.setStroke(new BasicStroke(4));
-
- if (_engineCount.getEnumNumber() >= 2){
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 69, 10, 2 );
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 3, 10, 2 );
- }
-
- if (_engineCount.getEnumNumber() >= 4){
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 62, 10, 2 );
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 10, 10, 2 );
- }
-
- if (_engineCount.getEnumNumber() >= 6){
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 55, 10, 2 );
- g2d.drawRect((int)startPosX + 30, (int) startPosY + 17, 10, 2 );
- }
- }
-}
diff --git a/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java b/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java
new file mode 100644
index 0000000..3979309
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/DrawningAirCraft.java
@@ -0,0 +1,203 @@
+package Drawnings;
+
+import Entities.EntityAirCraft;
+import MovementStrategy.MovementDirection;
+
+import java.awt.*;
+import java.util.Random;
+
+public class DrawningAirCraft {
+ private final EntityAirCraft entityAirCraft;
+
+ public EntityAirCraft getEntityAirCraft() {
+ return entityAirCraft;
+ }
+
+ private Integer _pictureWidth;
+ private Integer _pictureHeight;
+ protected Integer _startPosX;
+ protected Integer _startPosY;
+ private int _drawingAirCraftWidth = 66;
+ private int _drawingAirCraftHeight = 74;
+
+ public int GetPosX() {
+ return _startPosX;
+ }
+
+ public int GetPosY() {
+ return _startPosY;
+ }
+
+ public int GetWidth() {
+ return _drawingAirCraftWidth;
+ }
+
+ public int GetHeight() {
+ return _drawingAirCraftHeight;
+ }
+
+ private IDrawEngine drawEngine;
+
+ public DrawningAirCraft(int speed, float weight, Color bodyColor, int engineType) {
+ entityAirCraft = new EntityAirCraft(speed, weight, bodyColor);
+ _startPosY = null;
+ _startPosX = null;
+ _pictureWidth = null;
+ _pictureHeight = null;
+ switch (engineType) {
+ case 0:
+ drawEngine = new DrawningEngine();
+ break;
+ case 1:
+ drawEngine = new DrawningOvalEngine();
+ break;
+ case 2:
+ drawEngine = new DrawningLongEngine();
+ break;
+ }
+
+ Random random = new Random();
+ int[] countengine = {2, 4, 6};
+ int engineCount = countengine[random.nextInt(countengine.length)];
+ System.out.print(engineCount);
+ drawEngine.setNumber(engineCount);
+ }
+
+ protected DrawningAirCraft(int speed, float weight, Color bodyColor, int EngineType, int aircraftWidth, int aircraftHeight) {
+ this(speed, weight, bodyColor, EngineType);
+ _drawingAirCraftHeight = aircraftHeight;
+ _drawingAirCraftWidth = aircraftWidth;
+ }
+
+ public void setPosition(int x, int y) {
+ if (_pictureHeight == null || _pictureWidth == null)
+ return;
+ _startPosX = x;
+ _startPosY = y;
+
+ if (_drawingAirCraftWidth + x > _pictureWidth || x < 0) {
+ _startPosX = 0;
+ }
+ if (_drawingAirCraftHeight + y > _pictureHeight || y < 0) {
+ _startPosY = 0;
+ }
+ }
+
+ public boolean setPictureSize(int width, int height) {
+
+ if (_drawingAirCraftHeight > height || _drawingAirCraftWidth > width)
+ return false;
+ _pictureHeight = height;
+ _pictureWidth = width;
+
+ if (_startPosX != null && _startPosY != null) {
+ if (_startPosX + _drawingAirCraftWidth > width)
+ _startPosX = width - _drawingAirCraftWidth;
+ if (_startPosY + _drawingAirCraftHeight > height)
+ _startPosY = height - _drawingAirCraftHeight;
+ }
+ return true;
+ }
+
+ public boolean moveTransport(MovementDirection direction) {
+ if (entityAirCraft == null || _pictureWidth == null || _pictureHeight == null)
+ return false;
+ switch (direction) {
+ case MovementDirection.Left:
+ if (_startPosX - entityAirCraft.getStep() > 0)
+ _startPosX -= (int) entityAirCraft.getStep();
+ return true;
+ case MovementDirection.Up:
+ if (_startPosY - entityAirCraft.getStep() > 0)
+ _startPosY -= (int) entityAirCraft.getStep();
+ return true;
+ case MovementDirection.Right:
+ if (_startPosX + entityAirCraft.getStep() < _pictureWidth - _drawingAirCraftWidth)
+ _startPosX += (int) entityAirCraft.getStep();
+ return true;
+ case MovementDirection.Down:
+ if (_startPosY + entityAirCraft.getStep() < _pictureHeight - _drawingAirCraftHeight)
+ _startPosY += (int) entityAirCraft.getStep();
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public void drawAirCraft(Graphics g) {
+ if (entityAirCraft == null || _startPosX == null || _startPosY == null) {
+ return;
+ }
+
+ Graphics2D g2d = (Graphics2D) g;
+
+ Point[] rtail = new Point[]{
+ new Point(_startPosX + 10, _startPosY + 25),
+ new Point(_startPosX + 10, _startPosY + 8),
+ new Point(_startPosX + 20, _startPosY + 17),
+ new Point(_startPosX + 20, _startPosY + 25),
+ };
+ Polygon rtailPolygon = new Polygon();
+ for (Point point : rtail)
+ rtailPolygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirCraft.getBodyColor());
+ g2d.fillPolygon(rtailPolygon);
+
+ Point[] ltail = new Point[]{
+ new Point(_startPosX + 10, _startPosY + 49),
+ new Point(_startPosX + 10, _startPosY + 66),
+ new Point(_startPosX + 20, _startPosY + 57),
+ new Point(_startPosX + 20, _startPosY + 49),
+ };
+ Polygon ltailPolygon = new Polygon();
+ for (Point point : ltail)
+ ltailPolygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirCraft.getBodyColor());
+ g2d.fillPolygon(ltailPolygon);
+
+ Point[] rwing = new Point[]{
+ new Point(_startPosX + 45, _startPosY + 49),
+ new Point(_startPosX + 45, _startPosY + 74),
+ new Point(_startPosX + 37, _startPosY + 74),
+ new Point(_startPosX + 30, _startPosY + 49),
+ };
+ Polygon rwingPolygon = new Polygon();
+ for (Point point : rwing)
+ rwingPolygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirCraft.getBodyColor());
+ g2d.fillPolygon(rwingPolygon);
+
+ Point[] lwing = new Point[]{
+ new Point(_startPosX + 45, _startPosY + 25),
+ new Point(_startPosX + 45, _startPosY),
+ new Point(_startPosX + 37, _startPosY),
+ new Point(_startPosX + 30, _startPosY + 25),
+ };
+ Polygon lwingPolygon = new Polygon();
+ for (Point point : lwing)
+ lwingPolygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirCraft.getBodyColor());
+ g2d.fillPolygon(lwingPolygon);
+
+ g2d.drawRect(_startPosX + 10, _startPosY + 25, 50, 24);
+ g2d.fillRect(_startPosX + 10, _startPosY + 25, 50, 24);
+
+ Point[] nose = new Point[]{
+ new Point(_startPosX + 60, _startPosY + 25),
+ new Point(_startPosX + 76, _startPosY + 37),
+ new Point(_startPosX + 60, _startPosY + 49),
+ };
+ Polygon nosePolygon = new Polygon();
+ for (Point point : nose)
+ nosePolygon.addPoint(point.x, point.y);
+
+ g2d.setColor(Color.GRAY);
+ g2d.fillPolygon(nosePolygon);
+
+ drawEngine.drawEngine(g2d, entityAirCraft.getBodyColor(), _startPosX, _startPosY);
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java b/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java
new file mode 100644
index 0000000..aa62b56
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/DrawningAirFighter.java
@@ -0,0 +1,82 @@
+package Drawnings;
+
+import Entities.EntityAirFighter;
+
+import java.awt.*;
+
+public class DrawningAirFighter extends DrawningAirCraft {
+ private EntityAirFighter entityAirFighter;
+
+ public DrawningAirFighter(int speed, float weight, Color bodyColor, int engineType, Color additionalColor, boolean pgo, boolean rockets) {
+ super(speed, weight, bodyColor, engineType, 76, 80);
+ entityAirFighter = new EntityAirFighter(speed, weight, bodyColor, additionalColor, pgo, rockets);
+ }
+
+ public void drawAirCraft(Graphics g) {
+ if (entityAirFighter == null || _startPosX == null || _startPosY == null) {
+ return;
+ }
+ super.drawAirCraft(g);
+ Graphics2D g2d = (Graphics2D) g;
+
+ if (entityAirFighter.getPgo()) {
+ Point[] pgo1 = new Point[]{
+ new Point(_startPosX + 50, _startPosY + 25),
+ new Point(_startPosX + 50, _startPosY + 15),
+ new Point(_startPosX + 55, _startPosY + 25),
+ };
+ Polygon pgo1Polygon = new Polygon();
+ for (Point point : pgo1)
+ pgo1Polygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirFighter.getAdditionalColor());
+ g2d.fillPolygon(pgo1Polygon);
+
+ Point[] pgo2 = new Point[]{
+ new Point(_startPosX + 50, _startPosY + 49),
+ new Point(_startPosX + 50, _startPosY + 59),
+ new Point(_startPosX + 55, _startPosY + 49),
+ };
+ Polygon pgo2Polygon = new Polygon();
+ for (Point point : pgo2)
+ pgo2Polygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirFighter.getAdditionalColor());
+ g2d.fillPolygon(pgo2Polygon);
+ }
+
+ if (entityAirFighter.getRockets()) {
+ Point[] rocket1 = new Point[]{
+ new Point(_startPosX + 50, _startPosY + 71),
+ new Point(_startPosX + 50, _startPosY + 74),
+ new Point(_startPosX + 55, _startPosY + 69),
+ new Point(_startPosX + 50, _startPosY + 64),
+ };
+ Polygon rocket1Polygon = new Polygon();
+ for (Point point : rocket1)
+ rocket1Polygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirFighter.getAdditionalColor());
+ g2d.fillPolygon(rocket1Polygon);
+
+ g.drawRect(_startPosX + 45, _startPosY + 67, 5, 4);
+ g.fillRect(_startPosX + 45, _startPosY + 67, 5, 4);
+
+ Point[] rocket2 = new Point[]{
+ new Point(_startPosX + 50, _startPosY + 7),
+ new Point(_startPosX + 50, _startPosY + 10),
+ new Point(_startPosX + 55, _startPosY + 5),
+ new Point(_startPosX + 50, _startPosY),
+ };
+ Polygon rocket2Polygon = new Polygon();
+ for (Point point : rocket2)
+ rocket2Polygon.addPoint(point.x, point.y);
+
+ g2d.setColor(entityAirFighter.getAdditionalColor());
+ g2d.fillPolygon(rocket2Polygon);
+
+ g.drawRect(_startPosX + 45, _startPosY + 3, 5, 4);
+ g.fillRect(_startPosX + 45, _startPosY + 3, 5, 4);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Drawnings/DrawningEngine.java b/ProjectAirFighter/src/Drawnings/DrawningEngine.java
new file mode 100644
index 0000000..ded7e3f
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/DrawningEngine.java
@@ -0,0 +1,38 @@
+package Drawnings;
+
+import java.awt.*;
+
+public class DrawningEngine implements IDrawEngine {
+ private EngineCount _engineCount;
+
+ @Override
+ public void setNumber(int engineCount) {
+ for (EngineCount value : EngineCount.values()) {
+ if (value.getEnumNumber() == engineCount) {
+ _engineCount = value;
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void drawEngine(Graphics2D g2d, Color color, int _startX, int _startY) {
+ g2d.setColor(color);
+ g2d.setStroke(new BasicStroke(4));
+
+ if (_engineCount.getEnumNumber() >= 2){
+ g2d.drawRect(_startX + 30, _startY + 69, 10, 2 );
+ g2d.drawRect(_startX + 30, _startY + 3, 10, 2 );
+ }
+
+ if (_engineCount.getEnumNumber() >= 4){
+ g2d.drawRect(_startX + 30, _startY + 62, 10, 2 );
+ g2d.drawRect(_startX + 30, _startY + 10, 10, 2 );
+ }
+
+ if (_engineCount.getEnumNumber() >= 6){
+ g2d.drawRect(_startX + 30, _startY + 55, 10, 2 );
+ g2d.drawRect(_startX + 30, _startY + 17, 10, 2 );
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Drawnings/DrawningLongEngine.java b/ProjectAirFighter/src/Drawnings/DrawningLongEngine.java
new file mode 100644
index 0000000..cbf1dc9
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/DrawningLongEngine.java
@@ -0,0 +1,38 @@
+package Drawnings;
+
+import java.awt.*;
+
+public class DrawningLongEngine implements IDrawEngine {
+ private EngineCount _engineCount;
+
+ @Override
+ public void setNumber(int engineCount) {
+ for (EngineCount value : EngineCount.values()) {
+ if (value.getEnumNumber() == engineCount) {
+ _engineCount = value;
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void drawEngine(Graphics2D g2d, Color color, int _startX, int _startY) {
+ g2d.setColor(color);
+ g2d.setStroke(new BasicStroke(4));
+
+ if (_engineCount.getEnumNumber() >= 2) {
+ g2d.drawRoundRect(_startX + 25, _startY + 69, 15, 2, 5, 5);
+ g2d.drawRoundRect(_startX + 25, _startY + 3, 15, 2, 5, 5);
+ }
+
+ if (_engineCount.getEnumNumber() >= 4) {
+ g2d.drawRoundRect(_startX + 25, _startY + 62, 15, 2, 5, 5);
+ g2d.drawRoundRect(_startX + 25, _startY + 10, 15, 2, 5, 5);
+ }
+
+ if (_engineCount.getEnumNumber() >= 6) {
+ g2d.drawRoundRect(_startX + 25, _startY + 55, 15, 2, 5, 5);
+ g2d.drawRoundRect(_startX + 25, _startY + 17, 15, 2, 5, 5);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Drawnings/DrawningOvalEngine.java b/ProjectAirFighter/src/Drawnings/DrawningOvalEngine.java
new file mode 100644
index 0000000..066274b
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/DrawningOvalEngine.java
@@ -0,0 +1,38 @@
+package Drawnings;
+
+import java.awt.*;
+
+public class DrawningOvalEngine implements IDrawEngine {
+ private EngineCount _engineCount;
+
+ @Override
+ public void setNumber(int engineCount) {
+ for (EngineCount value : EngineCount.values()) {
+ if (value.getEnumNumber() == engineCount) {
+ _engineCount = value;
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void drawEngine(Graphics2D g2d, Color color, int _startX, int _startY) {
+ g2d.setColor(color);
+ g2d.setStroke(new BasicStroke(4));
+
+ if (_engineCount.getEnumNumber() >= 2) {
+ g2d.drawOval(_startX + 30, _startY + 69, 10, 2);
+ g2d.drawOval(_startX + 30, _startY + 3, 10, 2);
+ }
+
+ if (_engineCount.getEnumNumber() >= 4) {
+ g2d.drawOval(_startX + 30, _startY + 62, 10, 2);
+ g2d.drawOval(_startX + 30, _startY + 10, 10, 2);
+ }
+
+ if (_engineCount.getEnumNumber() >= 6) {
+ g2d.drawOval(_startX + 30, _startY + 55, 10, 2);
+ g2d.drawOval(_startX + 30, _startY + 17, 10, 2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/EngineCount.java b/ProjectAirFighter/src/Drawnings/EngineCount.java
similarity index 92%
rename from ProjectAirFighter/src/EngineCount.java
rename to ProjectAirFighter/src/Drawnings/EngineCount.java
index ed59643..30f4ced 100644
--- a/ProjectAirFighter/src/EngineCount.java
+++ b/ProjectAirFighter/src/Drawnings/EngineCount.java
@@ -1,3 +1,5 @@
+package Drawnings;
+
public enum EngineCount {
Two(2),
Three(4),
@@ -9,5 +11,4 @@ public enum EngineCount {
public int getEnumNumber() {
return EnumNumber;
}
-
-}
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Drawnings/IDrawEngine.java b/ProjectAirFighter/src/Drawnings/IDrawEngine.java
new file mode 100644
index 0000000..60f3109
--- /dev/null
+++ b/ProjectAirFighter/src/Drawnings/IDrawEngine.java
@@ -0,0 +1,8 @@
+package Drawnings;
+
+import java.awt.*;
+
+public interface IDrawEngine {
+ void setNumber(int x);
+ void drawEngine(Graphics2D graphics2D, Color color, int _startX, int _startY);
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Entities/EntityAirCraft.java b/ProjectAirFighter/src/Entities/EntityAirCraft.java
new file mode 100644
index 0000000..ae2634c
--- /dev/null
+++ b/ProjectAirFighter/src/Entities/EntityAirCraft.java
@@ -0,0 +1,28 @@
+package Entities;
+
+import java.awt.*;
+
+public class EntityAirCraft {
+ private int Speed;
+ public int getSpeed() {
+ return Speed;
+ }
+ private double Weight;
+ public double getWeight() {
+ return Weight;
+ }
+ private Color BodyColor;
+ public Color getBodyColor() {
+ return BodyColor;
+ }
+ private double Step;
+ public double getStep() {
+ return Speed*100/Weight;
+ }
+
+ public EntityAirCraft(int speed, double weight, Color bodyColor) {
+ Speed = speed;
+ Weight = weight;
+ BodyColor = bodyColor;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/Entities/EntityAirFighter.java b/ProjectAirFighter/src/Entities/EntityAirFighter.java
new file mode 100644
index 0000000..2098795
--- /dev/null
+++ b/ProjectAirFighter/src/Entities/EntityAirFighter.java
@@ -0,0 +1,24 @@
+package Entities;
+
+import java.awt.*;
+
+public class EntityAirFighter extends EntityAirCraft {
+ private Color AdditionalColor;
+ public Color getAdditionalColor() {
+ return AdditionalColor;
+ }
+ private boolean Pgo;
+ public boolean getPgo() {
+ return Pgo;
+ }
+ private boolean Rockets;
+ public boolean getRockets() {
+ return Rockets;
+ }
+ public EntityAirFighter(int speed, double weight, Color bodyColor, Color additionalColor, boolean pgo, boolean rockets) {
+ super(speed, weight, bodyColor);
+ AdditionalColor = additionalColor;
+ Pgo = pgo;
+ Rockets = rockets;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/EntityAirFighter.java b/ProjectAirFighter/src/EntityAirFighter.java
deleted file mode 100644
index 776b2c0..0000000
--- a/ProjectAirFighter/src/EntityAirFighter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-import java.awt.*;
-
-public class EntityAirFighter {
- private int Speed;
- public int getSpeed() {
- return Speed;
- }
- private double Weight;
- public double getWeight() {
- return Weight;
- }
- private Color BodyColor;
- public Color getBodyColor() {
- return BodyColor;
- }
- private Color AdditionalColor;
- public Color getAdditionalColor() {
- return AdditionalColor;
- }
- public double Step() {
- return Speed*100/Weight;
- }
- private boolean Pgo;
- public boolean getPgo() {
- return Pgo;
- }
- private boolean Rockets;
- public boolean getRockets() {
- return Rockets;
- }
- public void Init(int speed, double weight, Color bodyColor, Color additionalColor, boolean pgo, boolean rockets) {
- Speed = speed;
- Weight = weight;
- BodyColor = bodyColor;
- AdditionalColor = additionalColor;
- Pgo = pgo;
- Rockets = rockets;
- }
-}
diff --git a/ProjectAirFighter/src/FormAirFighter.form b/ProjectAirFighter/src/FormAirFighter.form
index f7539e7..fd0549c 100644
--- a/ProjectAirFighter/src/FormAirFighter.form
+++ b/ProjectAirFighter/src/FormAirFighter.form
@@ -8,61 +8,55 @@
-
+
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -73,9 +67,17 @@
+
+
+
+
+
+
+
+
-
+
@@ -86,6 +88,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ProjectAirFighter/src/FormAirFighter.java b/ProjectAirFighter/src/FormAirFighter.java
index 73e1a1e..cf00e67 100644
--- a/ProjectAirFighter/src/FormAirFighter.java
+++ b/ProjectAirFighter/src/FormAirFighter.java
@@ -1,3 +1,7 @@
+import Drawnings.DrawningAirCraft;
+import Drawnings.DrawningAirFighter;
+import MovementStrategy.*;
+
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
@@ -7,16 +11,45 @@ import java.util.Random;
import java.util.List;
public class FormAirFighter extends JFrame {
- protected DrawningAirFighter _drawningAirFighter = new DrawningAirFighter();
+ protected DrawningAirCraft _drawningAirCraft;
JPanel PanelWrapper;
private JPanel PictureBox;
- private JButton buttonCreate;
+ private JButton buttonCreateAirFighter;
+ private JButton buttonCreateAirCraft;
private JButton buttonRight;
private JButton buttonDown;
private JButton buttonLeft;
private JButton buttonUp;
-
+ private JComboBox comboBoxStrategy;
+ private JButton buttonStrategyStep;
+ private AbstractStrategy _strategy;
private List controls;
+
+ private void createObject(String type) {
+ Random random = new Random();
+ switch (type) {
+ case "Drawnings.DrawningAirCraft":
+ _drawningAirCraft = new DrawningAirCraft(random.nextInt(30,100), random.nextInt(100,500),
+ new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)), random.nextInt(3));
+ break;
+ case "Drawnings.DrawningAirFighter":
+ _drawningAirCraft = new DrawningAirFighter(random.nextInt(30,100), random.nextInt(100,500),
+ new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)), random.nextInt(3),
+ new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)),
+ random.nextBoolean(), random.nextBoolean());
+ break;
+ default:
+ return;
+ }
+ _drawningAirCraft.setPictureSize(PictureBox.getWidth(), PictureBox.getHeight());
+ _drawningAirCraft.setPosition(random.nextInt(25, 100),
+ random.nextInt(25, 100));
+ _strategy = null;
+ comboBoxStrategy.setEnabled(true);
+
+ Draw();
+ }
+
public FormAirFighter() {
buttonUp.setName("buttonUp");
buttonDown.setName("buttonDown");
@@ -25,25 +58,19 @@ public class FormAirFighter extends JFrame {
InitializeControlsRepaintList();
- buttonCreate.addActionListener(new ActionListener() {
+ buttonCreateAirFighter.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- _drawningAirFighter = new DrawningAirFighter();
- Random random = new Random();
-
- _drawningAirFighter.Init(random.nextInt(30, 100),
- random.nextInt(100, 500),
- new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)),
- new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)),
- random.nextBoolean(), random.nextBoolean() );
- _drawningAirFighter.setPictureSize(PictureBox.getWidth(), PictureBox.getHeight());
- _drawningAirFighter.setPosition(random.nextInt(25, 100),
- random.nextInt(25, 100));
-
- Draw();
+ createObject("Drawnings.DrawningAirFighter");
}
});
+ buttonCreateAirCraft.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ createObject("Drawnings.DrawningAirCraft");
+ }
+ });
ActionListener buttonMoveClickedListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -52,36 +79,72 @@ public class FormAirFighter extends JFrame {
switch (buttonName) {
case "buttonUp": {
- result = _drawningAirFighter.moveTransport(DirectionType.Up);
+ result = _drawningAirCraft.moveTransport(MovementDirection.Up);
}
break;
case "buttonDown": {
- result = _drawningAirFighter.moveTransport(DirectionType.Down);
+ result = _drawningAirCraft.moveTransport(MovementDirection.Down);
}
break;
case "buttonLeft": {
- result = _drawningAirFighter.moveTransport(DirectionType.Left);
+ result = _drawningAirCraft.moveTransport(MovementDirection.Left);
}
break;
case "buttonRight": {
- result = _drawningAirFighter.moveTransport(DirectionType.Right);
+ result = _drawningAirCraft.moveTransport(MovementDirection.Right);
}
break;
-
}
if (result)
Draw();
-
}
};
buttonRight.addActionListener(buttonMoveClickedListener);
buttonDown.addActionListener(buttonMoveClickedListener);
buttonLeft.addActionListener(buttonMoveClickedListener);
buttonUp.addActionListener(buttonMoveClickedListener);
+ comboBoxStrategy.addItem("К центру");
+ comboBoxStrategy.addItem("К краю");
+ buttonStrategyStep.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (_drawningAirCraft == null)
+ return;
+ if (comboBoxStrategy.isEnabled()) {
+ switch (comboBoxStrategy.getSelectedIndex()) {
+ case 0:
+ _strategy = new MoveToCenter();
+ break;
+ case 1:
+ _strategy = new MoveToBorder();
+ break;
+ default:
+ _strategy = null;
+ break;
+
+ }
+ if (_strategy == null) {
+ return;
+ }
+ _strategy.SetData(new MoveableAirCraft(_drawningAirCraft), PictureBox.getWidth(), PictureBox.getHeight());
+ }
+ if (_strategy == null) {
+ return;
+ }
+ _strategy.MakeStep();
+ Draw();
+ comboBoxStrategy.setEnabled(false);
+
+ if (_strategy.GetStatus() == StrategyStatus.Finish) {
+ comboBoxStrategy.setEnabled(true);
+ _strategy = null;
+ }
+ }
+ });
}
private void Draw() {
- if (_drawningAirFighter.getEntityAirFighter() == null)
+ if (_drawningAirCraft.getEntityAirCraft() == null)
return;
if (PictureBox.getWidth() == 0 || PictureBox.getHeight() == 0) {
return;
@@ -89,10 +152,9 @@ public class FormAirFighter extends JFrame {
Graphics g = PictureBox.getGraphics();
g.setColor(PictureBox.getBackground());
g.fillRect(0,0, PictureBox.getWidth(), PictureBox.getHeight());
- _drawningAirFighter.drawAirFighter(g);
+ _drawningAirCraft.drawAirCraft(g);
RepaintControls();
-
}
private void RepaintControls() {
for (JComponent control : controls) {
@@ -100,15 +162,15 @@ public class FormAirFighter extends JFrame {
}
}
-
private void InitializeControlsRepaintList() {
controls = new LinkedList<>();
- controls.add(buttonCreate);
+ controls.add(buttonCreateAirFighter);
+ controls.add(buttonCreateAirCraft);
controls.add(buttonUp);
controls.add(buttonDown);
controls.add(buttonLeft);
controls.add(buttonRight);
+ controls.add(comboBoxStrategy);
+ controls.add(buttonStrategyStep);
}
-
-
-}
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/AbstractStrategy.java b/ProjectAirFighter/src/MovementStrategy/AbstractStrategy.java
new file mode 100644
index 0000000..333abfd
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/AbstractStrategy.java
@@ -0,0 +1,66 @@
+package MovementStrategy;
+
+public abstract class AbstractStrategy {
+ private IMoveableObject _moveableObject;
+ private StrategyStatus _state = StrategyStatus.NotInit;
+ protected int FieldWidth;
+ protected int FieldHeight;
+ public StrategyStatus GetStatus() { return _state; }
+
+ public void SetData(IMoveableObject moveableObject, int width, int height)
+ {
+ if (moveableObject == null)
+ {
+ _state = StrategyStatus.NotInit;
+ return;
+ }
+ _state = StrategyStatus.InProgress;
+ _moveableObject = moveableObject;
+ FieldWidth = width;
+ FieldHeight = height;
+ }
+
+ public void MakeStep()
+ {
+ if (_state != StrategyStatus.InProgress)
+ {
+ return;
+ }
+ if (IsTargetDestination())
+ {
+ _state = StrategyStatus.Finish;
+ return;
+ }
+ MoveToTarget();
+ }
+
+ protected boolean MoveLeft() { return MoveTo(MovementDirection.Left); }
+ protected boolean MoveRight() { return MoveTo(MovementDirection.Right); }
+ protected boolean MoveUp() { return MoveTo(MovementDirection.Up); }
+ protected boolean MoveDown() { return MoveTo(MovementDirection.Down); }
+ protected ObjectParameters GetObjectParameters() { return _moveableObject.GetObjectPosition(); }
+
+ protected int GetStep()
+ {
+ if (_state != StrategyStatus.InProgress)
+ {
+ return 0;
+ }
+ return _moveableObject.GetStep();
+ }
+ protected abstract void MoveToTarget();
+ protected abstract boolean IsTargetDestination();
+ private boolean MoveTo(MovementDirection directionType)
+ {
+ if (_state != StrategyStatus.InProgress)
+ {
+ return false;
+ }
+ if (_moveableObject.TryMoveObject(directionType))
+ {
+ _moveableObject.MoveObject(directionType);
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/IMoveableObject.java b/ProjectAirFighter/src/MovementStrategy/IMoveableObject.java
new file mode 100644
index 0000000..0cb1a83
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/IMoveableObject.java
@@ -0,0 +1,8 @@
+package MovementStrategy;
+
+public interface IMoveableObject {
+ ObjectParameters GetObjectPosition();
+ int GetStep();
+ boolean TryMoveObject(MovementDirection direction);
+ void MoveObject(MovementDirection direction);
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/MoveToBorder.java b/ProjectAirFighter/src/MovementStrategy/MoveToBorder.java
new file mode 100644
index 0000000..52d6ad6
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/MoveToBorder.java
@@ -0,0 +1,47 @@
+package MovementStrategy;
+
+public class MoveToBorder extends AbstractStrategy {
+ protected boolean IsTargetDestination()
+ {
+ var objParams = GetObjectParameters();
+ if (objParams == null) {
+ return false;
+ }
+ return objParams.RightBorder() <= FieldWidth &&
+ objParams.RightBorder() + GetStep() >= FieldWidth &&
+ objParams.DownBorder() <= FieldHeight &&
+ objParams.DownBorder() + GetStep() >= FieldHeight;
+ }
+
+ protected void MoveToTarget()
+ {
+ var objParams = GetObjectParameters();
+ if (objParams == null) {
+ return;
+ }
+ int diffX = objParams.RightBorder() - FieldWidth;
+ if (Math.abs(diffX) > GetStep())
+ {
+ if (diffX > 0)
+ {
+ MoveLeft();
+ }
+ else
+ {
+ MoveRight();
+ }
+ }
+ int diffY = objParams.DownBorder() - FieldHeight;
+ if (Math.abs(diffY) > GetStep())
+ {
+ if (diffY > 0)
+ {
+ MoveUp();
+ }
+ else
+ {
+ MoveDown();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/MoveToCenter.java b/ProjectAirFighter/src/MovementStrategy/MoveToCenter.java
new file mode 100644
index 0000000..8a314f8
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/MoveToCenter.java
@@ -0,0 +1,46 @@
+package MovementStrategy;
+
+public class MoveToCenter extends AbstractStrategy {
+ protected boolean IsTargetDestination()
+ {
+ var objParams = GetObjectParameters();
+ if (objParams == null) {
+ return false;
+ }
+ return (objParams.ObjectMiddleHorizontal() - GetStep() <= FieldWidth / 2 &&
+ objParams.ObjectMiddleHorizontal() + GetStep() >= FieldWidth / 2 &&
+ objParams.ObjectMiddleVertical() - GetStep() <= FieldHeight / 2 &&
+ objParams.ObjectMiddleVertical() + GetStep() >= FieldHeight / 2);
+ }
+ protected void MoveToTarget()
+ {
+
+ var objParams = GetObjectParameters();
+ if (objParams == null) {
+ return;
+ }
+
+ var diffX = objParams.ObjectMiddleHorizontal() - FieldWidth / 2;
+ if (Math.abs(diffX) > GetStep()) {
+ if (diffX > 0)
+ {
+ MoveLeft();
+ }
+ else
+ {
+ MoveRight();
+ }
+ }
+ var diffY = objParams.ObjectMiddleVertical() - FieldHeight / 2;
+ if (Math.abs(diffY) > GetStep()) {
+ if (diffY > 0)
+ {
+ MoveUp();
+ }
+ else
+ {
+ MoveDown();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/MoveableAirCraft.java b/ProjectAirFighter/src/MovementStrategy/MoveableAirCraft.java
new file mode 100644
index 0000000..f1cc0a8
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/MoveableAirCraft.java
@@ -0,0 +1,24 @@
+package MovementStrategy;
+
+import Drawnings.DrawningAirCraft;
+
+public class MoveableAirCraft implements IMoveableObject {
+ private DrawningAirCraft _airCraft = null;
+ public MoveableAirCraft(DrawningAirCraft drawningAirCraft)
+ {
+ _airCraft = drawningAirCraft;
+ }
+
+ public ObjectParameters GetObjectPosition()
+ {
+ if (_airCraft == null || _airCraft.getEntityAirCraft() == null)
+ {
+ return null;
+ }
+ return new ObjectParameters(_airCraft.GetPosX(), _airCraft.GetPosY(), _airCraft.GetWidth(), _airCraft.GetHeight());
+ }
+
+ public int GetStep() { return (int) _airCraft.getEntityAirCraft().getStep(); }
+ public boolean TryMoveObject(MovementDirection direction) { return _airCraft.moveTransport(direction); }
+ public void MoveObject(MovementDirection direction) { _airCraft.moveTransport(direction); }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/MovementDirection.java b/ProjectAirFighter/src/MovementStrategy/MovementDirection.java
new file mode 100644
index 0000000..8c7cce5
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/MovementDirection.java
@@ -0,0 +1,8 @@
+package MovementStrategy;
+
+public enum MovementDirection {
+ Up,
+ Down,
+ Left,
+ Right;
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/ObjectParameters.java b/ProjectAirFighter/src/MovementStrategy/ObjectParameters.java
new file mode 100644
index 0000000..36d1273
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/ObjectParameters.java
@@ -0,0 +1,25 @@
+package MovementStrategy;
+
+public class ObjectParameters {
+ private int _x;
+ private int _y;
+ private int _width;
+ private int _height;
+
+ public int LeftBorder() { return _x; }
+ public int TopBorder() { return _y; }
+ public int RightBorder() { return _x + _width; }
+ public int DownBorder() { return _y + _height; }
+
+
+ public int ObjectMiddleHorizontal () { return _x + _width / 2; }
+ public int ObjectMiddleVertical () { return _y + _height / 2; }
+
+ public ObjectParameters(int x, int y, int width, int height)
+ {
+ _x = x;
+ _y = y;
+ _width = width;
+ _height = height;
+ }
+}
\ No newline at end of file
diff --git a/ProjectAirFighter/src/MovementStrategy/StrategyStatus.java b/ProjectAirFighter/src/MovementStrategy/StrategyStatus.java
new file mode 100644
index 0000000..c3c3950
--- /dev/null
+++ b/ProjectAirFighter/src/MovementStrategy/StrategyStatus.java
@@ -0,0 +1,7 @@
+package MovementStrategy;
+
+public enum StrategyStatus {
+ NotInit,
+ InProgress,
+ Finish
+}
\ No newline at end of file
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DirectionType.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DirectionType.class
deleted file mode 100644
index e7c83de..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DirectionType.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter$1.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter$1.class
deleted file mode 100644
index 9bd108e..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter$1.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter.class
deleted file mode 100644
index 3a46179..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighter.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighterEngine.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighterEngine.class
deleted file mode 100644
index 0ada883..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/DrawningAirFighterEngine.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningAirFighter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningAirFighter.class
new file mode 100644
index 0000000..2f2fa67
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningAirFighter.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningEngine.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningEngine.class
new file mode 100644
index 0000000..2cac72a
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningEngine.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningOvalEngine.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningOvalEngine.class
new file mode 100644
index 0000000..0e6ca4a
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/DrawningOvalEngine.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/EngineCount.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/EngineCount.class
new file mode 100644
index 0000000..fc2ebfc
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/EngineCount.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/IDrawEngine.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/IDrawEngine.class
new file mode 100644
index 0000000..b7090bb
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Drawnings/IDrawEngine.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EngineCount.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EngineCount.class
deleted file mode 100644
index 7157044..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EngineCount.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirCraft.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirCraft.class
new file mode 100644
index 0000000..c01e072
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirCraft.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirFighter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirFighter.class
new file mode 100644
index 0000000..17d625f
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/Entities/EntityAirFighter.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EntityAirFighter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EntityAirFighter.class
deleted file mode 100644
index b0b442c..0000000
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/EntityAirFighter.class and /dev/null differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$1.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$1.class
index 2b3997c..3706c14 100644
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$1.class and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$1.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$2.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$2.class
index 98499a1..a8ad31f 100644
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$2.class and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$2.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$3.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$3.class
new file mode 100644
index 0000000..33cd858
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$3.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$4.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$4.class
new file mode 100644
index 0000000..d4a4cde
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter$4.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter.class
index 7397c9d..3062b4a 100644
Binary files a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter.class and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/FormAirFighter.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/AbstractStrategy.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/AbstractStrategy.class
new file mode 100644
index 0000000..3680ff7
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/AbstractStrategy.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/IMoveableObject.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/IMoveableObject.class
new file mode 100644
index 0000000..7562433
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/IMoveableObject.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToBorder.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToBorder.class
new file mode 100644
index 0000000..64a6452
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToBorder.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToCenter.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToCenter.class
new file mode 100644
index 0000000..d00a617
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveToCenter.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveableAirCraft.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveableAirCraft.class
new file mode 100644
index 0000000..e33fd97
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MoveableAirCraft.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MovementDirection.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MovementDirection.class
new file mode 100644
index 0000000..5b5f329
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/MovementDirection.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/ObjectParameters.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/ObjectParameters.class
new file mode 100644
index 0000000..8f1a174
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/ObjectParameters.class differ
diff --git a/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/StrategyStatus.class b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/StrategyStatus.class
new file mode 100644
index 0000000..bd08a97
Binary files /dev/null and b/out/production/PIbd-14_Calimullin_A.R._AirFighter_Hard/MovementStrategy/StrategyStatus.class differ