From 83d8742229eb15484dd0d1897c60d24f98b217ad Mon Sep 17 00:00:00 2001 From: Fennel Kora <99110900+fencore@users.noreply.github.com> Date: Fri, 12 Apr 2024 23:54:50 -0400 Subject: [PATCH] finalized destination class, first commit for route class --- Destination.java | 3 +++ Route.java | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Route.java diff --git a/Destination.java b/Destination.java index 0329798..26a6bbf 100644 --- a/Destination.java +++ b/Destination.java @@ -29,4 +29,7 @@ public class Destination { //prompt error message } } + + public double[] getDestinationCoordinates() {return coordinates;} + public String getDestinationAddress() {return destinationAddress;} } \ No newline at end of file diff --git a/Route.java b/Route.java new file mode 100644 index 0000000..d55bac4 --- /dev/null +++ b/Route.java @@ -0,0 +1,22 @@ +public class Route { + private double[] currentLocation; //Lat-Long coordinates for current location + private double[][] routeSequence; //2D array of lat-long pairs that form a route sequence + private boolean tollsFlag; //stores user setting for whether to avoid tolls + private boolean hwyFlag; //stores user preference for whether to avoid major highways + public long timeEstimate; //time estimate in seconds + public float tollsAmount; //stores toll amount if toll roads are used + public Destination currentDestination; //uses user-created class Destination + + private void updateCurrentLocation() { + //execute api call out to GPS service to obtain current location + //current location will be hardcoded for testing + double[] tmpLoc = {28.1700863880887, -80.67088403224037}; + currentLocation = tmpLoc; + } + + private void calculateRoute() { + //execute api call out to routing service to get route info + updateCurrentLocation(); + //double[][] tmpSeq = apiCallToRouting(currentLocation, tmpLocation) + } +}