79 lines
1.9 KiB
Java
79 lines
1.9 KiB
Java
|
import java.awt.*;
|
||
|
|
||
|
public class Entity {
|
||
|
private int speed;
|
||
|
private int wheelCount;
|
||
|
private double weight;
|
||
|
private Color bodyColor;
|
||
|
private Color additionalColor;
|
||
|
private boolean monorails;
|
||
|
private boolean secondCabin;
|
||
|
|
||
|
public double getStep() {
|
||
|
return (double) speed * 130 / weight;
|
||
|
}
|
||
|
|
||
|
public void init(int wheelCount, int speed, double weight, Color bodyColor, Color additionalColor, boolean monorails, boolean secondCabin) {
|
||
|
setSpeed(speed);
|
||
|
setWeight(weight);
|
||
|
setBodyColor(bodyColor);
|
||
|
setAdditionalColor(additionalColor);
|
||
|
setMonorails(monorails);
|
||
|
setSecondCabin(secondCabin);
|
||
|
setWheelCount(wheelCount);
|
||
|
}
|
||
|
|
||
|
public int getSpeed() {
|
||
|
return speed;
|
||
|
}
|
||
|
|
||
|
private void setSpeed(int speed) {
|
||
|
this.speed = speed;
|
||
|
}
|
||
|
|
||
|
public double getWeight() {
|
||
|
return weight;
|
||
|
}
|
||
|
|
||
|
private void setWeight(double weight) {
|
||
|
this.weight = weight;
|
||
|
}
|
||
|
|
||
|
public Color getBodyColor() {
|
||
|
return bodyColor;
|
||
|
}
|
||
|
|
||
|
private void setBodyColor(Color bodyColor) {
|
||
|
this.bodyColor = bodyColor;
|
||
|
}
|
||
|
|
||
|
public Color getAdditionalColor() {
|
||
|
return additionalColor;
|
||
|
}
|
||
|
|
||
|
private void setAdditionalColor(Color additionalColor) {
|
||
|
this.additionalColor = additionalColor;
|
||
|
}
|
||
|
|
||
|
public boolean getMonorails() {
|
||
|
return monorails;
|
||
|
}
|
||
|
|
||
|
private void setMonorails(boolean monorails) {
|
||
|
this.monorails = monorails;
|
||
|
}
|
||
|
|
||
|
public boolean getSecondCabin() {
|
||
|
return secondCabin;
|
||
|
}
|
||
|
|
||
|
private void setSecondCabin(boolean secondCabin) {
|
||
|
this.secondCabin = secondCabin;
|
||
|
}
|
||
|
public int getWheelCount(){
|
||
|
return wheelCount;
|
||
|
}
|
||
|
private void setWheelCount(int wheelCount){
|
||
|
this.wheelCount = wheelCount;
|
||
|
}
|
||
|
}
|