From: Erik V. <ev...@us...> - 2009-01-24 15:10:40
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8171/rails/game/specific/_18EU Modified Files: OperatingRound_18EU.java Log Message: Minor changes, mainly about better integrating TrainManager and removing static access to it. Index: OperatingRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/OperatingRound_18EU.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OperatingRound_18EU.java 23 Dec 2008 20:02:18 -0000 1.5 --- OperatingRound_18EU.java 24 Jan 2009 15:10:29 -0000 1.6 *************** *** 15,18 **** --- 15,20 ---- */ public class OperatingRound_18EU extends OperatingRound { + + protected TrainTypeI pullmannType; protected BooleanState hasPullmannAtStart = *************** *** 24,27 **** --- 26,30 ---- public OperatingRound_18EU (GameManagerI gameManager) { super (gameManager); + pullmannType = trainManager.getTypeByName("P"); } *************** *** 29,34 **** protected void initTurn() { super.initTurn(); ! hasPullmannAtStart.set(operatingCompany.getPortfolio().getTrainOfType( ! "P") != null); } --- 32,37 ---- protected void initTurn() { super.initTurn(); ! hasPullmannAtStart.set(operatingCompany.getPortfolio() ! .getTrainOfType(pullmannType) != null); } *************** *** 41,45 **** if (operatingCompany == null) return; ! TrainManagerI trainMgr = TrainManager.get(); int cash = operatingCompany.getCash(); --- 44,48 ---- if (operatingCompany == null) return; ! TrainManagerI trainMgr = gameManager.getTrainManager(); int cash = operatingCompany.getCash(); *************** *** 61,65 **** TrainI ownedPTrain = null; if (hasTrains) { ! ownedPTrain = operatingCompany.getPortfolio().getTrainOfType("P"); } --- 64,68 ---- TrainI ownedPTrain = null; if (hasTrains) { ! ownedPTrain = operatingCompany.getPortfolio().getTrainOfType(pullmannType); } *************** *** 164,168 **** protected boolean canBuyTrain() { return super.canBuyTrain() ! || operatingCompany.getPortfolio().getTrainOfType("P") != null && hasPullmannAtStart.booleanValue(); } --- 167,171 ---- protected boolean canBuyTrain() { return super.canBuyTrain() ! || operatingCompany.getPortfolio().getTrainOfType(pullmannType) != null && hasPullmannAtStart.booleanValue(); } *************** *** 201,205 **** // Check if the company has a Pullmann ! pullmann = portfolio.getTrainOfType("P"); // A Pullmann always goes first, and automatically. --- 204,208 ---- // Check if the company has a Pullmann ! pullmann = portfolio.getTrainOfType(pullmannType); // A Pullmann always goes first, and automatically. |