diff --git a/Vehicle.java b/Vehicle.java index a290cc2..2d16c27 100644 --- a/Vehicle.java +++ b/Vehicle.java @@ -1,34 +1,41 @@ public class Vehicle { - private int speed; + private int currentSpeed; + private int targetSpeed; private double fuelLevel; + private int routeProgress; + Route currentRoute; - public void navigateRoute() { - - } - - public void setSpeed(int newSpeed) { - speed = newSpeed; - } - - public int getSpeed() { - return speed; - } - - public double getFuelLevel() { - return fuelLevel; - } - + 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 changeDirection() { + 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; } }