52 lines
1.1 KiB
Java
52 lines
1.1 KiB
Java
package Entities;
|
|
import java.awt.*;
|
|
|
|
public class EntityMonorail {
|
|
private int speed;
|
|
private int wheelCount;
|
|
private double weight;
|
|
private Color bodyColor;
|
|
|
|
|
|
public double getStep() {
|
|
return (double) speed * 130 / weight;
|
|
}
|
|
|
|
public void init(int wheelCount, int speed, double weight, Color bodyColor) {
|
|
setSpeed(speed);
|
|
setWeight(weight);
|
|
setBodyColor(bodyColor);
|
|
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 int getWheelCount(){
|
|
return wheelCount;
|
|
}
|
|
private void setWheelCount(int wheelCount){
|
|
this.wheelCount = wheelCount;
|
|
}
|
|
} |