38 lines
893 B
Java
38 lines
893 B
Java
import java.awt.*;
|
|
import java.util.Random;
|
|
public class EntityBoat {
|
|
private int Speed;
|
|
public int getSpeed() {
|
|
return Speed;
|
|
}
|
|
private void setSpeed(int Speed) {
|
|
this.Speed = Speed;
|
|
}
|
|
|
|
private float Weight;
|
|
public float getWeight() {
|
|
return Weight;
|
|
}
|
|
private void setWeight(float Weight) {
|
|
this.Weight = Weight;
|
|
}
|
|
|
|
private Color BodyColor;
|
|
public Color getBoColor() {
|
|
return BodyColor;
|
|
}
|
|
private void setBodyColor(Color BodyColor) {
|
|
this.BodyColor = BodyColor;
|
|
}
|
|
|
|
public float Step;
|
|
|
|
public void Init(int speed, float weight, Color bodyColor) {
|
|
Random rnd = new Random();
|
|
Speed = speed <= 0 ? rnd.nextInt(5, 30) : speed;
|
|
Weight = weight <= 0 ? rnd.nextInt(30, 100) : weight;
|
|
BodyColor = bodyColor;
|
|
Step = Speed * 100 / Weight;
|
|
}
|
|
}
|