From ded836d6bb8e0929c59e96e3cfa405ec7e579d61 Mon Sep 17 00:00:00 2001 From: artur-kalimullin <144933634+artur-kalimullin@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:19:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectAirFighter/src/DrawningAirFighter.java | 10 +++++----- .../src/DrawningAirFighterEngine.java | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ProjectAirFighter/src/DrawningAirFighter.java b/ProjectAirFighter/src/DrawningAirFighter.java index 04e62c5..7556659 100644 --- a/ProjectAirFighter/src/DrawningAirFighter.java +++ b/ProjectAirFighter/src/DrawningAirFighter.java @@ -12,7 +12,7 @@ public class DrawningAirFighter { private Integer _startPosY; private final int _drawingAirFighterWidth = 76; private final int _drawingAirFighterHeight = 80; - public DrawningAirFighterEngine drawningAirFighterEngine; + public DrawningAirFighterEngine _drawningAirFighterEngine; public void Init(int speed, float weight, Color bodyColor, Color additionalColor, boolean pgo, boolean rockets) { entityAirFighter = new EntityAirFighter(); @@ -22,11 +22,11 @@ public class DrawningAirFighter { _pictureWidth = null; _pictureHeight = null; - drawningAirFighterEngine = new DrawningAirFighterEngine(); + _drawningAirFighterEngine = new DrawningAirFighterEngine(); Random random = new Random(); int[] countengine = {2, 4, 6}; - int paddlesCount = countengine[random.nextInt(countengine.length)]; - drawningAirFighterEngine.setEnumNumber(paddlesCount); + int engineCount = countengine[random.nextInt(countengine.length)]; + _drawningAirFighterEngine.setEnumNumber(engineCount); } public void setPosition(int x, int y) { @@ -218,7 +218,7 @@ public class DrawningAirFighter { g.fillRect(_startPosX + 45, _startPosY + 3, 5, 4); } - drawningAirFighterEngine.drawAirFighterEngine(g, entityAirFighter.getAdditionalColor(), _startPosX, _startPosY); + _drawningAirFighterEngine.drawAirFighterEngine(g, entityAirFighter.getAdditionalColor(), _startPosX, _startPosY); } } diff --git a/ProjectAirFighter/src/DrawningAirFighterEngine.java b/ProjectAirFighter/src/DrawningAirFighterEngine.java index 010d7df..02cc723 100644 --- a/ProjectAirFighter/src/DrawningAirFighterEngine.java +++ b/ProjectAirFighter/src/DrawningAirFighterEngine.java @@ -1,11 +1,11 @@ import java.awt.*; public class DrawningAirFighterEngine { - private EngineCount engineCount; - public void setEnumNumber(int wheelCount) { + private EngineCount _engineCount; + public void setEnumNumber(int engineCount) { for (EngineCount value : EngineCount.values()) { - if (value.getEnumNumber() == wheelCount) { - engineCount = value; + if (value.getEnumNumber() == engineCount) { + _engineCount = value; return; } } @@ -15,19 +15,19 @@ public class DrawningAirFighterEngine { g2d.setColor(color); g2d.setStroke(new BasicStroke(4)); - if (engineCount.getEnumNumber() == 2){ + 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){ + if (_engineCount.getEnumNumber() == 4){ g2d.drawRect((int)startPosX + 30, (int) startPosY + 69, 10, 2 ); g2d.drawRect((int)startPosX + 30, (int) startPosY + 62, 10, 2 ); g2d.drawRect((int)startPosX + 30, (int) startPosY + 3, 10, 2 ); g2d.drawRect((int)startPosX + 30, (int) startPosY + 10, 10, 2 ); } - if (engineCount.getEnumNumber() == 6){ + if (_engineCount.getEnumNumber() == 6){ g2d.drawRect((int)startPosX + 30, (int) startPosY + 69, 10, 2 ); g2d.drawRect((int)startPosX + 30, (int) startPosY + 62, 10, 2 ); g2d.drawRect((int)startPosX + 30, (int) startPosY + 55, 10, 2 );