From: Erik V. <ev...@us...> - 2009-09-01 21:14:54
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31489/rails/game Modified Files: PublicCompanyI.java PublicCompany.java OperatingRound.java Log Message: Added running with borrowed train (CGR) Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** OperatingRound.java 31 Aug 2009 22:35:51 -0000 1.62 --- OperatingRound.java 1 Sep 2009 21:14:39 -0000 1.63 *************** *** 903,907 **** if (step == STEP_CALC_REVENUE) { ! if (operatingCompany.getPortfolio().getNumberOfTrains() == 0) { // No trains, then the revenue is zero. /* --- 903,908 ---- if (step == STEP_CALC_REVENUE) { ! //if (operatingCompany.getPortfolio().getNumberOfTrains() == 0) { ! if (!operatingCompany.canRunTrains()) { // No trains, then the revenue is zero. /* *************** *** 1937,1941 **** // There is only revenue if there are any trains ! if (operatingCompany.getPortfolio().getNumberOfTrains() > 0) { int[] allowedRevenueActions = operatingCompany.isSplitAlways() --- 1938,1942 ---- // There is only revenue if there are any trains ! if (operatingCompany.canRunTrains()) { int[] allowedRevenueActions = operatingCompany.isSplitAlways() Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** PublicCompany.java 31 Aug 2009 22:34:01 -0000 1.53 --- PublicCompany.java 1 Sep 2009 21:14:38 -0000 1.54 *************** *** 1405,1408 **** --- 1405,1412 ---- } + public boolean canRunTrains() { + return portfolio.getNumberOfTrains() > 0; + } + /** * Must be called in stead of Portfolio.buyTrain if side-effects can occur. *************** *** 1666,1670 **** public boolean canLoan() { ! return maxNumberOfLoans > 0; } --- 1670,1674 ---- public boolean canLoan() { ! return maxNumberOfLoans > 0; //TODO Does not work?? (see ORPanel) } Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** PublicCompanyI.java 31 Aug 2009 22:34:01 -0000 1.30 --- PublicCompanyI.java 1 Sep 2009 21:14:38 -0000 1.31 *************** *** 264,268 **** public int getNumberOfTrains(); ! public void initTurn(); --- 264,269 ---- public int getNumberOfTrains(); ! public boolean canRunTrains(); ! public void initTurn(); |