From: Erik V. <ev...@us...> - 2009-09-02 21:48:03
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24424/rails/game Modified Files: PublicCompanyI.java PublicCompany.java StockRound.java OperatingRound.java Log Message: Various fixes to CGR formation and operation Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** OperatingRound.java 1 Sep 2009 21:14:39 -0000 1.63 --- OperatingRound.java 2 Sep 2009 21:47:47 -0000 1.64 *************** *** 25,28 **** --- 25,30 ---- protected TreeMap<Integer, PublicCompanyI> operatingCompanies; + protected List<PublicCompanyI> companiesOperatedThisRound + = new ArrayList<PublicCompanyI> (); protected PublicCompanyI[] operatingCompanyArray; *************** *** 1152,1155 **** --- 1154,1158 ---- operatingCompany.setOperated(true); + companiesOperatedThisRound.add(operatingCompany); // Check if any privates must be closed Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** PublicCompany.java 1 Sep 2009 21:14:38 -0000 1.54 --- PublicCompany.java 2 Sep 2009 21:47:47 -0000 1.55 *************** *** 230,233 **** --- 230,235 ---- protected int maxLoansPerRound = 0; protected MoneyModel currentLoanValue = null; + + protected BooleanState canSharePriceVary = null; protected GameManagerI gameManager; *************** *** 588,591 **** --- 590,594 ---- parPrice = new PriceModel(this, name + "_ParPrice"); currentPrice = new PriceModel(this, name + "_CurrentPrice"); + canSharePriceVary = new BooleanState (name+"_CanSharePriceVary", true); } *************** *** 769,773 **** return mustHaveOperatedToTradeShares; } ! public void start(StockSpaceI startSpace) { --- 772,776 ---- return mustHaveOperatedToTradeShares; } ! public void start(StockSpaceI startSpace) { *************** *** 1279,1282 **** --- 1282,1289 ---- } + public boolean canSharePriceVary() { + return canSharePriceVary.booleanValue(); + } + public int getFixedPrice() { return fixedPrice; Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** PublicCompanyI.java 1 Sep 2009 21:14:38 -0000 1.31 --- PublicCompanyI.java 2 Sep 2009 21:47:47 -0000 1.32 *************** *** 246,250 **** public boolean hasParPrice(); ! public boolean isSplitAllowed(); --- 246,252 ---- public boolean hasParPrice(); ! ! public boolean canSharePriceVary(); ! public boolean isSplitAllowed(); Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** StockRound.java 14 Jul 2009 20:49:34 -0000 1.37 --- StockRound.java 2 Sep 2009 21:47:47 -0000 1.38 *************** *** 997,1001 **** } } ! stockMarket.sell(company, numberToSell); // Check if we still have the presidency --- 997,1001 ---- } } ! if (company.canSharePriceVary()) stockMarket.sell(company, numberToSell); // Check if we still have the presidency |