You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(46) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
|
Apr
|
May
(14) |
Jun
|
Jul
(13) |
Aug
(30) |
Sep
(83) |
Oct
(56) |
Nov
(148) |
Dec
(107) |
2010 |
Jan
(260) |
Feb
(164) |
Mar
(183) |
Apr
(99) |
May
(160) |
Jun
(40) |
Jul
(33) |
Aug
(48) |
Sep
(22) |
Oct
(24) |
Nov
(1) |
Dec
(12) |
2011 |
Jan
(6) |
Feb
(15) |
Mar
(13) |
Apr
(37) |
May
(27) |
Jun
(29) |
Jul
(33) |
Aug
(20) |
Sep
(17) |
Oct
(20) |
Nov
(33) |
Dec
(17) |
2012 |
Jan
(39) |
Feb
(38) |
Mar
(20) |
Apr
(21) |
May
(17) |
Jun
(22) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
From: Erik V. <ev...@us...> - 2008-12-24 14:51:49
|
Update of /cvsroot/rails/18xx/rails/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2666/rails/util Modified Files: Tag.java Log Message: New method hasChild (String) Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Tag.java 11 Dec 2008 20:12:30 -0000 1.8 --- Tag.java 24 Dec 2008 14:51:39 -0000 1.9 *************** *** 79,82 **** --- 79,87 ---- } } + + public boolean hasChild (String tagName) throws ConfigurationException { + + return getChildren ("AllowsMultipleBasesOfOneCompany") != null; + } public String getText() throws ConfigurationException { |
From: Erik V. <ev...@us...> - 2008-12-23 20:02:56
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27673/rails/ui/swing Modified Files: GameUIManager.java ReportWindow.java Log Message: Use new interface GameManagerI Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ReportWindow.java 11 Dec 2008 20:10:25 -0000 1.9 --- ReportWindow.java 23 Dec 2008 20:02:45 -0000 1.10 *************** *** 7,11 **** import javax.swing.*; ! import rails.game.GameManager; import rails.game.ReportBuffer; import rails.util.LocalText; --- 7,11 ---- import javax.swing.*; ! import rails.game.GameManagerI; import rails.game.ReportBuffer; import rails.util.LocalText; *************** *** 23,29 **** private JPanel messagePanel; private ReportWindow messageWindow; ! private GameManager gameManager; ! public ReportWindow(GameManager gameManager) { messageWindow = this; this.gameManager = gameManager; --- 23,29 ---- private JPanel messagePanel; private ReportWindow messageWindow; ! private GameManagerI gameManager; ! public ReportWindow(GameManagerI gameManager) { messageWindow = this; this.gameManager = gameManager; Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GameUIManager.java 7 Dec 2008 19:27:08 -0000 1.14 --- GameUIManager.java 23 Dec 2008 20:02:45 -0000 1.15 *************** *** 12,26 **** import rails.common.Defs; ! import rails.game.Bank; ! import rails.game.DisplayBuffer; ! import rails.game.Game; ! import rails.game.GameManager; ! import rails.game.OperatingRound; ! import rails.game.PhaseI; ! import rails.game.Player; ! import rails.game.PublicCompanyI; ! import rails.game.RoundI; ! import rails.game.StartRound; ! import rails.game.StockRound; import rails.game.action.GameAction; import rails.game.action.PossibleAction; --- 12,16 ---- import rails.common.Defs; ! import rails.game.*; import rails.game.action.GameAction; import rails.game.action.PossibleAction; *************** *** 43,47 **** public static ImageLoader imageLoader; ! private GameManager gameManager; private PossibleAction lastAction; private ActionPerformer activeWindow = null; --- 33,37 ---- public static ImageLoader imageLoader; ! private GameManagerI gameManager; private PossibleAction lastAction; private ActionPerformer activeWindow = null; *************** *** 289,293 **** } ! public GameManager getGameManager() { return gameManager; } --- 279,283 ---- } ! public GameManagerI getGameManager() { return gameManager; } |
From: Erik V. <ev...@us...> - 2008-12-23 20:02:24
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27634/rails/game/specific/_18EU Modified Files: OperatingRound_18EU.java FinalMinorExchangeRound.java GameManager_18EU.java Log Message: Apply new round initialisation logic. Fixed bugs: - Final Minor Exchange Round came immediately after OR in which first 5-train was bought in stead of before the next SR. - Starting player in FMER was last player to buy 5-train rather than first one. Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FinalMinorExchangeRound.java 7 Dec 2008 19:27:08 -0000 1.5 --- FinalMinorExchangeRound.java 23 Dec 2008 20:02:18 -0000 1.6 *************** *** 17,51 **** */ public class FinalMinorExchangeRound extends StockRound_18EU { - OperatingRound_18EU lastOR; ! /** ! * Constructor with no parameters, will call super class (StockRound_18EU's) Constructor to initialize ! * ! */ ! public FinalMinorExchangeRound() ! { ! super (); ! } ! ! /** ! * Constructor with the GameManager, will call super class (StockRound_18EU's) Constructor to initialize ! * ! * @param aGameManager The GameManager Object needed to initialize the Stock Round ! * ! */ ! public FinalMinorExchangeRound(GameManager aGameManager) { ! super (aGameManager); ! } ! ! public void start(OperatingRound_18EU lastOR) { ReportBuffer.add("\n" + LocalText.getText("StartFinalMinorExchangeRound")); ! this.lastOR = lastOR; ! Player firstPlayer = lastOR.getPlayerToStartExchangeRound(); ! setCurrentPlayerIndex(firstPlayer.getIndex()); initPlayer(); ReportBuffer.add(LocalText.getText("HasFirstTurn", ! new String[] { currentPlayer.getName() })); } --- 17,33 ---- */ public class FinalMinorExchangeRound extends StockRound_18EU { ! public FinalMinorExchangeRound(GameManagerI aGameManager) { ! super (aGameManager); ! } ! ! public void start(Player playerToStartFMERound) { ReportBuffer.add("\n" + LocalText.getText("StartFinalMinorExchangeRound")); ! setCurrentPlayerIndex(playerToStartFMERound.getIndex()); initPlayer(); ReportBuffer.add(LocalText.getText("HasFirstTurn", ! new String[] { playerToStartFMERound.getName() })); } *************** *** 71,75 **** List<PublicCompanyI> comps = ! Game.getCompanyManager().getAllPublicCompanies(); List<PublicCompanyI> minors = new ArrayList<PublicCompanyI>(); List<PublicCompanyI> targetCompanies = new ArrayList<PublicCompanyI>(); --- 53,57 ---- List<PublicCompanyI> comps = ! companyManager.getAllPublicCompanies(); List<PublicCompanyI> minors = new ArrayList<PublicCompanyI>(); List<PublicCompanyI> targetCompanies = new ArrayList<PublicCompanyI>(); Index: GameManager_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/GameManager_18EU.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GameManager_18EU.java 10 Dec 2008 20:44:48 -0000 1.3 --- GameManager_18EU.java 23 Dec 2008 20:02:18 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- import rails.game.GameManager; + import rails.game.Player; import rails.game.RoundI; *************** *** 11,22 **** public class GameManager_18EU extends GameManager { ! private OperatingRound_18EU lastOperatingRound = null; @Override public void nextRound(RoundI round) { ! if (round instanceof OperatingRound_18EU ! && ((OperatingRound_18EU) round).getPlayerToStartExchangeRound() != null) { ! lastOperatingRound = (OperatingRound_18EU) round; ! startFinalMinorExchangeRound(lastOperatingRound); } else if (round instanceof FinalMinorExchangeRound) { startStockRound(); --- 12,30 ---- public class GameManager_18EU extends GameManager { ! private Player playerToStartFMERound = null; @Override public void nextRound(RoundI round) { ! if (round instanceof OperatingRound_18EU) { ! if (((OperatingRound_18EU) round).getPlayerToStartExchangeRound() != null) { ! playerToStartFMERound = ((OperatingRound_18EU) round).getPlayerToStartExchangeRound(); ! } ! if (playerToStartFMERound != null ! && relativeORNumber.intValue() == numOfORs) { ! createRound (FinalMinorExchangeRound.class).start (playerToStartFMERound); ! playerToStartFMERound = null; ! } else { ! super.nextRound(round); ! } } else if (round instanceof FinalMinorExchangeRound) { startStockRound(); *************** *** 27,37 **** } - private void startFinalMinorExchangeRound(OperatingRound_18EU or) { - - FinalMinorExchangeRound sr = new FinalMinorExchangeRound(); - sr.setGameManager(this); - sr.start(or); - setRound (sr); - } - } --- 35,37 ---- Index: OperatingRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/OperatingRound_18EU.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OperatingRound_18EU.java 4 Jul 2008 20:46:33 -0000 1.4 --- OperatingRound_18EU.java 23 Dec 2008 20:02:18 -0000 1.5 *************** *** 21,24 **** --- 21,28 ---- protected State playerToStartExchangeRound = new State("PlayerToStartExchangeRound", Player.class); + + public OperatingRound_18EU (GameManagerI gameManager) { + super (gameManager); + } @Override *************** *** 173,177 **** // one to act in the Final Minor Exchange Round. if (result && gameManager.getPhaseManager().hasReachedPhase("5") ! && operatingCompanyArray[0].getTypeName().equals("Minor")) { playerToStartExchangeRound.set(operatingCompany.getPresident()); } --- 177,182 ---- // one to act in the Final Minor Exchange Round. if (result && gameManager.getPhaseManager().hasReachedPhase("5") ! && operatingCompanyArray[0].getTypeName().equals("Minor") ! && playerToStartExchangeRound.getObject() == null) { playerToStartExchangeRound.set(operatingCompany.getPresident()); } |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:26
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27402/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Apply new round initialisation logic Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OperatingRound_1856.java 20 Nov 2008 21:49:38 -0000 1.2 --- OperatingRound_1856.java 23 Dec 2008 20:00:20 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import rails.game.Bank; import rails.game.DisplayBuffer; + import rails.game.GameManagerI; import rails.game.OperatingRound; import rails.game.PublicCompanyI; *************** *** 18,21 **** --- 19,26 ---- public class OperatingRound_1856 extends OperatingRound { + public OperatingRound_1856 (GameManagerI gameManager) { + super (gameManager); + } + /** * Implements special rules for first time operating in 1856 |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:26
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18AL In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27402/rails/game/specific/_18AL Modified Files: OperatingRound_18AL.java Log Message: Apply new round initialisation logic Index: OperatingRound_18AL.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18AL/OperatingRound_18AL.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OperatingRound_18AL.java 4 Jun 2008 19:00:36 -0000 1.3 --- OperatingRound_18AL.java 23 Dec 2008 20:00:20 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- import rails.game.Bank; + import rails.game.GameManagerI; import rails.game.MapHex; import rails.game.OperatingRound; *************** *** 18,21 **** --- 19,26 ---- public class OperatingRound_18AL extends OperatingRound { + public OperatingRound_18AL (GameManagerI gameManager) { + super (gameManager); + } + @Override protected void setGameSpecificPossibleActions() { |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:14
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27301/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Apply new round initialisation logic Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** StockRound_18EU.java 13 Dec 2008 08:20:59 -0000 1.18 --- StockRound_18EU.java 23 Dec 2008 20:00:03 -0000 1.19 *************** *** 27,38 **** /** - * Constructor with no parameters, will call super class (StockRound's) Constructor to initialize - * - */ - public StockRound_18EU () { - super (); - } - - /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize * --- 27,30 ---- *************** *** 40,44 **** * */ ! public StockRound_18EU (GameManager aGameManager) { super (aGameManager); } --- 32,36 ---- * */ ! public StockRound_18EU (GameManagerI aGameManager) { super (aGameManager); } *************** *** 483,487 **** PublicCompanyI major = action.getSelectedTargetCompany(); PublicCertificateI cert = null; - Portfolio pool = Bank.getPool(); CashHolder cashDestination = null; // Bank --- 475,478 ---- |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:08
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27301/rails/game Modified Files: StockRound.java Log Message: Apply new round initialisation logic Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** StockRound.java 4 Dec 2008 00:54:43 -0000 1.33 --- StockRound.java 23 Dec 2008 20:00:03 -0000 1.34 *************** *** 4,10 **** import rails.game.action.*; ! import rails.game.move.CashMove; ! import rails.game.move.DoubleMapChange; ! import rails.game.move.MoveSet; import rails.game.special.*; import rails.game.state.*; --- 4,8 ---- import rails.game.action.*; ! import rails.game.move.*; import rails.game.special.*; import rails.game.state.*; *************** *** 60,71 **** /** - * Constructor with no parameters, call the super Class (Round's) Constructor with no parameters - * - */ - public StockRound () { - super (); - } - - /** * Constructor with the GameManager, will call super class (Round's) Constructor to initialize * --- 58,61 ---- *************** *** 73,81 **** * */ ! public StockRound (GameManager aGameManager) { super (aGameManager); - } - - public void start() { if (numberOfPlayers == 0) --- 63,68 ---- * */ ! public StockRound (GameManagerI aGameManager) { super (aGameManager); if (numberOfPlayers == 0) *************** *** 85,92 **** if (pool == null) pool = Bank.getPool(); if (unavailable == null) unavailable = Bank.getUnavailable(); - gameManager.setRound(this); sequenceRule = gameManager.getStockRoundSequenceRule(); ReportBuffer.add("\n" + LocalText.getText("StartStockRound") + getStockRoundNumber()); --- 72,82 ---- if (pool == null) pool = Bank.getPool(); if (unavailable == null) unavailable = Bank.getUnavailable(); sequenceRule = gameManager.getStockRoundSequenceRule(); + } + + public void start() { + ReportBuffer.add("\n" + LocalText.getText("StartStockRound") + getStockRoundNumber()); *************** *** 137,141 **** * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ --- 127,131 ---- * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ *************** *** 279,283 **** * Create a list of certificates that a player may sell in a Stock Round, * taking all rules taken into account. ! * * @return List of sellable certificates. */ --- 269,273 ---- * Create a list of certificates that a player may sell in a Stock Round, * taking all rules taken into account. ! * * @return List of sellable certificates. */ *************** *** 444,448 **** /** * Start a company by buying one or more shares (more applies to e.g. 1841) ! * * @param player The player that wants to start a company. * @param company The company to start. --- 434,438 ---- /** * Start a company by buying one or more shares (more applies to e.g. 1841) ! * * @param player The player that wants to start a company. * @param company The company to start. *************** *** 542,546 **** // All is OK, now start the company company.start(startSpace); ! CashHolder priceRecipient = getSharePriceRecipient (cert, price); --- 532,536 ---- // All is OK, now start the company company.start(startSpace); ! CashHolder priceRecipient = getSharePriceRecipient (cert, price); *************** *** 560,564 **** playerName, companyName, Bank.format(price), Bank.format(shares * price), String.valueOf(shares), ! String.valueOf(cert.getShare()), priceRecipient.getName()})); ReportBuffer.getAllWaiting(); --- 550,554 ---- playerName, companyName, Bank.format(price), Bank.format(shares * price), String.valueOf(shares), ! String.valueOf(cert.getShare()), priceRecipient.getName()})); ReportBuffer.getAllWaiting(); *************** *** 580,584 **** * Buying one or more single or double-share certificates (more is sometimes * possible) ! * * @param player The player that wants to buy shares. * @param action The executed BuyCertificates action --- 570,574 ---- * Buying one or more single or double-share certificates (more is sometimes * possible) ! * * @param player The player that wants to buy shares. * @param action The executed BuyCertificates action *************** *** 708,712 **** CashHolder priceRecipient = getSharePriceRecipient (cert, cash); ! if (number == 1) { ReportBuffer.add(LocalText.getText("BUY_SHARE_LOG", new String[] { --- 698,702 ---- CashHolder priceRecipient = getSharePriceRecipient (cert, cash); ! if (number == 1) { ReportBuffer.add(LocalText.getText("BUY_SHARE_LOG", new String[] { *************** *** 732,740 **** cash, priceRecipient); } ! if (priceRecipient != from.getOwner()) { ReportBuffer.add(LocalText.getText("PriceIsPaidTo", new String[] { ! Bank.format(price * shares), priceRecipient.getName() })); --- 722,730 ---- cash, priceRecipient); } ! if (priceRecipient != from.getOwner()) { ReportBuffer.add(LocalText.getText("PriceIsPaidTo", new String[] { ! Bank.format(price * shares), priceRecipient.getName() })); *************** *** 764,776 **** } ! protected void executeTradeCertificate(Certificate cert, Portfolio newHolder, int price, CashHolder priceRecipient) { ! cert.moveTo(newHolder); new CashMove (newHolder.getOwner(), priceRecipient, price); ! } ! /** * Who receives the cash when a certificate is bought. * With incremental capitalization, this can be the company treasure. --- 754,766 ---- } ! protected void executeTradeCertificate(Certificate cert, Portfolio newHolder, int price, CashHolder priceRecipient) { ! cert.moveTo(newHolder); new CashMove (newHolder.getOwner(), priceRecipient, price); ! } ! /** * Who receives the cash when a certificate is bought. * With incremental capitalization, this can be the company treasure. *************** *** 779,782 **** --- 769,773 ---- * @return */ + @Override protected CashHolder getSharePriceRecipient (Certificate cert, int price) { *************** *** 996,1000 **** otherPlayer.getPortfolio()); ReportBuffer.add(LocalText.getText("IS_NOW_PRES_OF", ! new String[] { otherPlayer.getName(), company.getName() })); break; --- 987,991 ---- otherPlayer.getPortfolio()); ReportBuffer.add(LocalText.getText("IS_NOW_PRES_OF", ! new String[] { otherPlayer.getName(), company.getName() })); break; *************** *** 1033,1037 **** /** * The current Player passes or is done. ! * * @param player Name of the passing player. * @return False if an error is found. --- 1024,1028 ---- /** * The current Player passes or is done. ! * * @param player Name of the passing player. * @return False if an error is found. *************** *** 1135,1138 **** --- 1126,1130 ---- * @return The index of the player that has the turn. */ + @Override public int getCurrentPlayerIndex() { return currentPlayer.getIndex(); *************** *** 1141,1145 **** /** * Can the current player do any selling? ! * * @return True if any selling is allowed. */ --- 1133,1137 ---- /** * Can the current player do any selling? ! * * @return True if any selling is allowed. */ *************** *** 1157,1161 **** /** * Can the current player do any buying? ! * * @return True if any buying is allowed. */ --- 1149,1153 ---- /** * Can the current player do any buying? ! * * @return True if any buying is allowed. */ |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:08
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27301/rails/game/specific/_1835 Modified Files: StockRound_1835.java Log Message: Apply new round initialisation logic Index: StockRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/StockRound_1835.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StockRound_1835.java 4 Dec 2008 00:55:48 -0000 1.2 --- StockRound_1835.java 23 Dec 2008 20:00:03 -0000 1.3 *************** *** 5,22 **** package rails.game.specific._1835; ! import rails.game.CompanyManagerI; ! import rails.game.GameManager; ! import rails.game.Portfolio; ! import rails.game.PublicCompanyI; ! import rails.game.ReportBuffer; ! import rails.game.StockRound; import rails.util.LocalText; public class StockRound_1835 extends StockRound { - //Portfolio ipo = Bank.getIpo(); - //Portfolio unavailable = Bank.getUnavailable(); - CompanyManagerI compMgr; - /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize --- 5,13 ---- package rails.game.specific._1835; ! import rails.game.*; import rails.util.LocalText; public class StockRound_1835 extends StockRound { /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize *************** *** 25,29 **** * */ ! public StockRound_1835 (GameManager aGameManager) { super (aGameManager); } --- 16,20 ---- * */ ! public StockRound_1835 (GameManagerI aGameManager) { super (aGameManager); } *************** *** 44,50 **** if (boughtFrom != ipo) return; - if (compMgr == null) compMgr = gameManager.getCompanyManager(); - - String name = company.getName(); int sharesInIPO = ipo.getShare(company); --- 35,38 ---- *************** *** 53,69 **** if (sharesInIPO == 0) { if (name.equals("Sax") && ! ipo.getShare(compMgr.getCompanyByName("Bay")) == 0 || name.equals("Bay") && ! ipo.getShare(compMgr.getCompanyByName("Sax")) == 0) { // Group 1 sold out: release Badische ! releaseCompanyShares (compMgr.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(compMgr.getCompanyByName("Bad")) == 0 ! && ipo.getShare(compMgr.getCompanyByName("Wrt")) == 0 ! && ipo.getShare(compMgr.getCompanyByName("Hes")) == 0) { // Group 2 sold out: release MS ! releaseCompanyShares (compMgr.getCompanyByName("MS")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "MS"})); --- 41,57 ---- 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 ! && ipo.getShare(companyManager.getCompanyByName("Wrt")) == 0 ! && ipo.getShare(companyManager.getCompanyByName("Hes")) == 0) { // Group 2 sold out: release MS ! releaseCompanyShares (companyManager.getCompanyByName("MS")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "MS"})); *************** *** 78,82 **** if (name.equals("Bad")) { if (sharesInIPO == 50) { // 50% sold: release Wurttemberg ! releaseCompanyShares (compMgr.getCompanyByName("Wrt")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Wrt"})); --- 66,70 ---- if (name.equals("Bad")) { if (sharesInIPO == 50) { // 50% sold: release Wurttemberg ! releaseCompanyShares (companyManager.getCompanyByName("Wrt")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Wrt"})); *************** *** 91,95 **** } else if (name.equals("Wrt")) { //Wurttembergische if (sharesInIPO == 50) { // 50% sold: release Hessische ! releaseCompanyShares (compMgr.getCompanyByName("Hes")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Hes"})); --- 79,83 ---- } else if (name.equals("Wrt")) { //Wurttembergische if (sharesInIPO == 50) { // 50% sold: release Hessische ! releaseCompanyShares (companyManager.getCompanyByName("Hes")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Hes"})); *************** *** 97,101 **** } else if (name.equals("MS")) { // Mecklenburg/Schwerin if (sharesInIPO == 40) { // 60% sold: release Oldenburg ! releaseCompanyShares (compMgr.getCompanyByName("Old")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Old"})); --- 85,89 ---- } else if (name.equals("MS")) { // Mecklenburg/Schwerin if (sharesInIPO == 40) { // 60% sold: release Oldenburg ! releaseCompanyShares (companyManager.getCompanyByName("Old")); ReportBuffer.add (LocalText.getText("SharesReleased", new String[] {"All", "Old"})); |
From: Erik V. <ev...@us...> - 2008-12-23 20:00:08
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27301/rails/game/specific/_1856 Modified Files: StockRound_1856.java Log Message: Apply new round initialisation logic Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StockRound_1856.java 11 Dec 2008 20:12:30 -0000 1.6 --- StockRound_1856.java 23 Dec 2008 20:00:03 -0000 1.7 *************** *** 12,16 **** * */ ! public StockRound_1856 (GameManager aGameManager) { super (aGameManager); } --- 12,16 ---- * */ ! public StockRound_1856 (GameManagerI aGameManager) { super (aGameManager); } |
From: Erik V. <ev...@us...> - 2008-12-23 19:59:16
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27252/rails/game/specific/_18EU Modified Files: StartRound_18EU.java Log Message: Apply new round initialisation logic Index: StartRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StartRound_18EU.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StartRound_18EU.java 30 Jun 2008 20:35:30 -0000 1.4 --- StartRound_18EU.java 23 Dec 2008 19:59:06 -0000 1.5 *************** *** 4,18 **** import java.util.List; ! import rails.game.Bank; ! import rails.game.DisplayBuffer; ! import rails.game.Player; ! import rails.game.PublicCertificateI; ! import rails.game.ReportBuffer; ! import rails.game.StartItem; ! import rails.game.StartPacket; ! import rails.game.StartRound; ! import rails.game.action.BidStartItem; ! import rails.game.action.BuyStartItem; ! import rails.game.action.NullAction; import rails.game.move.MoveSet; import rails.game.state.IntegerState; --- 4,9 ---- import java.util.List; ! import rails.game.*; ! import rails.game.action.*; import rails.game.move.MoveSet; import rails.game.state.IntegerState; *************** *** 45,50 **** * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_18EU() { ! super(); hasBidding = true; hasBasePrices = false; --- 36,41 ---- * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_18EU(GameManagerI gameManager) { ! super(gameManager); hasBidding = true; hasBasePrices = false; *************** *** 53,62 **** /** * Start the 18EU-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start(StartPacket startPacket) { ! super.start(startPacket); setStep(SELECT_STEP); --- 44,53 ---- /** * Start the 18EU-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start() { ! super.start(); setStep(SELECT_STEP); *************** *** 68,72 **** * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ --- 59,63 ---- * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ *************** *** 180,184 **** /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. --- 171,175 ---- /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. *************** *** 298,302 **** /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ --- 289,293 ---- /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ |
From: Erik V. <ev...@us...> - 2008-12-23 19:59:15
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1851 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27252/rails/game/specific/_1851 Modified Files: StartRound_1851.java Log Message: Apply new round initialisation logic Index: StartRound_1851.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1851/StartRound_1851.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StartRound_1851.java 30 Jun 2008 20:35:30 -0000 1.6 --- StartRound_1851.java 23 Dec 2008 19:59:06 -0000 1.7 *************** *** 16,21 **** * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1851() { ! super(); hasBidding = false; } --- 16,21 ---- * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1851(GameManagerI gameManager) { ! super(gameManager); hasBidding = false; } *************** *** 23,32 **** /** * Start the 1835-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start(StartPacket startPacket) { ! super.start(startPacket); if (!setPossibleActions()) { --- 23,32 ---- /** * Start the 1835-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start() { ! super.start(); if (!setPossibleActions()) { *************** *** 45,49 **** * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ --- 45,49 ---- * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ *************** *** 102,106 **** /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ --- 102,106 ---- /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ |
From: Erik V. <ev...@us...> - 2008-12-23 19:59:15
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27252/rails/game Modified Files: StartRoundI.java StartRound_1835.java StartRound.java Log Message: Apply new round initialisation logic Index: StartRoundI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRoundI.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StartRoundI.java 4 Jun 2008 19:00:31 -0000 1.5 --- StartRoundI.java 23 Dec 2008 19:59:06 -0000 1.6 *************** *** 9,13 **** public interface StartRoundI extends RoundI { ! public void start(StartPacket startPacket); public List<StartItem> getStartItems(); --- 9,13 ---- public interface StartRoundI extends RoundI { ! public void start(); public List<StartItem> getStartItems(); Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** StartRound.java 20 Nov 2008 21:49:38 -0000 1.21 --- StartRound.java 23 Dec 2008 19:59:06 -0000 1.22 *************** *** 41,56 **** /** * Will be created dynamically. ! * */ ! public StartRound() {} /** * Start the start round. ! * * @param startPacket The startpacket to be sold in this start round. */ ! public void start(StartPacket startPacket) { - this.startPacket = startPacket; this.variant = Game.getGameOption(GameManager.VARIANT_KEY); if (variant == null) variant = ""; --- 41,59 ---- /** * Will be created dynamically. ! * */ ! public StartRound(GameManagerI gameManager) { ! ! super (gameManager); ! this.startPacket = gameManager.getStartPacket(); ! } /** * Start the start round. ! * * @param startPacket The startpacket to be sold in this start round. */ ! public void start() { this.variant = Game.getGameOption(GameManager.VARIANT_KEY); if (variant == null) variant = ""; *************** *** 73,77 **** auctionItemState.set(null); - gameManager.setRound(this); setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); currentPlayer = getCurrentPlayer(); --- 76,79 ---- *************** *** 153,157 **** /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. --- 155,159 ---- /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. *************** *** 162,166 **** /** * Buy a start item against the base price. ! * * @param playerName Name of the buying player. * @param itemName Name of the bought start item. --- 164,168 ---- /** * Buy a start item against the base price. ! * * @param playerName Name of the buying player. * @param itemName Name of the bought start item. *************** *** 238,242 **** /** * This method executes the start item buy action. ! * * @param player Buying player. * @param item Start item being bought. --- 240,244 ---- /** * This method executes the start item buy action. ! * * @param player Buying player. * @param item Start item being bought. *************** *** 292,296 **** /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ --- 294,298 ---- /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ *************** *** 301,308 **** /** * Get the currentPlayer index in the player list (starting at 0). ! * * @return The index of the current Player. * @see GameManager.getCurrentPlayerIndex(). */ public int getCurrentPlayerIndex() { return gameManager.getCurrentPlayerIndex(); --- 303,311 ---- /** * Get the currentPlayer index in the player list (starting at 0). ! * * @return The index of the current Player. * @see GameManager.getCurrentPlayerIndex(). */ + @Override public int getCurrentPlayerIndex() { return gameManager.getCurrentPlayerIndex(); *************** *** 326,330 **** /** * Get a list of items that may be bought immediately. ! * * @return An array of start items, possibly empry. */ --- 329,333 ---- /** * Get a list of items that may be bought immediately. ! * * @return An array of start items, possibly empry. */ *************** *** 334,338 **** /** * Get a list of items that the current player may bid upon. ! * * @return An array of start items, possibly empty. */ --- 337,341 ---- /** * Get a list of items that the current player may bid upon. ! * * @return An array of start items, possibly empty. */ Index: StartRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1835.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StartRound_1835.java 19 Oct 2008 17:04:48 -0000 1.14 --- StartRound_1835.java 23 Dec 2008 19:59:06 -0000 1.15 *************** *** 28,33 **** * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1835() { ! super(); hasBidding = false; } --- 28,33 ---- * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1835(GameManagerI gameManager) { ! super(gameManager); hasBidding = false; } *************** *** 35,44 **** /** * Start the 1835-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start(StartPacket startPacket) { ! super.start(startPacket); startRoundNumber.add(1); --- 35,44 ---- /** * Start the 1835-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ @Override ! public void start() { ! super.start(); startRoundNumber.add(1); *************** *** 58,62 **** * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ --- 58,62 ---- * Get a list of items that may be bought immediately. <p> In an 1835-style * auction this method will usually return several items. ! * * @return An array of start items that can be bought. */ *************** *** 194,198 **** /** * Set the next player turn. ! * */ @Override --- 194,198 ---- /** * Set the next player turn. ! * */ @Override *************** *** 250,254 **** /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ --- 250,254 ---- /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ |
From: Erik V. <ev...@us...> - 2008-12-23 19:58:47
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27219/rails/game Modified Files: StartRound_1830.java Log Message: Apply new round initialisation logic. Fixed rare problem in counting passes. Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StartRound_1830.java 10 Oct 2008 19:56:30 -0000 1.15 --- StartRound_1830.java 23 Dec 2008 19:58:36 -0000 1.16 *************** *** 2,11 **** package rails.game; ! import java.util.*; ! import rails.game.action.BidStartItem; ! import rails.game.action.BuyStartItem; ! import rails.game.action.StartItemAction; ! import rails.game.action.NullAction; import rails.game.move.MoveSet; import rails.util.LocalText; --- 2,8 ---- package rails.game; ! import java.util.List; ! import rails.game.action.*; import rails.game.move.MoveSet; import rails.util.LocalText; *************** *** 20,40 **** * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1830() { ! super(); hasBidding = true; } /** * Start the 1830-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ ! public void start(StartPacket startPacket) { ! super.start(startPacket); ! bidIncrement = startPacket.getModulus(); setPossibleActions(); } public boolean setPossibleActions() { --- 17,39 ---- * Constructor, only to be used in dynamic instantiation. */ ! public StartRound_1830(GameManagerI gameManager) { ! super(gameManager); hasBidding = true; + bidIncrement = startPacket.getModulus(); } /** * Start the 1830-style start round. ! * * @param startPacket The startpacket to be sold in this start round. */ ! @Override ! public void start() { ! super.start(); setPossibleActions(); } + @Override public boolean setPossibleActions() { *************** *** 45,50 **** if (StartPacket.getStartPacket().areAllSold()) return false; - StartItem auctionItem = (StartItem) auctionItemState.getObject(); - while (possibleActions.isEmpty()) { --- 44,47 ---- *************** *** 56,65 **** // Don't include } else if (item.getStatus() == StartItem.AUCTIONED) { ! item.setStatus(StartItem.AUCTIONED); if (currentPlayer.getFreeCash() ! + auctionItem.getBid(currentPlayer) >= auctionItem.getMinimumBid()) { BidStartItem possibleAction = ! new BidStartItem(auctionItem, ! auctionItem.getMinimumBid(), startPacket.getModulus(), true); possibleActions.add(possibleAction); --- 53,62 ---- // Don't include } else if (item.getStatus() == StartItem.AUCTIONED) { ! if (currentPlayer.getFreeCash() ! + item.getBid(currentPlayer) >= item.getMinimumBid()) { BidStartItem possibleAction = ! new BidStartItem(item, ! item.getMinimumBid(), startPacket.getModulus(), true); possibleActions.add(possibleAction); *************** *** 67,70 **** --- 64,68 ---- } else { // Can't bid: Autopass + numPasses.add(1); break; } *************** *** 161,164 **** --- 159,163 ---- * Return the start items, marked as appropriate for an 1830-style auction. */ + @Override public List<StartItem> getStartItems() { *************** *** 169,177 **** /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. * @param amount The bid amount. */ protected boolean bid(String playerName, BidStartItem bidItem) { --- 168,177 ---- /** * The current player bids on a given start item. ! * * @param playerName The name of the current player (for checking purposes). * @param itemName The name of the start item on which the bid is placed. * @param amount The bid amount. */ + @Override protected boolean bid(String playerName, BidStartItem bidItem) { *************** *** 272,278 **** /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ protected boolean pass(String playerName) { --- 272,279 ---- /** * Process a player's pass. ! * * @param playerName The name of the current player (for checking purposes). */ + @Override protected boolean pass(String playerName) { *************** *** 305,309 **** if (auctionItem != null) { ! if (numPasses.intValue() == auctionItem.getBidders() - 1) { // All but the highest bidder have passed. int price = auctionItem.getBid(); --- 306,310 ---- if (auctionItem != null) { ! if (numPasses.intValue() >= auctionItem.getBidders() - 1) { // All but the highest bidder have passed. int price = auctionItem.getBid(); *************** *** 375,378 **** --- 376,380 ---- } + @Override public String getHelp() { return "1830 Start Round help text"; |
From: Erik V. <ev...@us...> - 2008-12-23 19:57:52
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27148/rails/game Modified Files: StartItem.java Log Message: Added toString(). Index: StartItem.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartItem.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** StartItem.java 20 Nov 2008 21:49:38 -0000 1.13 --- StartItem.java 23 Dec 2008 19:57:47 -0000 1.14 *************** *** 502,505 **** --- 502,509 ---- && this.type.equals(item.getType()); } + + public String toString() { + return ("StartItem "+name+" status="+statusName[status.intValue()]); + } } |
From: Erik V. <ev...@us...> - 2008-12-23 19:57:33
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27099/rails/game Modified Files: TreasuryShareRound.java ShareSellingRound.java Log Message: Apply new round initialisation logic. Cleanups. Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TreasuryShareRound.java 4 Dec 2008 01:03:40 -0000 1.10 --- TreasuryShareRound.java 23 Dec 2008 19:57:26 -0000 1.11 *************** *** 6,18 **** package rails.game; ! import java.util.ArrayList; ! import java.util.Iterator; ! import java.util.List; ! import java.util.Map; ! import rails.game.action.BuyCertificate; ! import rails.game.action.NullAction; ! import rails.game.action.PossibleAction; ! import rails.game.action.SellShares; import rails.game.move.MoveSet; import rails.game.state.BooleanState; --- 6,12 ---- package rails.game; ! import java.util.*; ! import rails.game.action.*; import rails.game.move.MoveSet; import rails.game.state.BooleanState; *************** *** 26,35 **** Player sellingPlayer; PublicCompanyI operatingCompany; - //GameManager gameMgr; private final BooleanState hasBought; private final BooleanState hasSold; /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and * and other parameters used by the Treasury Share Round Class * --- 20,28 ---- Player sellingPlayer; PublicCompanyI operatingCompany; private final BooleanState hasBought; private final BooleanState hasSold; /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and * and other parameters used by the Treasury Share Round Class * *************** *** 38,45 **** * */ ! public TreasuryShareRound(GameManager aGameManager, ! PublicCompanyI operatingCompany) { super (aGameManager); ! this.operatingCompany = operatingCompany; sellingPlayer = operatingCompany.getPresident(); log.debug("Creating TreasuryShareRound"); --- 31,39 ---- * */ ! public TreasuryShareRound(GameManagerI aGameManager, ! RoundI parentRound) { super (aGameManager); ! ! operatingCompany = ((OperatingRound)parentRound).getOperatingCompany(); sellingPlayer = operatingCompany.getPresident(); log.debug("Creating TreasuryShareRound"); *************** *** 51,55 **** false); - gameManager.setRound(this); setCurrentPlayerIndex(sellingPlayer.getIndex()); --- 45,48 ---- *************** *** 98,102 **** * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ --- 91,95 ---- * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ *************** *** 140,144 **** if (number == 0) continue; - //stockSpace = comp.getCurrentSpace(); price = comp.getMarketPrice(); --- 133,136 ---- *************** *** 160,164 **** * presidencies of other companies has been retained, but not tested. This * code will be needed for 1841. ! * * @return List of sellable certificates. */ --- 152,156 ---- * presidencies of other companies has been retained, but not tested. This * code will be needed for 1841. ! * * @return List of sellable certificates. */ *************** *** 189,210 **** if (maxShareToSell == 0) continue; ! // If the current Player is president, check if he can dump ! // the presidency onto someone else ! /* ! * DISABLED, companies cannot yet have another company as a ! * President. We will need this code later for 1841, so it might ! * make sense to retain it. if (company.getPresident() == ! * currentPlayer) { int presidentShare = ! * company.getCertificates().get(0).getShare(); if (maxShareToSell > ! * share - presidentShare) { dumpAllowed = false; if (company != ! * operatingCompany) { int playerShare; List<Player> players = ! * GameManager.getPlayers(); for (Player player : players) { if ! * (player == currentPlayer) continue; playerShare = ! * player.getPortfolio().getShare(company); if (playerShare >= ! * presidentShare) { dumpAllowed = true; break; } } } if ! * (!dumpAllowed) maxShareToSell = share - presidentShare; } } ! */ ! ! /* * Check what share units the player actually owns. In some games * (e.g. 1835) companies may have different ordinary shares: 5% and --- 181,185 ---- if (maxShareToSell == 0) continue; ! /* * Check what share units the player actually owns. In some games * (e.g. 1835) companies may have different ordinary shares: 5% and *************** *** 254,258 **** * Buying one or more single or double-share certificates (more is sometimes * possible) ! * * @param player The player that wants to buy shares. * @param action The executed action --- 229,233 ---- * Buying one or more single or double-share certificates (more is sometimes * possible) ! * * @param player The player that wants to buy shares. * @param action The executed action *************** *** 370,374 **** for (int i = 0; i < number; i++) { cert2 = from.findCertificate(company, cert.getShares(), false); - //portfolio.buyCertificate(cert2, from, shares * price); executeTradeCertificate(cert2, portfolio, shares * price); } --- 345,348 ---- *************** *** 495,500 **** for (PublicCertificateI cert2 : certsToSell) { if (cert2 != null) { ! //pool.buyCertificate(cert2, portfolio, cert2.getShares() * price); ! executeTradeCertificate (cert2, pool, cert2.getShares() * price); } } --- 469,473 ---- for (PublicCertificateI cert2 : certsToSell) { if (cert2 != null) { ! executeTradeCertificate (cert2, pool, cert2.getShares() * price); } } *************** *** 508,512 **** /** * The current Player passes or is done. ! * * @param player Name of the passing player. * @return False if an error is found. --- 481,485 ---- /** * The current Player passes or is done. ! * * @param player Name of the passing player. * @return False if an error is found. Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ShareSellingRound.java 4 Dec 2008 01:15:35 -0000 1.17 --- ShareSellingRound.java 23 Dec 2008 19:57:26 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- public class ShareSellingRound extends StockRound { + OperatingRound or; Player sellingPlayer; PublicCompanyI companyNeedingTrain; *************** *** 24,46 **** /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and * and other parameters used by the Share Selling Round Class * * @param aGameManager The GameManager Object needed to initialize the StockRound Class ! * @param compNeedingTraing The PublicCompanyI Object that needs to buy the train, * who is limited on selling shares of * @param cashToRaise The amount of cash needed to be raised during the special sell-off * */ ! public ShareSellingRound(GameManager gameManager, ! PublicCompanyI compNeedingTrain, int cashToRaise) { super (gameManager); ! this.companyNeedingTrain = compNeedingTrain; ! this.cashToRaise = new IntegerState("CashToRaise", cashToRaise); ! sellingPlayer = compNeedingTrain.getPresident(); currentPlayer = sellingPlayer; ! log.debug("Creating ShareSellingRound, cash to raise =" + cashToRaise); ! gameManager.setRound(this); setCurrentPlayerIndex(sellingPlayer.getIndex()); --- 25,47 ---- /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and * and other parameters used by the Share Selling Round Class * * @param aGameManager The GameManager Object needed to initialize the StockRound Class ! * @param compNeedingTraing The PublicCompanyI Object that needs to buy the train, * who is limited on selling shares of * @param cashToRaise The amount of cash needed to be raised during the special sell-off * */ ! public ShareSellingRound(GameManagerI gameManager, ! RoundI parentRound) { super (gameManager); ! or = ((OperatingRound) parentRound); ! companyNeedingTrain = or.getOperatingCompany(); ! cashToRaise = new IntegerState("CashToRaise", or.getCashToBeRaisedByPresident()); ! sellingPlayer = companyNeedingTrain.getPresident(); currentPlayer = sellingPlayer; ! log.debug("Creating ShareSellingRound, cash to raise =" + cashToRaise.intValue()); setCurrentPlayerIndex(sellingPlayer.getIndex()); *************** *** 51,54 **** --- 52,56 ---- log.info("Share selling round started"); currentPlayer = sellingPlayer; + setPossibleActions(); } *************** *** 88,92 **** * Create a list of certificates that a player may sell in a Stock Round, * taking all rules taken into account. ! * * @return List of sellable certificates. */ --- 90,94 ---- * Create a list of certificates that a player may sell in a Stock Round, * taking all rules taken into account. ! * * @return List of sellable certificates. */ *************** *** 342,346 **** for (PublicCertificateI cert2 : certsToSell) { if (cert2 != null) { - //pool.buyCertificate(cert2, portfolio, cert2.getShares() * price); executeTradeCertificate (cert2, pool, cert2.getShares() * price); } --- 344,347 ---- *************** *** 358,362 **** ReportBuffer.add(LocalText.getText("IS_NOW_PRES_OF", new String[] { otherPlayer.getName(), ! company.getName() })); break; --- 359,363 ---- ReportBuffer.add(LocalText.getText("IS_NOW_PRES_OF", new String[] { otherPlayer.getName(), ! company.getName() })); break; |
From: Erik V. <ev...@us...> - 2008-12-23 19:56:51
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27005/rails/game Modified Files: OperatingRound.java Log Message: Apply new round initialisation logic Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** OperatingRound.java 4 Dec 2008 00:45:23 -0000 1.47 --- OperatingRound.java 23 Dec 2008 19:56:40 -0000 1.48 *************** *** 113,121 **** * */ ! public OperatingRound() { ! super (); ! } ! ! public void start(boolean operate, String orNumber) { if (players == null) { --- 113,120 ---- * */ ! public OperatingRound(GameManagerI gameManager) { ! super (gameManager); ! ! thisOrNumber = gameManager.getCompositeORNumber(); if (players == null) { *************** *** 123,126 **** --- 122,128 ---- numberOfPlayers = players.size(); } + } + + public void start(boolean operate) { for (PrivateCompanyI priv : companyManager.getAllPrivateCompanies()) { *************** *** 128,132 **** } - thisOrNumber = orNumber; ReportBuffer.add(LocalText.getText("START_OR", thisOrNumber)); --- 130,133 ---- *************** *** 136,140 **** if (operatingCompanyArray.length > 0) { - gameManager.setRound(this); if (setNextOperatingCompany(true)) { --- 137,140 ---- *************** *** 832,837 **** } ! gameManager.startTreasuryShareTradingRound(this, ! operatingCompany); } --- 832,836 ---- } ! gameManager.startTreasuryShareTradingRound(); } *************** *** 1828,1831 **** --- 1827,1834 ---- } + public int getCashToBeRaisedByPresident() { + return cashToBeRaisedByPresident; + } + /** * This is currently a stub, as it is unclear if there is a common |
From: Erik V. <ev...@us...> - 2008-12-23 19:55:39
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26872/rails/game Modified Files: Round.java RoundI.java Log Message: New constructors Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Round.java 4 Dec 2008 00:46:46 -0000 1.13 --- Round.java 23 Dec 2008 19:55:29 -0000 1.14 *************** *** 25,40 **** protected static Logger log = Logger.getLogger(Round.class.getPackage().getName()); ! ! protected GameManager gameManager = null; protected CompanyManagerI companyManager = null; ! /** ! * Constructor with no parameters, call the setGameManager with null to properly initialize ! * ! */ ! public Round () { ! setGameManager (null); ! } ! /** * Constructor with the GameManager, will call setGameManager with the parameter to initialize --- 25,35 ---- protected static Logger log = Logger.getLogger(Round.class.getPackage().getName()); ! ! protected GameManagerI gameManager = null; protected CompanyManagerI companyManager = null; ! /** Default constructor cannot be used */ ! private Round () {} ! /** * Constructor with the GameManager, will call setGameManager with the parameter to initialize *************** *** 43,71 **** * */ ! public Round (GameManager aGameManager) { ! setGameManager (aGameManager); } - - /** Initialization routine that will set the gameManager and the companyManager objects for use in the class - * - * @param aGameManager The GameManager Object to save in the class, and use to find the CompanyManager - * - */ - public void setGameManager (GameManager aGameManager) { - gameManager = aGameManager; - if (aGameManager == null) { - companyManager = null; - } else { - companyManager = aGameManager.getCompanyManager(); - } - } - - public GameManager getGameManager () { - return gameManager; - } /* * (non-Javadoc) ! * * @see rails.game.RoundI#getCurrentPlayer() */ --- 38,56 ---- * */ ! public Round (GameManagerI aGameManager) { ! ! this.gameManager = aGameManager; ! ! if (aGameManager == null) { ! companyManager = null; ! } else { ! companyManager = aGameManager.getCompanyManager(); ! } ! } /* * (non-Javadoc) ! * * @see rails.game.RoundI#getCurrentPlayer() */ *************** *** 82,94 **** return getCurrentPlayer().getIndex(); } ! public void setCurrentPlayerIndex(int newIndex) { gameManager.setCurrentPlayerIndex(newIndex); } ! public void setCurrentPlayer(Player player) { gameManager.setCurrentPlayer(player); } ! public PhaseI getCurrentPhase() { return gameManager.getCurrentPhase(); --- 67,79 ---- return getCurrentPlayer().getIndex(); } ! public void setCurrentPlayerIndex(int newIndex) { gameManager.setCurrentPlayerIndex(newIndex); } ! public void setCurrentPlayer(Player player) { gameManager.setCurrentPlayer(player); } ! public PhaseI getCurrentPhase() { return gameManager.getCurrentPhase(); *************** *** 97,101 **** /* * (non-Javadoc) ! * * @see rails.game.RoundI#getHelp() */ --- 82,86 ---- /* * (non-Javadoc) ! * * @see rails.game.RoundI#getHelp() */ *************** *** 107,111 **** /* * (non-Javadoc) ! * * @see rails.game.RoundI#getSpecialProperties() */ --- 92,96 ---- /* * (non-Javadoc) ! * * @see rails.game.RoundI#getSpecialProperties() */ *************** *** 122,126 **** * Default version, does nothing. Subclasses should override this method * with a real version. ! * * @return */ --- 107,111 ---- * Default version, does nothing. Subclasses should override this method * with a real version. ! * * @return */ *************** *** 161,165 **** * Check if a company must be floated, and if so, do it. <p>This method is * included here because it is used in various types of Round. ! * * @param company */ --- 146,150 ---- * Check if a company must be floated, and if so, do it. <p>This method is * included here because it is used in various types of Round. ! * * @param company */ *************** *** 219,223 **** company.getName(), Bank.format(cash) })); } else { ! ReportBuffer.add(LocalText.getText("Floats", company.getName())); } --- 204,208 ---- company.getName(), Bank.format(cash) })); } else { ! ReportBuffer.add(LocalText.getText("Floats", company.getName())); } *************** *** 242,256 **** protected void executeTradeCertificate(Certificate cert, Portfolio newHolder, int price) { ! Portfolio oldHolder = (Portfolio) cert.getHolder(); cert.moveTo(newHolder); ! if (price != 0) { new CashMove(newHolder.getOwner(), oldHolder.getOwner(), price); } ! } ! ! /** * Who receives the cash when a certificate is bought. * Normally this is owner of the previously holding portfolio. --- 227,241 ---- protected void executeTradeCertificate(Certificate cert, Portfolio newHolder, int price) { ! Portfolio oldHolder = (Portfolio) cert.getHolder(); cert.moveTo(newHolder); ! if (price != 0) { new CashMove(newHolder.getOwner(), oldHolder.getOwner(), price); } ! } ! ! /** * Who receives the cash when a certificate is bought. * Normally this is owner of the previously holding portfolio. *************** *** 263,266 **** return ((Portfolio)cert.getHolder()).getOwner(); } ! } --- 248,251 ---- return ((Portfolio)cert.getHolder()).getOwner(); } ! } Index: RoundI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/RoundI.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RoundI.java 3 Dec 2008 20:15:15 -0000 1.8 --- RoundI.java 23 Dec 2008 19:55:29 -0000 1.9 *************** *** 10,17 **** public interface RoundI { - public void setGameManager (GameManager gameManager); - - public GameManager getGameManager (); - /** * Get the player that has the next turn. --- 10,13 ---- |
From: Erik V. <ev...@us...> - 2008-12-23 19:54:19
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26761/rails/game Modified Files: GameManager.java Log Message: Implements new interface GameManagerI New createRound() methods, taking 1 and 2 args. Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GameManager.java 22 Nov 2008 17:22:59 -0000 1.36 --- GameManager.java 23 Dec 2008 19:54:14 -0000 1.37 *************** *** 3,6 **** --- 3,7 ---- import java.io.*; + import java.lang.reflect.Constructor; import java.util.*; *************** *** 21,25 **** * Round. Currently everything is hardcoded à la 1830. */ ! public class GameManager implements ConfigurableComponentI { /** Version ID of the Save file header, as written in save() */ private static final long saveFileHeaderVersionID = 3L; --- 22,26 ---- * Round. Currently everything is hardcoded à la 1830. */ ! public class GameManager implements ConfigurableComponentI, GameManagerI { /** Version ID of the Save file header, as written in save() */ private static final long saveFileHeaderVersionID = 3L; *************** *** 34,47 **** protected Class<? extends OperatingRound> operatingRoundClass = OperatingRound.class; ! // Variable UI Class names protected String orUIManagerClassName = Defs.getDefaultClassName(Defs.ClassName.OR_UI_MANAGER); protected String gameStatusClassName = Defs.getDefaultClassName(Defs.ClassName.GAME_STATUS); protected String statusWindowClassName = Defs.getDefaultClassName(Defs.ClassName.STATUS_WINDOW); ! protected PlayerManager playerManager; protected CompanyManagerI companyManager; protected PhaseManager phaseManager; ! protected List<Player> players; protected List<String> playerNames; --- 35,48 ---- protected Class<? extends OperatingRound> operatingRoundClass = OperatingRound.class; ! // Variable UI Class names protected String orUIManagerClassName = Defs.getDefaultClassName(Defs.ClassName.OR_UI_MANAGER); protected String gameStatusClassName = Defs.getDefaultClassName(Defs.ClassName.GAME_STATUS); protected String statusWindowClassName = Defs.getDefaultClassName(Defs.ClassName.STATUS_WINDOW); ! protected PlayerManager playerManager; protected CompanyManagerI companyManager; protected PhaseManager phaseManager; ! protected List<Player> players; protected List<String> playerNames; *************** *** 70,74 **** protected IntegerState srNumber = new IntegerState ("SRNumber"); ! protected IntegerState absoluteORNumber = new IntegerState("AbsoluteORNUmber"); --- 71,75 ---- protected IntegerState srNumber = new IntegerState ("SRNumber"); ! protected IntegerState absoluteORNumber = new IntegerState("AbsoluteORNUmber"); *************** *** 110,114 **** /** * Private constructor. ! * */ public GameManager() { --- 111,115 ---- /** * Private constructor. ! * */ public GameManager() { *************** *** 116,121 **** } ! /** ! * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { --- 117,122 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#configureFromXML(rails.util.Tag) */ public void configureFromXML(Tag tag) throws ConfigurationException { *************** *** 269,273 **** } } ! /** Check if a classname can be instantiated. * Throws a ConfiguratioNException if not. --- 270,274 ---- } } ! /** Check if a classname can be instantiated. * Throws a ConfiguratioNException if not. *************** *** 275,281 **** * @throws ConfigurationException */ ! protected void canClassBeInstantiated (String className) throws ConfigurationException { ! try { Class.forName(className); --- 276,282 ---- * @throws ConfigurationException */ ! protected void canClassBeInstantiated (String className) throws ConfigurationException { ! try { Class.forName(className); *************** *** 286,289 **** --- 287,293 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#startGame(rails.game.PlayerManager, rails.game.CompanyManagerI, rails.game.PhaseManager) + */ public void startGame(PlayerManager playerManager, CompanyManagerI companyManager, *************** *** 292,301 **** this.companyManager = companyManager; this.phaseManager = phaseManager; ! players = playerManager.getPlayers(); playerNames = playerManager.getPlayerNames(); numberOfPlayers = players.size(); priorityPlayer.setState(players.get(0)); ! setGameParameters(); --- 296,305 ---- this.companyManager = companyManager; this.phaseManager = phaseManager; ! players = playerManager.getPlayers(); playerNames = playerManager.getPlayerNames(); numberOfPlayers = players.size(); priorityPlayer.setState(players.get(0)); ! setGameParameters(); *************** *** 312,318 **** MoveSet.enable(); } ! private void setGameParameters () { ! for (PublicCompanyI company : companyManager.getAllPublicCompanies()) { hasAnyParPrice = hasAnyParPrice || company.hasParPrice(); --- 316,322 ---- MoveSet.enable(); } ! private void setGameParameters () { ! for (PublicCompanyI company : companyManager.getAllPublicCompanies()) { hasAnyParPrice = hasAnyParPrice || company.hasParPrice(); *************** *** 320,324 **** canAnyCompanyHoldShares = canAnyCompanyHoldShares || company.canHoldOwnShares(); } ! loop: for (PrivateCompanyI company : companyManager.getAllPrivateCompanies()) { for (SpecialPropertyI sp : company.getSpecialProperties()) { --- 324,328 ---- canAnyCompanyHoldShares = canAnyCompanyHoldShares || company.canHoldOwnShares(); } ! loop: for (PrivateCompanyI company : companyManager.getAllPrivateCompanies()) { for (SpecialPropertyI sp : company.getSpecialProperties()) { *************** *** 329,333 **** } } ! } } --- 333,337 ---- } } ! } } *************** *** 336,355 **** * @return instance of GameManager */ ! public static GameManager getInstance() { return instance; } ! public CompanyManagerI getCompanyManager() { return companyManager; } ! public void setRound(RoundI round) { currentRound.set(round); } ! /** ! * Should be called by each Round when it finishes. ! * ! * @param round The object that represents the finishing round. */ public void nextRound(RoundI round) { --- 340,363 ---- * @return instance of GameManager */ ! public static GameManagerI getInstance() { return instance; } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCompanyManager() ! */ public CompanyManagerI getCompanyManager() { return companyManager; } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#setRound(rails.game.RoundI) ! */ ! private void setRound(RoundI round) { currentRound.set(round); } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#nextRound(rails.game.RoundI) */ public void nextRound(RoundI round) { *************** *** 412,417 **** } StartRound startRound = createRound (startRoundClass); ! startRound.setGameManager(this); ! startRound.start (startPacket); } --- 420,424 ---- } StartRound startRound = createRound (startRoundClass); ! startRound.start (); } *************** *** 424,438 **** protected void startOperatingRound(boolean operate) { log.debug("Operating round started with operate-flag=" + operate); ! OperatingRound or = createRound(operatingRoundClass); if (operate) absoluteORNumber.add(1); ! or.start(operate, getCompositeORNumber()); } ! ! protected <T extends Round> T createRound (Class<T> roundClass) { T round = null; try { ! round = roundClass.newInstance(); } catch (Exception e) { log.fatal("Cannot instantiate class " --- 431,446 ---- protected void startOperatingRound(boolean operate) { log.debug("Operating round started with operate-flag=" + operate); ! OperatingRound or = createRound(operatingRoundClass); if (operate) absoluteORNumber.add(1); ! or.start(operate); } ! ! protected <T extends RoundI> T createRound (Class<T> roundClass) { T round = null; try { ! Constructor<T> cons = roundClass.getConstructor(GameManagerI.class); ! round = cons.newInstance(this); } catch (Exception e) { log.fatal("Cannot instantiate class " *************** *** 440,476 **** System.exit(1); } ! round.setGameManager (this); return round; } public String getCompositeORNumber() { return srNumber.intValue() + "." + relativeORNumber.intValue(); } ! public int getSRNumber () { return srNumber.intValue(); } public void startShareSellingRound(OperatingRound or, PublicCompanyI companyNeedingTrain, int cashToRaise) { interruptedRound = getCurrentRound(); ! new ShareSellingRound(this, companyNeedingTrain, cashToRaise).start(); } ! public void startTreasuryShareTradingRound(OperatingRound or, ! PublicCompanyI companyTradingShares) { interruptedRound = getCurrentRound(); ! new TreasuryShareRound(this, companyTradingShares).start(); } ! /** ! * The central server-side method that takes a client-side initiated action ! * and processes it. ! * ! * @param action A PossibleAction subclass object sent by the client. ! * @return TRUE is the action was valid. */ public boolean process(PossibleAction action) { --- 448,511 ---- System.exit(1); } ! setRound (round); ! return round; ! } ! ! protected <T extends RoundI, U extends RoundI> ! T createRound (Class<T> roundClass, U parentRound) { ! ! if (parentRound == null) { ! return createRound (roundClass); ! } ! ! T round = null; ! try { ! Constructor<T> cons = roundClass.getConstructor(GameManagerI.class, RoundI.class); ! round = cons.newInstance(this, parentRound); ! } catch (Exception e) { ! log.fatal("Cannot instantiate class " ! + roundClass.getName(), e); ! System.exit(1); ! } ! setRound (round); return round; } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getCompositeORNumber() + */ public String getCompositeORNumber() { return srNumber.intValue() + "." + relativeORNumber.intValue(); } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getSRNumber() ! */ public int getSRNumber () { return srNumber.intValue(); } + /* (non-Javadoc) + * @see rails.game.GameManagerI#startShareSellingRound(rails.game.OperatingRound, rails.game.PublicCompanyI, int) + */ public void startShareSellingRound(OperatingRound or, PublicCompanyI companyNeedingTrain, int cashToRaise) { interruptedRound = getCurrentRound(); ! createRound (ShareSellingRound.class, interruptedRound).start(); } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#startTreasuryShareTradingRound(rails.game.OperatingRound, rails.game.PublicCompanyI) ! */ ! public void startTreasuryShareTradingRound() { interruptedRound = getCurrentRound(); ! createRound (TreasuryShareRound.class, interruptedRound).start(); } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#process(rails.game.action.PossibleAction) */ public boolean process(PossibleAction action) { *************** *** 566,569 **** --- 601,607 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#processOnReload(java.util.List) + */ public void processOnReload(List<PossibleAction> actions) throws Exception { *************** *** 609,612 **** --- 647,653 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#finishShareSellingRound() + */ public void finishShareSellingRound() { setRound(interruptedRound); *************** *** 614,617 **** --- 655,661 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#finishTreasuryShareRound() + */ public void finishTreasuryShareRound() { setRound(interruptedRound); *************** *** 619,622 **** --- 663,669 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#registerBankruptcy() + */ public void registerBankruptcy() { endedByBankruptcy = true; *************** *** 639,646 **** } ! /** ! * To be called by the UI to check if the rails.game is over. ! * ! * @return */ public boolean isGameOver() { --- 686,691 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#isGameOver() */ public boolean isGameOver() { *************** *** 648,651 **** --- 693,699 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#logGameReport() + */ public void logGameReport() { *************** *** 653,660 **** } ! /** ! * Create a HTML-formatted rails.game status report. ! * ! * @return */ public String getGameReport() { --- 701,706 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getGameReport() */ public String getGameReport() { *************** *** 684,691 **** } ! /** ! * Should be called whenever a Phase changes. The effect on the number of ! * ORs is delayed until a StockRound finishes. ! * */ public RoundI getCurrentRound() { --- 730,735 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCurrentRound() */ public RoundI getCurrentRound() { *************** *** 693,698 **** } ! /** ! * @return Returns the currentPlayerIndex. */ public int getCurrentPlayerIndex() { --- 737,742 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCurrentPlayerIndex() */ public int getCurrentPlayerIndex() { *************** *** 700,705 **** } ! /** ! * @param currentPlayerIndex The currentPlayerIndex to set. */ public void setCurrentPlayerIndex(int currentPlayerIndex) { --- 744,749 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#setCurrentPlayerIndex(int) */ public void setCurrentPlayerIndex(int currentPlayerIndex) { *************** *** 708,718 **** } public void setCurrentPlayer(Player player) { currentPlayer.set(player); } ! /** ! * Set priority deal to the player after the current player. ! * */ public void setPriorityPlayer() { --- 752,764 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#setCurrentPlayer(rails.game.Player) + */ public void setCurrentPlayer(Player player) { currentPlayer.set(player); } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#setPriorityPlayer() */ public void setPriorityPlayer() { *************** *** 723,726 **** --- 769,775 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#setPriorityPlayer(rails.game.Player) + */ public void setPriorityPlayer(Player player) { priorityPlayer.set(player); *************** *** 729,734 **** } ! /** ! * @return Returns the priorityPlayer. */ public Player getPriorityPlayer() { --- 778,783 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getPriorityPlayer() */ public Player getPriorityPlayer() { *************** *** 736,741 **** } ! /** ! * @return Returns the currentPlayer. */ public Player getCurrentPlayer() { --- 785,790 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCurrentPlayer() */ public Player getCurrentPlayer() { *************** *** 743,748 **** } ! /** ! * @return Returns the players. */ public List<Player> getPlayers() { --- 792,797 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getPlayers() */ public List<Player> getPlayers() { *************** *** 750,779 **** } public int getNumberOfPlayers() { return numberOfPlayers; } ! public List<String> getPlayerNames() { return playerNames; } ! public List<PublicCompanyI> getAllPublicCompanies() { return companyManager.getAllPublicCompanies(); } ! public List<PrivateCompanyI> getAllPrivateCompanies() { return companyManager.getAllPrivateCompanies(); } ! ! /** ! * Return a player by its index in the list, modulo the number of players. ! * ! * @param index The player index. ! * @return A player object. */ public Player getPlayerByIndex(int index) { return players.get(index % numberOfPlayers); } ! public void setNextPlayer() { int currentPlayerIndex = getCurrentPlayerIndex(); --- 799,840 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getNumberOfPlayers() + */ public int getNumberOfPlayers() { return numberOfPlayers; } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getPlayerNames() ! */ public List<String> getPlayerNames() { return playerNames; } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getAllPublicCompanies() ! */ public List<PublicCompanyI> getAllPublicCompanies() { return companyManager.getAllPublicCompanies(); } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getAllPrivateCompanies() ! */ public List<PrivateCompanyI> getAllPrivateCompanies() { return companyManager.getAllPrivateCompanies(); } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getPlayerByIndex(int) */ public Player getPlayerByIndex(int index) { return players.get(index % numberOfPlayers); } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#setNextPlayer() ! */ public void setNextPlayer() { int currentPlayerIndex = getCurrentPlayerIndex(); *************** *** 782,787 **** } ! /** ! * @return the StartPacket */ public StartPacket getStartPacket() { --- 843,848 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getStartPacket() */ public StartPacket getStartPacket() { *************** *** 789,799 **** } ! /** ! * @return Current phase */ public PhaseI getCurrentPhase() { return phaseManager.getCurrentPhase(); } ! public PhaseManager getPhaseManager() { return phaseManager; --- 850,863 ---- } ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCurrentPhase() */ public PhaseI getCurrentPhase() { return phaseManager.getCurrentPhase(); } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getPhaseManager() ! */ public PhaseManager getPhaseManager() { return phaseManager; *************** *** 812,829 **** } public String getHelp() { return getCurrentRound().getHelp(); } public boolean canAnyCompanyHoldShares() { return canAnyCompanyHoldShares; } public String getClassName (Defs.ClassName key) { ! switch (key) { case OR_UI_MANAGER: return orUIManagerClassName; ! case STATUS_WINDOW: return statusWindowClassName; --- 876,902 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getHelp() + */ public String getHelp() { return getCurrentRound().getHelp(); } + /* (non-Javadoc) + * @see rails.game.GameManagerI#canAnyCompanyHoldShares() + */ public boolean canAnyCompanyHoldShares() { return canAnyCompanyHoldShares; } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getClassName(rails.common.Defs.ClassName) + */ public String getClassName (Defs.ClassName key) { ! switch (key) { case OR_UI_MANAGER: return orUIManagerClassName; ! case STATUS_WINDOW: return statusWindowClassName; *************** *** 831,835 **** case GAME_STATUS: return gameStatusClassName; ! default: return ""; --- 904,908 ---- case GAME_STATUS: return gameStatusClassName; ! default: return ""; *************** *** 837,848 **** } public int getStockRoundSequenceRule() { return stockRoundSequenceRule; } public int getTreasuryShareLimit() { return treasuryShareLimit; } ! public Object getCommonParameter (Defs.Parm key) { switch (key) { --- 910,930 ---- } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getStockRoundSequenceRule() + */ public int getStockRoundSequenceRule() { return stockRoundSequenceRule; } + /* (non-Javadoc) + * @see rails.game.GameManagerI#getTreasuryShareLimit() + */ public int getTreasuryShareLimit() { return treasuryShareLimit; } ! ! /* (non-Javadoc) ! * @see rails.game.GameManagerI#getCommonParameter(rails.common.Defs.Parm) ! */ public Object getCommonParameter (Defs.Parm key) { switch (key) { *************** *** 860,863 **** } ! } --- 942,945 ---- } ! } |
From: Erik V. <ev...@us...> - 2008-12-23 19:50:55
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26324/rails/game Modified Files: Game.java Added Files: GameManagerI.java Log Message: Use new interface GameManagerI Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Game.java 28 Oct 2008 21:01:34 -0000 1.19 --- Game.java 23 Dec 2008 19:50:41 -0000 1.20 *************** *** 23,27 **** /** The component Manager */ protected ComponentManager componentManager; ! protected GameManager gameManager; protected CompanyManagerI companyManager; protected PlayerManager playerManager; --- 23,27 ---- /** The component Manager */ protected ComponentManager componentManager; ! protected GameManagerI gameManager; protected CompanyManagerI companyManager; protected PlayerManager playerManager; *************** *** 114,118 **** } gameManager = ! (GameManager) componentManager.findComponent("GameManager"); if (gameManager == null) { throw new ConfigurationException( --- 114,118 ---- } gameManager = ! (GameManagerI) componentManager.findComponent("GameManager"); if (gameManager == null) { throw new ConfigurationException( --- NEW FILE: GameManagerI.java --- package rails.game; import java.util.List; import rails.common.Defs; import rails.game.action.PossibleAction; import rails.util.Tag; public interface GameManagerI { /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public abstract void configureFromXML(Tag tag) throws ConfigurationException; public abstract void startGame(PlayerManager playerManager, CompanyManagerI companyManager, PhaseManager phaseManager); public abstract CompanyManagerI getCompanyManager(); /** * Should be called by each Round when it finishes. * * @param round The object that represents the finishing round. */ public abstract void nextRound(RoundI round); public abstract String getCompositeORNumber(); public abstract int getSRNumber(); public abstract void startShareSellingRound(OperatingRound or, PublicCompanyI companyNeedingTrain, int cashToRaise); public abstract void startTreasuryShareTradingRound(); /** * The central server-side method that takes a client-side initiated action * and processes it. * * @param action A PossibleAction subclass object sent by the client. * @return TRUE is the action was valid. */ public abstract boolean process(PossibleAction action); public abstract void processOnReload(List<PossibleAction> actions) throws Exception; public abstract void finishShareSellingRound(); public abstract void finishTreasuryShareRound(); public abstract void registerBankruptcy(); /** * To be called by the UI to check if the rails.game is over. * * @return */ public abstract boolean isGameOver(); public abstract void logGameReport(); /** * Create a HTML-formatted rails.game status report. * * @return */ public abstract String getGameReport(); /** * Should be called whenever a Phase changes. The effect on the number of * ORs is delayed until a StockRound finishes. * */ public abstract RoundI getCurrentRound(); /** * @return Returns the currentPlayerIndex. */ public abstract int getCurrentPlayerIndex(); /** * @param currentPlayerIndex The currentPlayerIndex to set. */ public abstract void setCurrentPlayerIndex(int currentPlayerIndex); public abstract void setCurrentPlayer(Player player); /** * Set priority deal to the player after the current player. * */ public abstract void setPriorityPlayer(); public abstract void setPriorityPlayer(Player player); /** * @return Returns the priorityPlayer. */ public abstract Player getPriorityPlayer(); /** * @return Returns the currentPlayer. */ public abstract Player getCurrentPlayer(); /** * @return Returns the players. */ public abstract List<Player> getPlayers(); public abstract int getNumberOfPlayers(); public abstract List<String> getPlayerNames(); public abstract List<PublicCompanyI> getAllPublicCompanies(); public abstract List<PrivateCompanyI> getAllPrivateCompanies(); /** * Return a player by its index in the list, modulo the number of players. * * @param index The player index. * @return A player object. */ public abstract Player getPlayerByIndex(int index); public abstract void setNextPlayer(); /** * @return the StartPacket */ public abstract StartPacket getStartPacket(); /** * @return Current phase */ public abstract PhaseI getCurrentPhase(); public abstract PhaseManager getPhaseManager(); public abstract String getHelp(); public abstract boolean canAnyCompanyHoldShares(); public abstract String getClassName(Defs.ClassName key); public abstract int getStockRoundSequenceRule(); public abstract int getTreasuryShareLimit(); public abstract Object getCommonParameter(Defs.Parm key); } |
From: Erik V. <ev...@us...> - 2008-12-14 22:33:02
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25865/rails/game Modified Files: Portfolio.java PublicCertificate.java Log Message: Small cleanups Index: Portfolio.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Portfolio.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Portfolio.java 20 Nov 2008 21:49:38 -0000 1.29 --- Portfolio.java 14 Dec 2008 21:55:05 -0000 1.30 *************** *** 121,125 **** // Move the private certificate - // new CertificateMove (from, this, privateCompany); privateCompany.moveTo(this); --- 121,124 ---- *************** *** 402,406 **** for (int i = 0; i < shares; i++) { swapCert = other.findCertificate(company, 1, false); - // new CertificateMove (other, this, swapCert); swapCert.moveTo(this); swapped.add(swapCert); --- 401,404 ---- *************** *** 409,413 **** } else if (other.ownsCertificates(company, shares, false) >= 1) { swapCert = other.findCertificate(company, 2, false); - // new CertificateMove(other, this, swapCert); swapCert.moveTo(this); swapped.add(swapCert); --- 407,410 ---- *************** *** 415,419 **** return null; } - // new CertificateMove (this, other, cert); cert.moveTo(other); --- 412,415 ---- *************** *** 444,448 **** public void buyTrain(TrainI train, int price) { CashHolder oldOwner = train.getOwner(); - // new TrainMove (train, train.getHolder(), this); train.moveTo(this); if (price > 0) new CashMove(owner, oldOwner, price); --- 440,443 ---- *************** *** 450,454 **** public void discardTrain(TrainI train) { - // new TrainMove (train, this, Bank.getPool()); train.moveTo(Bank.getPool()); ReportBuffer.add(LocalText.getText("CompanyDiscardsTrain", --- 445,448 ---- Index: PublicCertificate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificate.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PublicCertificate.java 11 Dec 2008 20:12:07 -0000 1.12 --- PublicCertificate.java 14 Dec 2008 21:55:05 -0000 1.13 *************** *** 108,126 **** /** - * Get the current price of this certificate. - * - * @return The current certificate price. - */ - /* - public int getCertificatePrice() { - if (company.getCurrentPrice() != null) { - return company.getCurrentPrice().getPrice() * shares; - } else { - return 0; - } - } - */ - - /** * Get the name of a certificate. The name is derived from the company name * and the share percentage of this certificate. If it is a 100% share (as --- 108,111 ---- |
From: Erik V. <ev...@us...> - 2008-12-13 08:21:15
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17321/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Undone previous fix, which was wrong. Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** StockRound_18EU.java 12 Dec 2008 23:09:53 -0000 1.17 --- StockRound_18EU.java 13 Dec 2008 08:20:59 -0000 1.18 *************** *** 235,239 **** for (PublicCompanyI comp : comps) { type = comp.getTypeName(); ! if (type.equals("Major") && comp.hasStarted()) { targetCompanies.add(comp); } else if (type.equals("Minor") --- 235,240 ---- for (PublicCompanyI comp : comps) { type = comp.getTypeName(); ! if (type.equals("Major") && comp.hasStarted() ! && !comp.hasOperated()) { targetCompanies.add(comp); } else if (type.equals("Minor") |
From: Erik V. <ev...@us...> - 2008-12-12 23:10:02
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23804/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Fixed missing companies as merge targets Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** StockRound_18EU.java 11 Dec 2008 20:11:15 -0000 1.16 --- StockRound_18EU.java 12 Dec 2008 23:09:53 -0000 1.17 *************** *** 178,182 **** if (currentPlayer.maxAllowedNumberOfSharesToBuy(comp, cert.getShare()) < 1) continue; - //stockSpace = comp.getCurrentSpace(); price = comp.getMarketPrice(); --- 178,181 ---- *************** *** 236,241 **** for (PublicCompanyI comp : comps) { type = comp.getTypeName(); ! if (type.equals("Major") && comp.hasStarted() ! && !comp.hasOperated()) { targetCompanies.add(comp); } else if (type.equals("Minor") --- 235,239 ---- for (PublicCompanyI comp : comps) { type = comp.getTypeName(); ! if (type.equals("Major") && comp.hasStarted()) { targetCompanies.add(comp); } else if (type.equals("Minor") *************** *** 402,408 **** // Transfer the President's certificate - // currentPlayer.getPortfolio().buyCertificate(cert, - // ipo, - // cert.getCertificatePrice()); cert.moveTo(currentPlayer.getPortfolio()); --- 400,403 ---- *************** *** 641,645 **** protected void finishTurn() { - // log.debug("+++ FinishTurn"); if (!discardingTrains.booleanValue()) { super.setNextPlayer(); --- 636,639 ---- *************** *** 663,667 **** @Override protected void finishRound() { - // log.debug("+++ FinishRound"); if (discardingTrains.booleanValue()) { --- 657,660 ---- |
From: Erik V. <ev...@us...> - 2008-12-11 20:12:43
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21068/rails/ui/swing Modified Files: StartRoundWindow.java Log Message: Cleanups, annotations, formatting Index: StartRoundWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StartRoundWindow.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** StartRoundWindow.java 11 Oct 2008 16:43:41 -0000 1.26 --- StartRoundWindow.java 11 Dec 2008 20:12:30 -0000 1.27 *************** *** 149,153 **** items = round.getStartItems().toArray(new StartItem[0]); ni = items.length; - // log.debug("+++ ni="+ni); StartItem item; for (int i = 0; i < ni; i++) { --- 149,152 ---- *************** *** 251,255 **** for (int j = 0; j < np; j++) { - // log.debug("+++ i="+i+"/"+ni+" j="+j); f = bidPerPlayer[i][j] = new Field(round.getBidModel(i, j)); addField(f, bidPerPlayerXOffset + j, bidPerPlayerYOffset + i, --- 250,253 ---- *************** *** 443,447 **** passButton.setEnabled(passAllowed); - // pack(); requestFocus(); } --- 441,444 ---- *************** *** 468,472 **** /* * (non-Javadoc) ! * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ --- 465,469 ---- /* * (non-Javadoc) ! * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ *************** *** 513,517 **** } } - // pack(); } else if (source instanceof ActionButton) { PossibleAction activeItem = --- 510,513 ---- |
From: Erik V. <ev...@us...> - 2008-12-11 20:12:40
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21068/rails/game/specific/_1856 Modified Files: StockRound_1856.java Log Message: Cleanups, annotations, formatting Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StockRound_1856.java 4 Dec 2008 01:20:13 -0000 1.5 --- StockRound_1856.java 11 Dec 2008 20:12:30 -0000 1.6 *************** *** 1,14 **** package rails.game.specific._1856; ! import rails.game.Bank; ! import rails.game.CashHolder; ! import rails.game.Certificate; ! import rails.game.GameManager; ! import rails.game.Portfolio; ! import rails.game.PublicCertificateI; ! import rails.game.PublicCompanyI; ! import rails.game.ReportBuffer; ! import rails.game.StockRound; ! import rails.game.move.CashMove; import rails.util.LocalText; --- 1,5 ---- package rails.game.specific._1856; ! import rails.game.*; import rails.util.LocalText; *************** *** 27,33 **** /** * Special 1856 code to check for company flotation. ! * * @param company */ protected void checkFlotation(PublicCompanyI company) { --- 18,25 ---- /** * Special 1856 code to check for company flotation. ! * * @param company */ + @Override protected void checkFlotation(PublicCompanyI company) { *************** *** 35,50 **** int unsoldPercentage = company.getUnsoldPercentage(); ! PublicCompany_1856 comp = (PublicCompany_1856) company; int trainNumberAtStart = comp.getTrainNumberAvailableAtStart(); int floatPercentage = 10 * trainNumberAtStart; ! log.debug ("Floatpercentage is "+floatPercentage); ! if (unsoldPercentage <= 100 - floatPercentage) { // Company floats. // In 1856 this does not mean that the company will operate, // only that it will be added to the list of companies ! // being considered for an OR turn. // See OperatingRound_1856 for the actual check. if (!company.hasFloated()) { --- 27,42 ---- int unsoldPercentage = company.getUnsoldPercentage(); ! PublicCompany_1856 comp = (PublicCompany_1856) company; int trainNumberAtStart = comp.getTrainNumberAvailableAtStart(); int floatPercentage = 10 * trainNumberAtStart; ! log.debug ("Floatpercentage is "+floatPercentage); ! if (unsoldPercentage <= 100 - floatPercentage) { // Company floats. // In 1856 this does not mean that the company will operate, // only that it will be added to the list of companies ! // being considered for an OR turn. // See OperatingRound_1856 for the actual check. if (!company.hasFloated()) { *************** *** 54,62 **** } protected CashHolder getSharePriceRecipient(Certificate cert, int price) { CashHolder recipient; Portfolio oldHolder = (Portfolio) cert.getHolder(); ! if (price != 0 && cert instanceof PublicCertificateI --- 46,55 ---- } + @Override protected CashHolder getSharePriceRecipient(Certificate cert, int price) { CashHolder recipient; Portfolio oldHolder = (Portfolio) cert.getHolder(); ! if (price != 0 && cert instanceof PublicCertificateI *************** *** 76,80 **** ReportBuffer.addWaiting(LocalText.getText("HoldMoneyInEscrow", new String[] { Bank.format(comp.getMoneyInEscrow()), ! comp.getName() })); break; --- 69,73 ---- ReportBuffer.addWaiting(LocalText.getText("HoldMoneyInEscrow", new String[] { Bank.format(comp.getMoneyInEscrow()), ! comp.getName() })); break; |
From: Erik V. <ev...@us...> - 2008-12-11 20:12:38
|
Update of /cvsroot/rails/18xx/rails/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21068/rails/util Modified Files: Tag.java MakeGameTileSets.java Log Message: Cleanups, annotations, formatting Index: MakeGameTileSets.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/MakeGameTileSets.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MakeGameTileSets.java 4 Jun 2008 19:00:39 -0000 1.6 --- MakeGameTileSets.java 11 Dec 2008 20:12:30 -0000 1.7 *************** *** 2,11 **** package rails.util; ! import java.io.*; import java.util.*; ! import javax.xml.parsers.*; ! import javax.xml.transform.*; ! import javax.xml.transform.dom.*; import javax.xml.transform.stream.StreamResult; --- 2,13 ---- package rails.util; ! import java.io.File; ! import java.io.FileOutputStream; import java.util.*; ! import javax.xml.parsers.DocumentBuilder; ! import javax.xml.parsers.DocumentBuilderFactory; ! import javax.xml.transform.TransformerFactory; ! import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; *************** *** 46,50 **** } ! new MakeGameTileSets((String[]) games.toArray(new String[0])); } else { --- 48,52 ---- } ! new MakeGameTileSets(games.toArray(new String[0])); } else { Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Tag.java 2 Dec 2008 20:29:15 -0000 1.7 --- Tag.java 11 Dec 2008 20:12:30 -0000 1.8 *************** *** 3,10 **** import java.io.IOException; ! import java.util.ArrayList; ! import java.util.HashMap; ! import java.util.List; ! import java.util.Map; import javax.xml.parsers.*; --- 3,7 ---- import java.io.IOException; ! import java.util.*; import javax.xml.parsers.*; *************** *** 14,20 **** import org.xml.sax.SAXException; ! import rails.game.ConfigurationException; ! import rails.game.Game; ! import rails.game.GameOption; /** --- 11,15 ---- import org.xml.sax.SAXException; ! import rails.game.*; /** *************** *** 23,29 **** * The methods of this class intend to replace the corresponding methods in * XmlUtils. ! * * @author Erik Vos ! * */ public class Tag { --- 18,24 ---- * The methods of this class intend to replace the corresponding methods in * XmlUtils. ! * * @author Erik Vos ! * */ public class Tag { *************** *** 52,56 **** /** * Return all child Elements with a given name of an Element. ! * * @param element * @param tagName --- 47,51 ---- /** * Return all child Elements with a given name of an Element. ! * * @param element * @param tagName *************** *** 67,71 **** /** * Return the (first) child Element with a given name from an Element. ! * * @param element * @param tagName --- 62,66 ---- /** * Return the (first) child Element with a given name from an Element. ! * * @param element * @param tagName *************** *** 194,198 **** * </code> * <p> For variant names, the fixed option name "variant" is used. ! * * @param element * @return --- 189,193 ---- * </code> * <p> For variant names, the fixed option name "variant" is used. ! * * @param element * @return *************** *** 291,295 **** * Opens and parses an xml file. Searches the root level of the file for an * element with the supplied name. ! * * @param fileName the name of the file to open * @param tagName the name of the top-level tag to find --- 286,290 ---- * Opens and parses an xml file. Searches the root level of the file for an * element with the supplied name. ! * * @param fileName the name of the file to open * @param tagName the name of the top-level tag to find *************** *** 299,303 **** * with the given name. */ ! public static Tag findTopTagInFile(String filename, List directories, String tagName) throws ConfigurationException { Document doc = null; --- 294,298 ---- * with the given name. */ ! public static Tag findTopTagInFile(String filename, List<String> directories, String tagName) throws ConfigurationException { Document doc = null; *************** *** 348,351 **** --- 343,347 ---- * @return */ + @Deprecated public Element getElement() { return element; |