added route singleton

This commit is contained in:
Sem van der Hoeven
2021-01-06 10:48:03 +01:00
parent abc58d3606
commit f6af7ae80b
4 changed files with 46 additions and 18 deletions

View File

@@ -11,24 +11,6 @@ public enum StaticData {
INSTANCE;
private double distanceTraveled = 0;
private int locationsVisited = 0;
private boolean isFollowingRoute = false;
private String routeName = "";
public void followRoute(Route route) {
routeName = route.getName();
setFollowingRoute(true);
}
public boolean isFollowingRoute(Route route) {
return isFollowingRoute && route.getName().equals(routeName);
}
public void setFollowingRoute(boolean followingRoute) {
isFollowingRoute = followingRoute;
}
public boolean isFollowingRoute() {
return isFollowingRoute;
}
private ArrayList<String> visitedNames = new ArrayList<>();