41 lines
1.1 KiB
Java
41 lines
1.1 KiB
Java
public class Vehicle {
|
|
private int currentSpeed;
|
|
private int targetSpeed;
|
|
private double fuelLevel;
|
|
private int routeProgress;
|
|
Route currentRoute;
|
|
|
|
public void setTargetSpeed(int newSpeed) {targetSpeed = newSpeed;}
|
|
public int getCurrentSpeed() {return currentSpeed;}
|
|
public double getFuelLevel() {return fuelLevel;}
|
|
public void updateFuelLevel() {
|
|
//would check fuel sensor and update accordingly
|
|
fuelLevel = 0.75;
|
|
}
|
|
|
|
public void navigateRoute() {
|
|
for (String[] el : currentRoute.getSelectedRouteSteps()) {
|
|
System.out.println("Start navigation");
|
|
|
|
}
|
|
}
|
|
|
|
public void changeDirection(String direction) {
|
|
switch (direction) {
|
|
case "LEFT":
|
|
System.out.println("Turning left...");
|
|
break;
|
|
case "RIGHT":
|
|
System.out.println("Turning right...");
|
|
break;
|
|
case "STRAIGHT":
|
|
System.out.println("Continuing straight...");
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void applyBrakes() {
|
|
currentSpeed = currentSpeed - 5;
|
|
}
|
|
|
|
}
|