Skip to content

Commit

Permalink
Renamed variable wantedLocale to requestedLocale
Browse files Browse the repository at this point in the history
  • Loading branch information
buma committed May 12, 2015
1 parent 7b9bf27 commit 13b3212
Showing 1 changed file with 11 additions and 11 deletions.
Expand Up @@ -689,7 +689,7 @@ private static void addRealTimeData(Leg leg, State[] states) {
*
* @return
*/
public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, WalkStep previous, Locale wantedLocale) {
public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, WalkStep previous, Locale requestedLocale) {
List<WalkStep> steps = new ArrayList<WalkStep>();
WalkStep step = null;
double lastAngle = 0, distance = 0; // distance used for appending elevation profiles
Expand Down Expand Up @@ -723,7 +723,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk
// before or will come after
if (edge instanceof ElevatorAlightEdge) {
// don't care what came before or comes after
step = createWalkStep(graph, forwardState, wantedLocale);
step = createWalkStep(graph, forwardState, requestedLocale);
createdNewStep = true;
disableZagRemovalForThisStep = true;

Expand All @@ -733,15 +733,15 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk
// exit != null and uses to <exit>
// the floor name is the AlightEdge name
// reset to avoid confusion with 'Elevator on floor 1 to floor 1'
step.streetName = ((ElevatorAlightEdge) edge).getName(wantedLocale);
step.streetName = ((ElevatorAlightEdge) edge).getName(requestedLocale);

step.relativeDirection = RelativeDirection.ELEVATOR;

steps.add(step);
continue;
}

String streetName = edge.getName(wantedLocale);
String streetName = edge.getName(requestedLocale);
int idx = streetName.indexOf('(');
String streetNameNoParens;
if (idx > 0)
Expand All @@ -751,7 +751,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk

if (step == null) {
// first step
step = createWalkStep(graph, forwardState, wantedLocale);
step = createWalkStep(graph, forwardState, requestedLocale);
createdNewStep = true;

steps.add(step);
Expand Down Expand Up @@ -782,15 +782,15 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk
roundaboutExit = 0;
}
/* start a new step */
step = createWalkStep(graph, forwardState, wantedLocale);
step = createWalkStep(graph, forwardState, requestedLocale);
createdNewStep = true;

steps.add(step);
if (edge.isRoundabout()) {
// indicate that we are now on a roundabout
// and use one-based exit numbering
roundaboutExit = 1;
roundaboutPreviousStreet = backState.getBackEdge().getName(wantedLocale);
roundaboutPreviousStreet = backState.getBackEdge().getName(requestedLocale);
idx = roundaboutPreviousStreet.indexOf('(');
if (idx > 0)
roundaboutPreviousStreet = roundaboutPreviousStreet.substring(0, idx - 1);
Expand Down Expand Up @@ -827,7 +827,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk
// the next edges will be PlainStreetEdges, we hope
double angleDiff = getAbsoluteAngleDiff(thisAngle, lastAngle);
for (Edge alternative : backState.getVertex().getOutgoingStreetEdges()) {
if (alternative.getName(wantedLocale).equals(streetName)) {
if (alternative.getName(requestedLocale).equals(streetName)) {
// alternatives that have the same name
// are usually caused by street splits
continue;
Expand All @@ -852,7 +852,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk
continue; // this is not an alternative
}
alternative = alternatives.get(0);
if (alternative.getName(wantedLocale).equals(streetName)) {
if (alternative.getName(requestedLocale).equals(streetName)) {
// alternatives that have the same name
// are usually caused by street splits
continue;
Expand All @@ -869,7 +869,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk

if (shouldGenerateContinue) {
// turn to stay on same-named street
step = createWalkStep(graph, forwardState, wantedLocale);
step = createWalkStep(graph, forwardState, requestedLocale);
createdNewStep = true;
steps.add(step);
step.setDirections(lastAngle, thisAngle, false);
Expand Down Expand Up @@ -962,7 +962,7 @@ public static List<WalkStep> generateWalkSteps(Graph graph, State[] states, Walk

// increment the total length for this step
step.distance += edge.getDistance();
step.addAlerts(graph.streetNotesService.getNotes(forwardState), wantedLocale);
step.addAlerts(graph.streetNotesService.getNotes(forwardState), requestedLocale);
lastAngle = DirectionUtils.getLastAngle(geom);

step.edges.add(edge);
Expand Down

0 comments on commit 13b3212

Please sign in to comment.