From: Erik V. <ev...@us...> - 2009-01-15 20:53:39
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14080/rails/game/specific/_1835 Modified Files: StockRound_1835.java Log Message: Fixed code to remove compiler warnings Index: StockRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/StockRound_1835.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StockRound_1835.java 23 Dec 2008 20:00:03 -0000 1.3 --- StockRound_1835.java 15 Jan 2009 20:53:28 -0000 1.4 *************** *** 9,13 **** public class StockRound_1835 extends StockRound { ! /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize --- 9,13 ---- public class StockRound_1835 extends StockRound { ! /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize *************** *** 19,51 **** super (aGameManager); } ! /** * The company release rules for 1835. ! * * For now these rules are hardcoded (which makes this code vulnerablt ! * to company name changes!). It did not seem worthwhile to * invent come complex XML for the unique 1835 rules on this matter. ! * * @param boughtfrom The portfolio from which a certificate has been bought. * @param company The company of which a share has been traded. */ protected void gameSpecificChecks (Portfolio boughtFrom, PublicCompanyI company) { ! if (boughtFrom != ipo) return; ! String name = company.getName(); int sharesInIPO = ipo.getShare(company); ! // Check for group releases if (sharesInIPO == 0) { ! if (name.equals("Sax") && ipo.getShare(companyManager.getCompanyByName("Bay")) == 0 ! || name.equals("Bay") && ipo.getShare(companyManager.getCompanyByName("Sax")) == 0) { // Group 1 sold out: release Badische releaseCompanyShares (companyManager.getCompanyByName("Bad")); ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"All", "Bad"})); } else if (name.equals("Bad") || name.equals("Wrt") || name.equals("Hes")) { if (ipo.getShare(companyManager.getCompanyByName("Bad")) == 0 --- 19,52 ---- super (aGameManager); } ! /** * The company release rules for 1835. ! * * For now these rules are hardcoded (which makes this code vulnerablt ! * to company name changes!). It did not seem worthwhile to * invent come complex XML for the unique 1835 rules on this matter. ! * * @param boughtfrom The portfolio from which a certificate has been bought. * @param company The company of which a share has been traded. */ + @Override protected void gameSpecificChecks (Portfolio boughtFrom, PublicCompanyI company) { ! if (boughtFrom != ipo) return; ! String name = company.getName(); int sharesInIPO = ipo.getShare(company); ! // Check for group releases if (sharesInIPO == 0) { ! if (name.equals("Sax") && ipo.getShare(companyManager.getCompanyByName("Bay")) == 0 ! || name.equals("Bay") && ipo.getShare(companyManager.getCompanyByName("Sax")) == 0) { // Group 1 sold out: release Badische releaseCompanyShares (companyManager.getCompanyByName("Bad")); ReportBuffer.add (LocalText.getText("SharesReleased", ! "All", "Bad")); } else if (name.equals("Bad") || name.equals("Wrt") || name.equals("Hes")) { if (ipo.getShare(companyManager.getCompanyByName("Bad")) == 0 *************** *** 55,63 **** releaseCompanyShares (companyManager.getCompanyByName("MS")); ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"All", "MS"})); } } } ! // Check for releases within group /* We leave out the Bayern/Sachsen connection, as the latter --- 56,64 ---- releaseCompanyShares (companyManager.getCompanyByName("MS")); ReportBuffer.add (LocalText.getText("SharesReleased", ! "All", "MS")); } } } ! // Check for releases within group /* We leave out the Bayern/Sachsen connection, as the latter *************** *** 68,73 **** releaseCompanyShares (companyManager.getCompanyByName("Wrt")); ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"All", "Wrt"})); ! } else if (sharesInIPO == 80) { // President sold: release four 10% Prussian shares for (int i=0; i<4; i++) { --- 69,74 ---- releaseCompanyShares (companyManager.getCompanyByName("Wrt")); ReportBuffer.add (LocalText.getText("SharesReleased", ! "All", "Wrt")); ! } else if (sharesInIPO == 80) { // President sold: release four 10% Prussian shares for (int i=0; i<4; i++) { *************** *** 75,79 **** } ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"4 10%", "Pr"})); } } else if (name.equals("Wrt")) { //Wurttembergische --- 76,80 ---- } ReportBuffer.add (LocalText.getText("SharesReleased", ! "4 10%", "Pr")); } } else if (name.equals("Wrt")) { //Wurttembergische *************** *** 81,85 **** releaseCompanyShares (companyManager.getCompanyByName("Hes")); ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"All", "Hes"})); } } else if (name.equals("MS")) { // Mecklenburg/Schwerin --- 82,86 ---- releaseCompanyShares (companyManager.getCompanyByName("Hes")); ReportBuffer.add (LocalText.getText("SharesReleased", ! "All", "Hes")); } } else if (name.equals("MS")) { // Mecklenburg/Schwerin *************** *** 87,91 **** releaseCompanyShares (companyManager.getCompanyByName("Old")); ReportBuffer.add (LocalText.getText("SharesReleased", ! new String[] {"All", "Old"})); } } --- 88,92 ---- releaseCompanyShares (companyManager.getCompanyByName("Old")); ReportBuffer.add (LocalText.getText("SharesReleased", ! "All", "Old")); } } |