Update of /cvsroot/rails/18xx/rails/algorithms
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv7598/rails/algorithms
Modified Files:
NetworkGraphBuilder.java
Log Message:
Fixed bug that stations with token of company were still highlighted
Index: NetworkGraphBuilder.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkGraphBuilder.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** NetworkGraphBuilder.java 17 Jun 2010 22:10:53 -0000 1.15
--- NetworkGraphBuilder.java 24 Jun 2010 22:34:07 -0000 1.16
***************
*** 216,225 ****
}
! public static List<MapHex> getStationHexes(Graph<NetworkVertex, NetworkEdge> graph,
PublicCompanyI company){
List<MapHex> hexes = new ArrayList<MapHex>();
for(NetworkVertex vertex:graph.vertexSet()) {
City city = vertex.getCity();
! if (city != null && city.hasTokenSlotsLeft()) {
hexes.add(vertex.getHex());
}
--- 216,225 ----
}
! public static List<MapHex> getTokenableStationHexes(Graph<NetworkVertex, NetworkEdge> graph,
PublicCompanyI company){
List<MapHex> hexes = new ArrayList<MapHex>();
for(NetworkVertex vertex:graph.vertexSet()) {
City city = vertex.getCity();
! if (city != null && city.hasTokenSlotsLeft() && !city.hasTokenOf(company)) {
hexes.add(vertex.getHex());
}
|