From 67b9c8b39b3ace1b636bc88b517254bbf3637176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Sat, 22 Oct 2022 16:24:50 +0400 Subject: [PATCH] Fix --- src/DrawingGasolineTanker.java | 12 ++++++------ src/DrawingImprovedGasolineTanker.java | 4 ++-- src/DrawingMap.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/DrawingGasolineTanker.java b/src/DrawingGasolineTanker.java index 9d414e0..4aedf6d 100644 --- a/src/DrawingGasolineTanker.java +++ b/src/DrawingGasolineTanker.java @@ -17,14 +17,14 @@ public class DrawingGasolineTanker { public DrawingGasolineTanker(int speed, float weight, Color bodyColor, int wheelsForm) { GasolineTanker = new EntityGasolineTanker(speed, weight, bodyColor); - Wheels= GetFormOfBlock(wheelsForm); + Wheels= GetFormOfWheels(wheelsForm); Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2)); } - public IDrawningObjectWheels GetFormOfBlock(int FormOfBlock){ + public IDrawningObjectWheels GetFormOfWheels(int FormOfWheel){ OrnamentForm temp = null; for (OrnamentForm form:OrnamentForm.values()) { - if(form.Value==FormOfBlock){ + if(form.Value==FormOfWheel){ temp = form; break; } @@ -42,13 +42,13 @@ public class DrawingGasolineTanker { return null; } - protected DrawingGasolineTanker(int speed, float weight, Color bodyColor,int warshipWidth, int warshipHeight) + protected DrawingGasolineTanker(int speed, float weight, Color bodyColor,int gasolineTankerWidth, int gasolineTankerHeight) { GasolineTanker = new EntityGasolineTanker(speed, weight, bodyColor); Wheels= new DrawingWheels(_wheels); Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2)); - _gasolineTankerWidth=warshipWidth; - _pictureHeight=warshipHeight; + _gasolineTankerWidth=gasolineTankerWidth; + _pictureHeight=gasolineTankerHeight; } public void SetPosition(int x, int y, int width, int height) diff --git a/src/DrawingImprovedGasolineTanker.java b/src/DrawingImprovedGasolineTanker.java index ac2b6dc..4a62c10 100644 --- a/src/DrawingImprovedGasolineTanker.java +++ b/src/DrawingImprovedGasolineTanker.java @@ -2,10 +2,10 @@ import java.awt.*; public class DrawingImprovedGasolineTanker extends DrawingGasolineTanker { - public DrawingImprovedGasolineTanker(int speed, float weight, Color bodyColor, Color dopColor, boolean bodyKit, boolean antena,int blockForm) { + public DrawingImprovedGasolineTanker(int speed, float weight, Color bodyColor, Color dopColor, boolean bodyKit, boolean antena,int wheelForm) { super(speed, weight, bodyColor, 160, 70); GasolineTanker=new EntityImprovedGasolineTanker(speed,weight,bodyColor,dopColor,bodyKit,antena); - Wheels= GetFormOfBlock(blockForm); + Wheels= GetFormOfWheels(wheelForm); Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2)); } diff --git a/src/DrawingMap.java b/src/DrawingMap.java index 01e4b0a..7d151d2 100644 --- a/src/DrawingMap.java +++ b/src/DrawingMap.java @@ -32,8 +32,8 @@ public class DrawingMap extends JPanel { Color color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)); if(color1==null) color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)); - DrawingGasolineTanker warship=new DrawingGasolineTanker(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3)); - SetData(warship); + DrawingGasolineTanker gasolineTanker=new DrawingGasolineTanker(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3)); + SetData(gasolineTanker); } public void CreateModifButtonAction(){ Random rand=new Random();