Fix
This commit is contained in:
parent
f4524f8624
commit
67b9c8b39b
@ -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)
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user