Fixed route direction bug for transfer routes
This commit is contained in:
parent
6e11ad7afb
commit
f2ec482603
@ -152,7 +152,21 @@ public enum Station {
|
|||||||
List<Route> returnList = new ArrayList<Route>();
|
List<Route> returnList = new ArrayList<Route>();
|
||||||
final Collection<Line> applicableLines = Line.getLinesWithStations(
|
final Collection<Line> applicableLines = Line.getLinesWithStations(
|
||||||
this, dest);
|
this, dest);
|
||||||
|
if (transferLines != null && !transferLines.isEmpty()) {
|
||||||
|
for (Line transferLine : transferLines) {
|
||||||
|
int origIndex = transferLine.stations.indexOf(origin);
|
||||||
|
int destIndex = transferLine.stations.indexOf(origin
|
||||||
|
.getOutboundTransferStation());
|
||||||
|
|
||||||
|
isNorth = (origIndex < destIndex);
|
||||||
|
if (origin.invertDirection && transferLine.directionMayInvert) {
|
||||||
|
isNorth = !isNorth;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (Line line : applicableLines) {
|
for (Line line : applicableLines) {
|
||||||
|
if (transferLines == null || transferLines.isEmpty()) {
|
||||||
int origIndex = line.stations.indexOf(this);
|
int origIndex = line.stations.indexOf(this);
|
||||||
int destIndex = line.stations.indexOf(dest);
|
int destIndex = line.stations.indexOf(dest);
|
||||||
|
|
||||||
@ -160,6 +174,7 @@ public enum Station {
|
|||||||
if (line.directionMayInvert && this.invertDirection) {
|
if (line.directionMayInvert && this.invertDirection) {
|
||||||
isNorth = !isNorth;
|
isNorth = !isNorth;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Route route = new Route();
|
Route route = new Route();
|
||||||
route.setOrigin(origin);
|
route.setOrigin(origin);
|
||||||
route.setDirectLine(line);
|
route.setDirectLine(line);
|
||||||
|
Loading…
Reference in New Issue
Block a user