Skip to content

Commit

Permalink
Change TrainWrapper to provide Siding
Browse files Browse the repository at this point in the history
  • Loading branch information
zbx1425 committed Dec 31, 2023
1 parent 1ae13ba commit 495d496
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private PlatformLookupMap getTrainPlatforms() {
List<Long> routeIds = train.getRouteIds();
DataCache dataCache = ClientData.DATA_CACHE;
PlatformLookupMap result = new PlatformLookupMap();
result.siding = dataCache.sidingIdMap.get(train.sidingId);
if (routeIds.isEmpty()) return result;

int routeIndex = 0;
Expand Down Expand Up @@ -169,6 +170,7 @@ public List<PlatformInfo> getDebugThisRoutePlatforms(int count) {
}

private static class PlatformLookupMap {
public Siding siding;
public final List<PlatformInfo> platforms = new ArrayList<>();
public final TreeMap<Integer, Integer> pathToPlatformIndex = new TreeMap<>();
public final TreeMap<Integer, List<PlatformInfo>> pathToRoutePlatforms = new TreeMap<>();
Expand Down Expand Up @@ -208,7 +210,7 @@ public boolean shouldRenderDetail() {
}

@SuppressWarnings("unused") public long id() { return train.id; }
@SuppressWarnings("unused") public long sidingId() { return train.sidingId; }
@SuppressWarnings("unused") public Siding siding() { return trainPlatforms.siding; }
@SuppressWarnings("unused") public String trainTypeId() { return train.trainId; }
@SuppressWarnings("unused") public String baseTrainType() { return train.baseTrainType; }
@SuppressWarnings("unused") public TransportMode transportMode() { return train.transportMode; }
Expand Down

0 comments on commit 495d496

Please sign in to comment.