Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/rails/game Modified Files: BonusToken.java Closeable.java Bonus.java StockRound.java PrivateCompanyI.java Phase.java PhaseI.java PrivateCompany.java Log Message: 1835 Prussian formation & some consequential changes Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Phase.java 3 Feb 2010 05:37:54 -0000 1.18 --- Phase.java 21 Mar 2010 17:43:50 -0000 1.19 *************** *** 6,9 **** --- 6,10 ---- import org.apache.log4j.Logger; + import rails.util.LocalText; import rails.util.Tag; *************** *** 45,48 **** --- 46,51 ---- protected List<Closeable> closedObjects = null; + protected String extraInfo = ""; + /** A HashMap to contain phase-dependent parameters * by name and value. *************** *** 145,148 **** --- 148,160 ---- } } + + // Extra info text(usually related to extra-share special properties) + Tag infoTag = tag.getChild("Info"); + if (infoTag != null) { + String infoKey = infoTag.getAttributeAsString("key"); + String[] infoParms = infoTag.getAttributeAsString("parm", "").split(","); + extraInfo += "<br>"+LocalText.getText(infoKey, (Object[])infoParms); + } + } *************** *** 159,162 **** --- 171,178 ---- } } + + public String getInfo() { + return extraInfo; + } public boolean isTileColourAllowed(String tileColour) { Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** PrivateCompany.java 1 Mar 2010 22:27:32 -0000 1.38 --- PrivateCompany.java 21 Mar 2010 17:43:50 -0000 1.39 *************** *** 28,31 **** --- 28,33 ---- // Prevent closing conditions sfy 1889 protected List<String> preventClosingConditions = null; + // Close at start of phase + protected String closeAtPhaseName = null; protected String blockedHexesString = null; *************** *** 59,63 **** } - // Special properties // Extra info text(usually related to extra-share special properties) Tag infoTag = tag.getChild("Info"); --- 61,64 ---- *************** *** 102,109 **** if (conditionText != null) { preventClosingConditions.add(conditionText); ! } } } /* end sfy 1889 */ } } catch (Exception e) { --- 103,116 ---- if (conditionText != null) { preventClosingConditions.add(conditionText); ! } } } /* end sfy 1889 */ + + // Close at start of phase + Tag closeTag = closureTag.getChild("Phase"); + if (closeTag != null) { + closeAtPhaseName = closeTag.getText(); + } } } catch (Exception e) { *************** *** 133,136 **** --- 140,150 ---- infoText += parentInfoText; parentInfoText = ""; + + if (Util.hasValue(closeAtPhaseName)) { + PhaseI closingPhase = gameManager.getPhaseManager().getPhaseByName(closeAtPhaseName); + if (closingPhase != null) { + closingPhase.addObjectToClose(this); + } + } } *************** *** 191,195 **** /** ! * @return Portfolio of this Private */ public Portfolio getPortfolio() { --- 205,209 ---- /** ! * @return Portfolio (holder) of this Private */ public Portfolio getPortfolio() { *************** *** 359,362 **** --- 373,382 ---- } + public String getClosingInfo() { + return null; + } + public void close() { + setClosed(); + } } Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** StockRound.java 12 Mar 2010 20:28:27 -0000 1.69 --- StockRound.java 21 Mar 2010 17:43:50 -0000 1.70 *************** *** 1311,1314 **** --- 1311,1319 ---- } + public void setCurrentPlayer(Player player) { + super.setCurrentPlayer(player); + currentPlayer = player; + } + /*----- METHODS TO BE CALLED TO SET UP THE NEXT TURN -----*/ Index: Closeable.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Closeable.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Closeable.java 19 Jan 2010 19:54:11 -0000 1.3 --- Closeable.java 21 Mar 2010 17:43:50 -0000 1.4 *************** *** 5,9 **** public void close(); ! public String getInfo(); } --- 5,9 ---- public void close(); ! public String getClosingInfo(); } Index: BonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/BonusToken.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BonusToken.java 31 Jan 2010 22:22:28 -0000 1.16 --- BonusToken.java 21 Mar 2010 17:43:50 -0000 1.17 *************** *** 114,118 **** } ! public String getInfo () { return description; } --- 114,118 ---- } ! public String getClosingInfo () { return description; } Index: PhaseI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PhaseI.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PhaseI.java 3 Feb 2010 05:37:54 -0000 1.8 --- PhaseI.java 21 Mar 2010 17:43:50 -0000 1.9 *************** *** 17,20 **** --- 17,22 ---- public boolean doPrivatesClose(); + public void addObjectToClose(Closeable object); + public String getInfo(); public boolean isPrivateSellingAllowed(); Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Bonus.java 31 Jan 2010 22:22:28 -0000 1.7 --- Bonus.java 21 Mar 2010 17:43:50 -0000 1.8 *************** *** 110,114 **** } ! public String getInfo() { return toString(); } --- 110,114 ---- } ! public String getClosingInfo() { return toString(); } Index: PrivateCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PrivateCompanyI.java 28 Feb 2010 21:38:05 -0000 1.10 --- PrivateCompanyI.java 21 Mar 2010 17:43:50 -0000 1.11 *************** *** 6,10 **** import rails.game.move.MoveableHolder; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder { public static final String TYPE_TAG = "Private"; --- 6,10 ---- import rails.game.move.MoveableHolder; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder, Closeable { public static final String TYPE_TAG = "Private"; |