From: Brett L. <wak...@us...> - 2010-02-03 05:38:02
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24614/rails/game/special Modified Files: SpecialTileLay.java SpecialProperty.java Log Message: Apply patches from Stefan Frey <ste...@we...> to implement 1889. Index: SpecialProperty.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialProperty.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** SpecialProperty.java 31 Jan 2010 22:22:30 -0000 1.22 --- SpecialProperty.java 3 Feb 2010 05:37:55 -0000 1.23 *************** *** 25,28 **** --- 25,29 ---- protected String whenText = ""; protected String transferText = ""; + protected boolean permanent = false; protected boolean isORProperty = false; protected boolean isSRProperty = false; *************** *** 67,70 **** --- 68,74 ---- transferText = tag.getAttributeAsString("transfer", ""); + + // sfy 1889 + permanent = tag.getAttributeAsBoolean("permanent", false); } *************** *** 131,134 **** --- 135,139 ---- public void setExercised (boolean value) { + if (permanent) return; // sfy 1889 exercised.set(value); if (value) privateCompany.checkClosingIfExercised(false); Index: SpecialTileLay.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialTileLay.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SpecialTileLay.java 31 Jan 2010 22:22:30 -0000 1.10 --- SpecialTileLay.java 3 Feb 2010 05:37:55 -0000 1.11 *************** *** 17,23 **** boolean extra = false; boolean free = false; @Override ! public void configureFromXML(Tag tag) throws ConfigurationException { super.configureFromXML(tag); --- 17,24 ---- boolean extra = false; boolean free = false; + boolean connected = false; /* sfy 1889 extension */ @Override ! public void configureFromXML(Tag tag) throws ConfigurationException { super.configureFromXML(tag); *************** *** 37,55 **** extra = tileLayTag.getAttributeAsBoolean("extra", extra); free = tileLayTag.getAttributeAsBoolean("free", free); closingValue = tileLayTag.getAttributeAsInteger("closingValue", closingValue); if (tileNumber > 0) { ! description = LocalText.getText("LayNamedTileInfo", ! tileNumber, ! name != null ? name : "", ! locationCodes, ! (extra ? LocalText.getText("extra"):LocalText.getText("notExtra")), ! (free ? LocalText.getText("noCost") : LocalText.getText("normalCost"))); } else { ! description = LocalText.getText("LayTileInfo", ! locationCodes, ! (extra ? LocalText.getText("extra"):LocalText.getText("notExtra")), ! (free ? LocalText.getText("noCost") : LocalText.getText("normalCost"))); } --- 38,63 ---- extra = tileLayTag.getAttributeAsBoolean("extra", extra); free = tileLayTag.getAttributeAsBoolean("free", free); + connected = tileLayTag.getAttributeAsBoolean("connected", connected); /* sfy 1889 extension */ closingValue = tileLayTag.getAttributeAsInteger("closingValue", closingValue); if (tileNumber > 0) { ! description = LocalText.getText("LayNamedTileInfo", ! tileNumber, ! name != null ? name : "", ! locationCodes, ! (extra ? LocalText.getText("extra"):LocalText.getText("notExtra")), ! (free ? LocalText.getText("noCost") : LocalText.getText("normalCost")), ! (connected ? LocalText.getText("connected") : LocalText.getText("unconnected")) ! /* sfy 1889 extension */ ! ); } else { ! description = LocalText.getText("LayTileInfo", ! locationCodes, ! (extra ? LocalText.getText("extra"):LocalText.getText("notExtra")), ! (free ? LocalText.getText("noCost") : LocalText.getText("normalCost")), ! (connected ? LocalText.getText("connected") : LocalText.getText("unconnected")) ! /* sfy 1889 extension */ ! ); } *************** *** 57,61 **** @Override ! public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { --- 65,69 ---- @Override ! public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { *************** *** 90,93 **** --- 98,105 ---- return free; } + // sfy 1889 + public boolean requiresConnection() { + return connected; + } public List<MapHex> getLocations() { *************** *** 112,128 **** @Override ! public String toString() { return "SpecialTileLay comp=" + privateCompany.getName() + " hex=" ! + locationCodes + " extra=" + extra + " cost=" + free; } @Override ! public String toMenu() { ! return description; } @Override ! public String getInfo() { ! return description; } } --- 124,140 ---- @Override ! public String toString() { return "SpecialTileLay comp=" + privateCompany.getName() + " hex=" ! + locationCodes + " extra=" + extra + " cost=" + free + " connected=" + connected; } @Override ! public String toMenu() { ! return description; } @Override ! public String getInfo() { ! return description; } } |