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)
|
public DrawingGasolineTanker(int speed, float weight, Color bodyColor, int wheelsForm)
|
||||||
{
|
{
|
||||||
GasolineTanker = new EntityGasolineTanker(speed, weight, bodyColor);
|
GasolineTanker = new EntityGasolineTanker(speed, weight, bodyColor);
|
||||||
Wheels= GetFormOfBlock(wheelsForm);
|
Wheels= GetFormOfWheels(wheelsForm);
|
||||||
Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2));
|
Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDrawningObjectWheels GetFormOfBlock(int FormOfBlock){
|
public IDrawningObjectWheels GetFormOfWheels(int FormOfWheel){
|
||||||
OrnamentForm temp = null;
|
OrnamentForm temp = null;
|
||||||
for (OrnamentForm form:OrnamentForm.values()) {
|
for (OrnamentForm form:OrnamentForm.values()) {
|
||||||
if(form.Value==FormOfBlock){
|
if(form.Value==FormOfWheel){
|
||||||
temp = form;
|
temp = form;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -42,13 +42,13 @@ public class DrawingGasolineTanker {
|
|||||||
return null;
|
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);
|
GasolineTanker = new EntityGasolineTanker(speed, weight, bodyColor);
|
||||||
Wheels= new DrawingWheels(_wheels);
|
Wheels= new DrawingWheels(_wheels);
|
||||||
Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2));
|
Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2));
|
||||||
_gasolineTankerWidth=warshipWidth;
|
_gasolineTankerWidth=gasolineTankerWidth;
|
||||||
_pictureHeight=warshipHeight;
|
_pictureHeight=gasolineTankerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPosition(int x, int y, int width, int height)
|
public void SetPosition(int x, int y, int width, int height)
|
||||||
|
@ -2,10 +2,10 @@ import java.awt.*;
|
|||||||
|
|
||||||
public class DrawingImprovedGasolineTanker extends DrawingGasolineTanker {
|
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);
|
super(speed, weight, bodyColor, 160, 70);
|
||||||
GasolineTanker=new EntityImprovedGasolineTanker(speed,weight,bodyColor,dopColor,bodyKit,antena);
|
GasolineTanker=new EntityImprovedGasolineTanker(speed,weight,bodyColor,dopColor,bodyKit,antena);
|
||||||
Wheels= GetFormOfBlock(blockForm);
|
Wheels= GetFormOfWheels(wheelForm);
|
||||||
Wheels.SetCountWheels((int)(2 + Math.random() + Math.random()*2));
|
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));
|
Color color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
||||||
if(color1==null)
|
if(color1==null)
|
||||||
color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
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));
|
DrawingGasolineTanker gasolineTanker=new DrawingGasolineTanker(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
|
||||||
SetData(warship);
|
SetData(gasolineTanker);
|
||||||
}
|
}
|
||||||
public void CreateModifButtonAction(){
|
public void CreateModifButtonAction(){
|
||||||
Random rand=new Random();
|
Random rand=new Random();
|
||||||
|
Loading…
Reference in New Issue
Block a user