From: Freek D. <mac...@us...> - 2010-01-31 22:23:10
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv382/rails/game/specific/_1856 Modified Files: CGRFormationRound.java OperatingRound_1856.java PublicCompany_CGR.java StockRound_1856.java Log Message: Fix indentation: Java files contain 4 spaces, not tabs Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** StockRound_1856.java 16 Jan 2010 14:09:51 -0000 1.13 --- StockRound_1856.java 31 Jan 2010 22:22:32 -0000 1.14 *************** *** 7,19 **** public class StockRound_1856 extends StockRound { ! /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize ! * ! * @param aGameManager The GameManager Object needed to initialize the Stock Round ! * ! */ ! public StockRound_1856 (GameManagerI aGameManager) { ! super (aGameManager); ! } /** --- 7,19 ---- public class StockRound_1856 extends StockRound { ! /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize ! * ! * @param aGameManager The GameManager Object needed to initialize the Stock Round ! * ! */ ! public StockRound_1856 (GameManagerI aGameManager) { ! super (aGameManager); ! } /** *************** *** 95,114 **** PublicCompanyI company) { ! if (company.getName().equalsIgnoreCase(PublicCompany_CGR.NAME) ! && ((PublicCompany_CGR)company).hasTemporaryPresident()) { ! log.debug("Resetting temp. president"); ipo.swapPresidentCertificate(company, currentPlayer.getPortfolio()); Player oldPresident = company.getPresident(); ! ((PublicCompany_CGR)company).setTemporaryPresident(null); ! company.getPresident().getPortfolio().getShareModel(company).update(); ! if (currentPlayer != oldPresident) { ! oldPresident.getPortfolio().getShareModel(company).update(); ! } ! } } ! @Override ! public void resume() { } --- 95,114 ---- PublicCompanyI company) { ! if (company.getName().equalsIgnoreCase(PublicCompany_CGR.NAME) ! && ((PublicCompany_CGR)company).hasTemporaryPresident()) { ! log.debug("Resetting temp. president"); ipo.swapPresidentCertificate(company, currentPlayer.getPortfolio()); Player oldPresident = company.getPresident(); ! ((PublicCompany_CGR)company).setTemporaryPresident(null); ! company.getPresident().getPortfolio().getShareModel(company).update(); ! if (currentPlayer != oldPresident) { ! oldPresident.getPortfolio().getShareModel(company).update(); ! } ! } } ! @Override ! public void resume() { } Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** CGRFormationRound.java 14 Jan 2010 20:56:45 -0000 1.31 --- CGRFormationRound.java 31 Jan 2010 22:22:32 -0000 1.32 *************** *** 22,26 **** private String cgrName = PublicCompany_CGR.NAME; private PublicCompany_CGR cgr ! = (PublicCompany_CGR)gameManager.getCompanyManager().getCompanyByName(cgrName); private List<TrainI> trainsToDiscardFrom = null; private boolean forcedTrainDiscard = true; --- 22,26 ---- private String cgrName = PublicCompany_CGR.NAME; private PublicCompany_CGR cgr ! = (PublicCompany_CGR)gameManager.getCompanyManager().getCompanyByName(cgrName); private List<TrainI> trainsToDiscardFrom = null; private boolean forcedTrainDiscard = true; *************** *** 36,43 **** private static int[][] certLimitsTable = { ! {10, 13, 15, 18, 20, 22, 25, 28}, ! {8, 10, 12, 14, 16, 18, 20, 22}, ! {7, 8, 10, 11, 13, 15, 16, 18}, ! {6, 7, 8, 10, 11, 12, 14, 15} }; --- 36,43 ---- private static int[][] certLimitsTable = { ! {10, 13, 15, 18, 20, 22, 25, 28}, ! {8, 10, 12, 14, 16, 18, 20, 22}, ! {7, 8, 10, 11, 13, 15, 16, 18}, ! {6, 7, 8, 10, 11, 12, 14, 15} }; *************** *** 66,70 **** ReportBuffer.add(LocalText.getText("StartFormationRound", ! cgrName, startingPlayer.getName())); --- 66,70 ---- ReportBuffer.add(LocalText.getText("StartFormationRound", ! cgrName, startingPlayer.getName())); *************** *** 167,171 **** numberOfLoans = currentCompany.getCurrentNumberOfLoans(); if (numberOfLoans == 0) { ! continue; } --- 167,171 ---- numberOfLoans = currentCompany.getCurrentNumberOfLoans(); if (numberOfLoans == 0) { ! continue; } *************** *** 424,428 **** // Clone the shares list first certs = new ArrayList<PublicCertificateI> ! (unavailable.getCertificatesPerCompany(PublicCompany_CGR.NAME)); for (PublicCertificateI cert : certs) { cert.moveTo(ipo); --- 424,428 ---- // Clone the shares list first certs = new ArrayList<PublicCertificateI> ! (unavailable.getCertificatesPerCompany(PublicCompany_CGR.NAME)); for (PublicCertificateI cert : certs) { cert.moveTo(ipo); *************** *** 431,443 **** // Assign the new president if (newPresident.getPortfolio().getShare(cgr) == cgr.getShareUnit()) { ! // Nobody has 2 shares, then takes the first player who has got one share ! log.debug("Nobody has two shares, creating a temp.pres.: "+firstCGRowner.getName()); ! cgr.setTemporaryPresident(firstCGRowner); ! newPresident = firstCGRowner; } else if (temporaryPresident != null && temporaryPresident != newPresident) { ! log.debug("Moving pres.share from "+temporaryPresident.getName() ! +" to "+newPresident.getName()); ! temporaryPresident.getPortfolio().swapPresidentCertificate(cgr, ! newPresident.getPortfolio()); } --- 431,443 ---- // Assign the new president if (newPresident.getPortfolio().getShare(cgr) == cgr.getShareUnit()) { ! // Nobody has 2 shares, then takes the first player who has got one share ! log.debug("Nobody has two shares, creating a temp.pres.: "+firstCGRowner.getName()); ! cgr.setTemporaryPresident(firstCGRowner); ! newPresident = firstCGRowner; } else if (temporaryPresident != null && temporaryPresident != newPresident) { ! log.debug("Moving pres.share from "+temporaryPresident.getName() ! +" to "+newPresident.getName()); ! temporaryPresident.getPortfolio().swapPresidentCertificate(cgr, ! newPresident.getPortfolio()); } *************** *** 482,486 **** cgr.start(startSpace); message = LocalText.getText("START_MERGED_COMPANY", ! PublicCompany_CGR.NAME, Bank.format(startSpace.getPrice()), startSpace.getName()); --- 482,486 ---- cgr.start(startSpace); message = LocalText.getText("START_MERGED_COMPANY", ! PublicCompany_CGR.NAME, Bank.format(startSpace.getPrice()), startSpace.getName()); *************** *** 502,508 **** gameManager.setPlayerCertificateLimit(newCertLimit); message = LocalText.getText("CertificateLimit", ! newCertLimit, ! numPlayers, ! numCompanies); DisplayBuffer.add(message); ReportBuffer.add(message); --- 502,508 ---- gameManager.setPlayerCertificateLimit(newCertLimit); message = LocalText.getText("CertificateLimit", ! newCertLimit, ! numPlayers, ! numCompanies); DisplayBuffer.add(message); ReportBuffer.add(message); *************** *** 516,520 **** for (PublicCompanyI comp : mergingCompanies) { ! // Exchange home tokens and collect non-home tokens for (TokenI token :comp.getTokens()) { if (token instanceof BaseToken) { --- 516,520 ---- for (PublicCompanyI comp : mergingCompanies) { ! // Exchange home tokens and collect non-home tokens for (TokenI token :comp.getTokens()) { if (token instanceof BaseToken) { *************** *** 545,549 **** // Move any still valid bonuses if (comp.getBonuses() != null) { ! List<Bonus> bonuses = new ArrayList<Bonus> (comp.getBonuses()); bonuses: for (Bonus bonus : bonuses) { comp.removeBonus(bonus); --- 545,549 ---- // Move any still valid bonuses if (comp.getBonuses() != null) { ! List<Bonus> bonuses = new ArrayList<Bonus> (comp.getBonuses()); bonuses: for (Bonus bonus : bonuses) { comp.removeBonus(bonus); *************** *** 569,575 **** } } ! cgr.addBonus(new Bonus(cgr, bonus.getName(), bonus.getValue(), bonus.getLocations())); ! } } } --- 569,575 ---- } } ! cgr.addBonus(new Bonus(cgr, bonus.getName(), bonus.getValue(), bonus.getLocations())); ! } } } *************** *** 683,687 **** @Override ! public boolean process (PossibleAction action) { boolean result = true; --- 683,687 ---- @Override ! public boolean process (PossibleAction action) { boolean result = true; *************** *** 831,838 **** public List<PublicCompanyI> getMergingCompanies() { ! return mergingCompanies; ! } ! @Override public String toString() { return "1856 CGRFormationRound"; --- 831,838 ---- public List<PublicCompanyI> getMergingCompanies() { ! return mergingCompanies; ! } ! @Override public String toString() { return "1856 CGRFormationRound"; Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** OperatingRound_1856.java 14 Jan 2010 20:56:29 -0000 1.28 --- OperatingRound_1856.java 31 Jan 2010 22:22:32 -0000 1.29 *************** *** 116,120 **** && ((PublicCompany_CGR)operatingCompany).runsWithBorrowedTrain()) { DisplayBuffer.add(LocalText.getText("RunsWithBorrowedTrain", ! PublicCompany_CGR.NAME, "D")); possibleActions.add(new SetDividend( operatingCompany.getLastRevenue(), true, --- 116,120 ---- && ((PublicCompany_CGR)operatingCompany).runsWithBorrowedTrain()) { DisplayBuffer.add(LocalText.getText("RunsWithBorrowedTrain", ! PublicCompany_CGR.NAME, "D")); possibleActions.add(new SetDividend( operatingCompany.getLastRevenue(), true, *************** *** 122,134 **** } else { ! int[] allowedRevenueActions = ! operatingCompany.isSplitAlways() ! ? new int[] { SetDividend.SPLIT } ! : operatingCompany.isSplitAllowed() ! ? new int[] { SetDividend.PAYOUT, ! SetDividend.SPLIT, ! SetDividend.WITHHOLD } ! : new int[] { SetDividend.PAYOUT, ! SetDividend.WITHHOLD }; // Check if any loan interest can be paid --- 122,134 ---- } else { ! int[] allowedRevenueActions = ! operatingCompany.isSplitAlways() ! ? new int[] { SetDividend.SPLIT } ! : operatingCompany.isSplitAllowed() ! ? new int[] { SetDividend.PAYOUT, ! SetDividend.SPLIT, ! SetDividend.WITHHOLD } ! : new int[] { SetDividend.PAYOUT, ! SetDividend.WITHHOLD }; // Check if any loan interest can be paid *************** *** 142,149 **** } ! possibleActions.add(new SetDividend( ! operatingCompany.getLastRevenue(), true, ! allowedRevenueActions, ! requiredCash)); } --- 142,149 ---- } ! possibleActions.add(new SetDividend( ! operatingCompany.getLastRevenue(), true, ! allowedRevenueActions, ! requiredCash)); } *************** *** 463,467 **** public void resume (List<PublicCompanyI> mergingCompanies) { ! // End of CGRFormationRound finalLoanRepaymentPending.set(false); guiHints.setActivePanel(GuiDef.Panel.MAP); --- 463,467 ---- public void resume (List<PublicCompanyI> mergingCompanies) { ! // End of CGRFormationRound finalLoanRepaymentPending.set(false); guiHints.setActivePanel(GuiDef.Panel.MAP); *************** *** 484,488 **** for (PublicCompanyI company : mergingCompanies) { ! if (companiesOperatedThisRound.contains(company)) cgrCanOperate = false; } --- 484,488 ---- for (PublicCompanyI company : mergingCompanies) { ! if (companiesOperatedThisRound.contains(company)) cgrCanOperate = false; } *************** *** 533,538 **** } ReportBuffer.add(LocalText.getText("EndOfFormationRound", ! cgr.getName(), ! getRoundName())); ReportBuffer.add (message); DisplayBuffer.add(message); --- 533,538 ---- } ReportBuffer.add(LocalText.getText("EndOfFormationRound", ! cgr.getName(), ! getRoundName())); ReportBuffer.add (message); DisplayBuffer.add(message); *************** *** 544,548 **** log.debug ("Next operating company: "+operatingCompany.getName()); } else { ! finishOR(); return false; } --- 544,548 ---- log.debug ("Next operating company: "+operatingCompany.getName()); } else { ! finishOR(); return false; } Index: PublicCompany_CGR.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/PublicCompany_CGR.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PublicCompany_CGR.java 8 Jan 2010 21:30:46 -0000 1.7 --- PublicCompany_CGR.java 31 Jan 2010 22:22:32 -0000 1.8 *************** *** 10,14 **** public class PublicCompany_CGR extends PublicCompany { ! public static final String NAME = "CGR"; /** Special rules apply before CGR has got its first permanent train */ --- 10,14 ---- public class PublicCompany_CGR extends PublicCompany { ! public static final String NAME = "CGR"; /** Special rules apply before CGR has got its first permanent train */ *************** *** 45,58 **** public boolean hasTemporaryPresident () { ! return getTemporaryPresident() != null; } public Player getTemporaryPresident() { ! if (temporaryPresident != null) { ! return (Player) temporaryPresident.getObject(); ! } else { ! return null; ! } ! } public boolean mayBuyTrainType (TrainI train) { --- 45,58 ---- public boolean hasTemporaryPresident () { ! return getTemporaryPresident() != null; } public Player getTemporaryPresident() { ! if (temporaryPresident != null) { ! return (Player) temporaryPresident.getObject(); ! } else { ! return null; ! } ! } public boolean mayBuyTrainType (TrainI train) { *************** *** 61,81 **** @Override ! public Player getPresident() { ! if (hasTemporaryPresident()) { ! return getTemporaryPresident(); ! } else { ! return super.getPresident(); ! } } ! public void setTemporaryPresident(Player temporaryPresident) { ! if (this.temporaryPresident == null) { ! this.temporaryPresident = new State ("CGR_TempPres", Player.class); ! } ! this.temporaryPresident.set(temporaryPresident); ! } ! @Override ! public boolean canRunTrains() { if (!hadPermanentTrain()) { return true; --- 61,81 ---- @Override ! public Player getPresident() { ! if (hasTemporaryPresident()) { ! return getTemporaryPresident(); ! } else { ! return super.getPresident(); ! } } ! public void setTemporaryPresident(Player temporaryPresident) { ! if (this.temporaryPresident == null) { ! this.temporaryPresident = new State ("CGR_TempPres", Player.class); ! } ! this.temporaryPresident.set(temporaryPresident); ! } ! @Override ! public boolean canRunTrains() { if (!hadPermanentTrain()) { return true; *************** *** 94,98 **** */ @Override ! public void withhold(int amount) { if (amount > 0) new CashMove(bank, this, amount); if (hasStockPrice && !runsWithBorrowedTrain()) { --- 94,98 ---- */ @Override ! public void withhold(int amount) { if (amount > 0) new CashMove(bank, this, amount); if (hasStockPrice && !runsWithBorrowedTrain()) { *************** *** 142,146 **** @Override ! public void adjustSharePrice (int actionPerformed, int numberOfSharesSold, StockMarketI stockMarket) { --- 142,146 ---- @Override ! public void adjustSharePrice (int actionPerformed, int numberOfSharesSold, StockMarketI stockMarket) { *************** *** 164,168 **** @Override ! public void setOperated() { super.setOperated(); --- 164,168 ---- @Override ! public void setOperated() { super.setOperated(); *************** *** 174,188 **** @Override ! public boolean mustOwnATrain() { ! if (!hadPermanentTrain()) { ! return false; ! } else { ! return super.mustOwnATrain(); ! } } @Override ! public String getExtraShareMarks () { ! return (hasTemporaryPresident() ? "T" : ""); } } --- 174,188 ---- @Override ! public boolean mustOwnATrain() { ! if (!hadPermanentTrain()) { ! return false; ! } else { ! return super.mustOwnATrain(); ! } } @Override ! public String getExtraShareMarks () { ! return (hasTemporaryPresident() ? "T" : ""); } } |