Update of /cvsroot/rails/18xx/rails/algorithms
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14508/rails/algorithms
Modified Files:
NetworkTrain.java NetworkVertex.java
Log Message:
Further minor fixes for revenue calculation (18EU)
Index: NetworkVertex.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkVertex.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** NetworkVertex.java 20 May 2010 23:13:21 -0000 1.14
--- NetworkVertex.java 21 May 2010 16:15:24 -0000 1.15
***************
*** 247,254 ****
// define locationName
if (station.getType().equals(Station.OFF_MAP_AREA)) {
! cityName = hex.getCityName();
} else {
! cityName = station.getCityName();
}
}
--- 247,260 ----
// define locationName
+ cityName = null;
if (station.getType().equals(Station.OFF_MAP_AREA)) {
! if (hex.getCityName() != null && !hex.getCityName().equals("")) {
! cityName = hex.getCityName();
! }
} else {
! if (hex.getCityName() != null && !hex.getCityName().equals("")
! && station.getCityName() != null && !station.getCityName().equals("")) {
! cityName = hex.getCityName() + "." + station.getCityName();
! }
}
}
Index: NetworkTrain.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkTrain.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** NetworkTrain.java 20 May 2010 23:13:21 -0000 1.9
--- NetworkTrain.java 21 May 2010 16:15:24 -0000 1.10
***************
*** 116,119 ****
--- 116,121 ----
public TrainTypeI getRailsTrainType() {
+ if (railsTrain == null) return null;
+
return railsTrain.getType();
}
|