From: Stefan F. <ste...@us...> - 2010-05-24 07:49:34
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1851 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10363/rails/game/specific/_1851 Modified Files: OffBoardRevenueModifier.java BirminghamTileModifier.java Log Message: Activated 1851 Birmingam modifier and several minor beauty changes Index: BirminghamTileModifier.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1851/BirminghamTileModifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BirminghamTileModifier.java 23 May 2010 18:10:44 -0000 1.1 --- BirminghamTileModifier.java 24 May 2010 07:49:26 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- import java.util.Set; + import org.apache.log4j.Logger; import org.jgrapht.graph.SimpleGraph; *************** *** 15,18 **** --- 16,22 ---- public class BirminghamTileModifier implements NetworkGraphModifier { + protected static Logger log = + Logger.getLogger(BirminghamTileModifier.class.getPackage().getName()); + public void modifyGraph(NetworkGraphBuilder graphBuilder) { *************** *** 23,27 **** // this is a violation of the assumption that the track network only dependents on the map configuration // but not on other things (like phases) ! if (gm.getCurrentPhase().getIndex() >= 2 ) return; // 2. retrieve Birmingham vertices ... --- 27,35 ---- // this is a violation of the assumption that the track network only dependents on the map configuration // but not on other things (like phases) ! int phaseIndex = gm.getCurrentPhase().getIndex(); ! if (phaseIndex >= 2 ) { ! log.debug("Birmingham active, index of phase = " + phaseIndex); ! return; ! } // 2. retrieve Birmingham vertices ... *************** *** 31,34 **** --- 39,43 ---- // 3 ... and remove them from the graph graph.removeAllVertices(birmingVertices); + log.debug("Birmingham inactive, index of phase = " + phaseIndex); } Index: OffBoardRevenueModifier.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1851/OffBoardRevenueModifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OffBoardRevenueModifier.java 21 May 2010 16:30:32 -0000 1.1 --- OffBoardRevenueModifier.java 24 May 2010 07:49:26 -0000 1.2 *************** *** 30,38 **** // always two offboard areas and one other Set<NetworkVertex> destOffBoard = new HashSet<NetworkVertex>(offBoard); for (NetworkVertex offA:offBoard) { destOffBoard.remove(offA); for (NetworkVertex offB:destOffBoard) { for (NetworkVertex station:otherStations) { ! RevenueBonus bonus = new RevenueBonus(BONUS_VALUE, "OB/" + station.toString()); bonus.addVertex(offA); bonus.addVertex(offB); bonus.addVertex(station); revenueAdapter.addRevenueBonus(bonus); --- 30,42 ---- // always two offboard areas and one other Set<NetworkVertex> destOffBoard = new HashSet<NetworkVertex>(offBoard); + RevenueBonus bonus; for (NetworkVertex offA:offBoard) { destOffBoard.remove(offA); for (NetworkVertex offB:destOffBoard) { + bonus = new RevenueBonus(2*BONUS_VALUE, "OFFBOARD"); + bonus.addVertex(offA); bonus.addVertex(offB);; + revenueAdapter.addRevenueBonus(bonus); for (NetworkVertex station:otherStations) { ! bonus = new RevenueBonus(BONUS_VALUE, "OFFBOARD"); bonus.addVertex(offA); bonus.addVertex(offB); bonus.addVertex(station); revenueAdapter.addRevenueBonus(bonus); |