From: <ev...@us...> - 2011-04-03 11:57:12
|
Revision: 1509 http://rails.svn.sourceforge.net/rails/?rev=1509&view=rev Author: evos Date: 2011-04-03 11:57:06 +0000 (Sun, 03 Apr 2011) Log Message: ----------- Bug fix in 1851 initialisation code Modified Paths: -------------- trunk/18xx/rails/game/TrainManager.java Modified: trunk/18xx/rails/game/TrainManager.java =================================================================== --- trunk/18xx/rails/game/TrainManager.java 2011-04-03 11:56:18 UTC (rev 1508) +++ trunk/18xx/rails/game/TrainManager.java 2011-04-03 11:57:06 UTC (rev 1509) @@ -41,6 +41,9 @@ // Non-game attributes protected Portfolio ipo = null; + + // For initialisation only + boolean trainPriceAtFaceValueIfDifferentPresidents = false; /** * No-args constructor. @@ -84,8 +87,7 @@ Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special - gameManager.setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, - rulesTag.getChild("FaceValueIfDifferentPresidents") != null); + trainPriceAtFaceValueIfDifferentPresidents = rulesTag.getChild("FaceValueIfDifferentPresidents") != null; } // Finish initialisation of the train types @@ -131,6 +133,10 @@ if (removeTrain) { gameManager.setGameParameter(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR, true); } + + // Train trading between different players at face value only (1851) + gameManager.setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, + trainPriceAtFaceValueIfDifferentPresidents); } public void addTrain (String uniqueID, TrainI train) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |