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: Stefan F. <ste...@us...> - 2010-05-19 20:14:22
|
Update of /cvsroot/rails/18xx/rails/algorithms In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/rails/algorithms Modified Files: RevenueAdapter.java RevenueTrainRun.java NetworkVertex.java Log Message: Added Off-Board bonus for 18EU and some minor fixes Index: NetworkVertex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkVertex.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NetworkVertex.java 18 May 2010 21:36:12 -0000 1.11 --- NetworkVertex.java 19 May 2010 20:14:13 -0000 1.12 *************** *** 2,5 **** --- 2,6 ---- import java.awt.geom.Point2D; + import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; *************** *** 109,112 **** --- 110,124 ---- } + public String getIdentifier(){ + if (virtual) + return virtualId; + else if (isStation()) + return hex.getName() + "." + -station.getNumber(); + else if (isSide()) + return hex.getName() + "." + side; + else + return null; + } + public boolean isVirtual() { return virtual; *************** *** 125,128 **** --- 137,144 ---- } + public VertexType getType() { + return type; + } + public boolean isMajor(){ *************** *** 203,207 **** return side; } ! /** --- 219,223 ---- return side; } ! /** *************** *** 226,230 **** sink = false; } else if (station.getType().equals(Station.OFF_MAP_AREA) || ! station.getType().equals(Station.CITY) && !city.hasTokenSlotsLeft() && !city.hasTokenOf(company)) { sink = true; } --- 242,246 ---- sink = false; } else if (station.getType().equals(Station.OFF_MAP_AREA) || ! station.getType().equals(Station.CITY) && !city.hasTokenSlotsLeft() && city.getSlots() != 0 && !city.hasTokenOf(company)) { sink = true; } *************** *** 243,247 **** // define value ! if (station.getType().equals(Station.OFF_MAP_AREA)) { value = hex.getCurrentOffBoardValue(phase); } else { --- 259,263 ---- // define value ! if (station.getType().equals(Station.OFF_MAP_AREA) || station.getValue() == -1) { value = hex.getCurrentOffBoardValue(phase); } else { *************** *** 250,261 **** } - public String getIdentifier(){ - if (isStation()) - return hex.getName() + "." + -station.getNumber(); - else if (isSide()) - return hex.getName() + "." + side; - else - return "HQ"; - } @Override --- 266,269 ---- *************** *** 300,303 **** --- 308,345 ---- /** + * creates a new virtual vertex with identical properties and links + */ + public static NetworkVertex duplicateVertex(SimpleGraph<NetworkVertex, NetworkEdge> graph, + NetworkVertex vertex, String newIdentifier, boolean addOldVertexAsHidden) { + // create new vertex + NetworkVertex newVertex = NetworkVertex.getVirtualVertex(vertex.type, newIdentifier); + // copy values + newVertex.major = vertex.major; + newVertex.minor = vertex.minor; + newVertex.value = vertex.value; + newVertex.sink = vertex.sink; + newVertex.cityName = vertex.cityName; + graph.addVertex(newVertex); + // copy edges + Set<NetworkEdge> edges = graph.edgesOf(vertex); + for (NetworkEdge edge:edges) { + List<NetworkVertex> hiddenVertices; + if (edge.getSource() == vertex) { + hiddenVertices = edge.getHiddenVertexes(); + if (addOldVertexAsHidden) hiddenVertices.add(vertex); + NetworkEdge newEdge = new NetworkEdge(newVertex, edge.getTarget(), edge.isGreedy(), edge.getDistance(), hiddenVertices); + graph.addEdge(newVertex, edge.getTarget(), newEdge); + } else { + hiddenVertices = new ArrayList<NetworkVertex>(); + if (addOldVertexAsHidden) hiddenVertices.add(vertex); + hiddenVertices.addAll(edge.getHiddenVertexes()); + NetworkEdge newEdge = new NetworkEdge(edge.getSource(), newVertex, edge.isGreedy(), edge.getDistance(), edge.getHiddenVertexes()); + graph.addEdge(newEdge.getSource(), newVertex, newEdge); + } + } + return newVertex; + } + + /** * replaces one vertex by another for a network graph * copies all edges *************** *** 324,329 **** * Returns all vertices in a specified collection of hexes */ ! public static Set<NetworkVertex> getVerticesByHex(Collection<NetworkVertex> vertices, Collection<MapHex> hexes) { ! log.info("hexes = " + hexes); Set<NetworkVertex> hexVertices = new HashSet<NetworkVertex>(); for (NetworkVertex vertex:vertices) { --- 366,370 ---- * Returns all vertices in a specified collection of hexes */ ! public static Set<NetworkVertex> getVerticesByHexes(Collection<NetworkVertex> vertices, Collection<MapHex> hexes) { Set<NetworkVertex> hexVertices = new HashSet<NetworkVertex>(); for (NetworkVertex vertex:vertices) { *************** *** 335,340 **** --- 376,391 ---- } + public static NetworkVertex getVertexByIdentifier(Collection<NetworkVertex> vertices, String identifier) { + for (NetworkVertex vertex:vertices) { + if (vertex.getIdentifier().equals(identifier)) { + return vertex; + } + } + return null; + } public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { + if (vertex.isVirtual()) return null; + GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); if (vertex.isMajor()) { Index: RevenueTrainRun.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueTrainRun.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RevenueTrainRun.java 18 May 2010 04:12:22 -0000 1.2 --- RevenueTrainRun.java 19 May 2010 20:14:13 -0000 1.3 *************** *** 58,61 **** --- 58,69 ---- } + private String prettyPrintHexName(NetworkVertex vertex) { + if (vertex.isVirtual()) { + return vertex.getIdentifier(); + } else { + return vertex.getHex().getName(); + } + } + private int prettyPrintNewLine(StringBuffer runPrettyPrint, int multiple, int initLength) { if (runPrettyPrint.length() / PRETTY_PRINT_LENGTH != multiple) { *************** *** 79,88 **** currentHex = vertex.getHex(); startVertex = vertex; ! runPrettyPrint.append(vertex.getHex().getName() + "("); } else if (startVertex == vertex) { currentHex = vertex.getHex(); runPrettyPrint.append(") / "); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); ! runPrettyPrint.append(vertex.getHex().getName() + "(0"); continue; } else if (vertex.getHex() != currentHex) { --- 87,96 ---- currentHex = vertex.getHex(); startVertex = vertex; ! runPrettyPrint.append(prettyPrintHexName(vertex) + "("); } else if (startVertex == vertex) { currentHex = vertex.getHex(); runPrettyPrint.append(") / "); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); ! runPrettyPrint.append(prettyPrintHexName(vertex) + "(0"); continue; } else if (vertex.getHex() != currentHex) { *************** *** 90,94 **** runPrettyPrint.append("), "); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); ! runPrettyPrint.append(vertex.getHex().getName() + "("); } else { runPrettyPrint.append(","); --- 98,102 ---- runPrettyPrint.append("), "); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); ! runPrettyPrint.append(prettyPrintHexName(vertex) + "("); } else { runPrettyPrint.append(","); Index: RevenueAdapter.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueAdapter.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RevenueAdapter.java 18 May 2010 21:36:12 -0000 1.15 --- RevenueAdapter.java 19 May 2010 20:14:13 -0000 1.16 *************** *** 34,39 **** // define VertexVisitSet public class VertexVisit { ! Set<NetworkVertex> set; ! VertexVisit() {set = new HashSet<NetworkVertex>();} public String toString() { return "VertexVisit Set:" + set; --- 34,39 ---- // define VertexVisitSet public class VertexVisit { ! public Set<NetworkVertex> set; ! public VertexVisit() {set = new HashSet<NetworkVertex>();} public String toString() { return "VertexVisit Set:" + set; |
From: Stefan F. <ste...@us...> - 2010-05-19 20:14:22
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/rails/game/specific/_18EU Added Files: OffBoardRevenueModifier.java Log Message: Added Off-Board bonus for 18EU and some minor fixes --- NEW FILE: OffBoardRevenueModifier.java --- package rails.game.specific._18EU; import java.util.HashSet; import java.util.Set; import org.apache.log4j.Logger; import rails.algorithms.NetworkVertex; import rails.algorithms.RevenueAdapter; import rails.algorithms.RevenueBonus; import rails.algorithms.RevenueStaticModifier; import rails.algorithms.RevenueAdapter.VertexVisit; import rails.game.ConfigurableComponentI; import rails.game.ConfigurationException; import rails.game.GameManagerI; import rails.game.PhaseI; import rails.game.Station; import rails.util.Tag; public class OffBoardRevenueModifier implements RevenueStaticModifier, ConfigurableComponentI { protected static Logger log = Logger.getLogger(OffBoardRevenueModifier.class.getPackage().getName()); public void configureFromXML(Tag tag) throws ConfigurationException { // does nothing } public void finishConfiguration(GameManagerI parent) throws ConfigurationException { // does nothing } public void modifyCalculator(RevenueAdapter revenueAdapter) { // 1. define value PhaseI phase = revenueAdapter.getPhase(); int bonusValue; if (phase.isTileColourAllowed("gray")) { bonusValue = 30; } else if (phase.isTileColourAllowed("brown")) { bonusValue = 20; } else if (phase.isTileColourAllowed("green")) { bonusValue = 100; } else { return; } log.info("OffBoardRevenueModifier: bonusValue = " + bonusValue); // 2. get all off-board type stations and Hamburg Set<NetworkVertex> offBoard = new HashSet<NetworkVertex>(); for (NetworkVertex vertex:revenueAdapter.getVertices()) { if (vertex.isStation() && vertex.getStation().getType().equals(Station.OFF_MAP_AREA)){ offBoard.add(vertex); } } // 3. get Hamburg ... NetworkVertex hamburgCity = NetworkVertex.getVertexByIdentifier(revenueAdapter.getVertices(), "B7.-1"); if (hamburgCity != null) { // ... and duplicate the vertex NetworkVertex hamburgTerminal = NetworkVertex.duplicateVertex(revenueAdapter.getGraph(), hamburgCity, "Hamburg(T)", true); hamburgTerminal.setSink(true); offBoard.add(hamburgTerminal); // vertexVisitSet for the two Hamburgs VertexVisit hamburgSet = revenueAdapter.new VertexVisit(); hamburgSet.set.add(hamburgCity); hamburgSet.set.add(hamburgTerminal); revenueAdapter.addVertexVisitSet(hamburgSet); } log.info("OffBoardRevenueModifier: offBoard = " + offBoard); // 4. get all base tokens (=> start vertices) Set<NetworkVertex> bases = revenueAdapter.getStartVertices(); // 5. combine those to revenueBonuses // always two offboard areas and one base Set<NetworkVertex> destOffBoard = new HashSet<NetworkVertex>(offBoard); for (NetworkVertex offA:offBoard) { destOffBoard.remove(offA); for (NetworkVertex offB:destOffBoard) { for (NetworkVertex base:bases) { RevenueBonus bonus = new RevenueBonus(bonusValue, "OB/" + base.toString()); bonus.addVertex(offA); bonus.addVertex(offB); bonus.addVertex(base); revenueAdapter.addRevenueBonus(bonus); } } } } } |
From: Stefan F. <ste...@us...> - 2010-05-19 20:14:22
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/data/18AL Modified Files: Game.xml Log Message: Added Off-Board bonus for 18EU and some minor fixes Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/Game.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Game.xml 4 Feb 2010 22:22:56 -0000 1.28 --- Game.xml 19 May 2010 20:14:13 -0000 1.29 *************** *** 42,46 **** <Component name="TrainManager" class="rails.game.TrainManager"> <Defaults class="rails.game.specific._18AL.NameableTrain"> ! <Reach base="stops" countTowns="yes"/> <Score towns="yes"/> </Defaults> --- 42,46 ---- <Component name="TrainManager" class="rails.game.TrainManager"> <Defaults class="rails.game.specific._18AL.NameableTrain"> ! <Reach base="stops" countTowns="no"/> <Score towns="yes"/> </Defaults> *************** *** 104,106 **** --- 104,108 ---- </Phase> </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + </Component> </ComponentManager> \ No newline at end of file |
From: Stefan F. <ste...@us...> - 2010-05-19 20:14:22
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/data/18EU Modified Files: Game.xml Log Message: Added Off-Board bonus for 18EU and some minor fixes Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Game.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Game.xml 15 May 2010 16:36:09 -0000 1.21 --- Game.xml 19 May 2010 20:14:13 -0000 1.22 *************** *** 104,106 **** --- 104,109 ---- </Phase> </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + <StaticModifier class="rails.game.specific._18EU.OffBoardRevenueModifier" /> + </Component> </ComponentManager> \ No newline at end of file |
From: Stefan F. <ste...@us...> - 2010-05-19 20:14:21
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/rails/game Modified Files: Bonus.java Log Message: Added Off-Board bonus for 18EU and some minor fixes Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Bonus.java 18 May 2010 21:36:12 -0000 1.9 --- Bonus.java 19 May 2010 20:14:13 -0000 1.10 *************** *** 133,137 **** // 2. find vertices to hex ! Set<NetworkVertex> bonusVertices = NetworkVertex.getVerticesByHex(revenueAdapter.getVertices(), locations); for (NetworkVertex bonusVertex:bonusVertices) { if (!bonusVertex.isStation()) continue; --- 133,137 ---- // 2. find vertices to hex ! Set<NetworkVertex> bonusVertices = NetworkVertex.getVerticesByHexes(revenueAdapter.getVertices(), locations); for (NetworkVertex bonusVertex:bonusVertices) { if (!bonusVertex.isStation()) continue; |
From: Erik V. <ev...@us...> - 2010-05-18 22:07:26
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15623/rails/game Modified Files: ShareSellingRound.java Player.java OperatingRound.java GameManager.java Log Message: 18EU bankruptcy rules Index: Player.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Player.java 23 Mar 2010 18:44:30 -0000 1.25 --- Player.java 18 May 2010 22:07:18 -0000 1.26 *************** *** 3,6 **** --- 3,7 ---- import rails.game.model.*; + import rails.game.state.BooleanState; /** *************** *** 25,28 **** --- 26,30 ---- private CalculatedMoneyModel freeCash; private CalculatedMoneyModel worth; + private BooleanState bankrupt; private boolean hasBoughtStockThisTurn = false; *************** *** 40,43 **** --- 42,46 ---- worth = new CalculatedMoneyModel(this, "getWorth"); wallet.addDependent(worth); + bankrupt = new BooleanState (name+"_isBankrupt", false); } *************** *** 174,177 **** --- 177,188 ---- } + public void setBankrupt () { + bankrupt.set(true); + } + + public boolean isBankrupt () { + return bankrupt.booleanValue(); + } + /** * Compare Players by their total worth, in descending order. This method Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** OperatingRound.java 16 May 2010 20:59:12 -0000 1.131 --- OperatingRound.java 18 May 2010 22:07:18 -0000 1.132 *************** *** 12,16 **** import rails.game.state.EnumState; import rails.game.state.GenericState; - import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.SequenceUtil; --- 12,15 ---- Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** GameManager.java 18 May 2010 04:12:23 -0000 1.102 --- GameManager.java 18 May 2010 22:07:18 -0000 1.103 *************** *** 7,11 **** import java.util.*; - import org.apache.log4j.Logger; import org.apache.log4j.NDC; --- 7,10 ---- *************** *** 58,62 **** protected RevenueManager revenueManager; protected Bank bank; ! // map of correctionManagers protected Map<CorrectionType, CorrectionManagerI> correctionManagers = --- 57,61 ---- protected RevenueManager revenueManager; protected Bank bank; ! // map of correctionManagers protected Map<CorrectionType, CorrectionManagerI> correctionManagers = *************** *** 660,666 **** /** Stub, can be overridden in subclasses with actual actions */ public void newPhaseChecks (RoundI round) { ! } ! public String getORId () { if (showCompositeORNumber) { --- 659,665 ---- /** Stub, can be overridden in subclasses with actual actions */ public void newPhaseChecks (RoundI round) { ! } ! public String getORId () { if (showCompositeORNumber) { *************** *** 944,948 **** protected boolean export(GameAction exportAction) { ! String filename = exportAction.getFilepath(); boolean result = false; --- 943,947 ---- protected boolean export(GameAction exportAction) { ! String filename = exportAction.getFilepath(); boolean result = false; *************** *** 950,979 **** try { PrintWriter pw = new PrintWriter(filename); ! // write map information MapHex[][] allHexes =mapManager.getHexes(); ! for (MapHex[] hexRow:allHexes) for (MapHex hex:hexRow) if (hex != null) { ! pw.println(hex.getName() + "," + hex.getCurrentTile().getExternalId() + "," ! + hex.getCurrentTileRotation() + "," + hex.getOrientationName(hex.getCurrentTileRotation()) ) ; } ! pw.close(); result = true; ! ! } catch (IOException e) { log.error("Save failed", e); DisplayBuffer.add(LocalText.getText("SaveFailed", e.getMessage())); } ! return result; } ! ! /* (non-Javadoc) * @see rails.game.GameManagerI#finishShareSellingRound() --- 949,978 ---- try { PrintWriter pw = new PrintWriter(filename); ! // write map information MapHex[][] allHexes =mapManager.getHexes(); ! for (MapHex[] hexRow:allHexes) for (MapHex hex:hexRow) if (hex != null) { ! pw.println(hex.getName() + "," + hex.getCurrentTile().getExternalId() + "," ! + hex.getCurrentTileRotation() + "," + hex.getOrientationName(hex.getCurrentTileRotation()) ) ; } ! pw.close(); result = true; ! ! } catch (IOException e) { log.error("Save failed", e); DisplayBuffer.add(LocalText.getText("SaveFailed", e.getMessage())); } ! return result; } ! ! /* (non-Javadoc) * @see rails.game.GameManagerI#finishShareSellingRound() *************** *** 1015,1019 **** int maxShare; int share; ! // Assume default case as in 18EU: all assets to Bank/Pool Player bankrupter = getCurrentPlayer(); --- 1014,1018 ---- int maxShare; int share; ! // Assume default case as in 18EU: all assets to Bank/Pool Player bankrupter = getCurrentPlayer(); *************** *** 1028,1032 **** newPresident = null; maxShare = 0; ! for (int index=getCurrentPlayerIndex()+1; index<getCurrentPlayerIndex()+numberOfPlayers; index++) { player = getPlayerByIndex(index%numberOfPlayers); --- 1027,1031 ---- newPresident = null; maxShare = 0; ! for (int index=getCurrentPlayerIndex()+1; index<getCurrentPlayerIndex()+numberOfPlayers; index++) { player = getPlayerByIndex(index%numberOfPlayers); *************** *** 1039,1043 **** } if (newPresident != null) { ! bankrupter.getPortfolio().swapPresidentCertificate(company, newPresident.getPortfolio()); } else { --- 1038,1042 ---- } if (newPresident != null) { ! bankrupter.getPortfolio().swapPresidentCertificate(company, newPresident.getPortfolio()); } else { *************** *** 1048,1054 **** // Dump all shares Util.moveObjects(bankrupter.getPortfolio().getCertificates(), bank.getPool()); } } ! public void registerBrokenBank(){ ReportBuffer.add(LocalText.getText("BankIsBrokenReportText")); --- 1047,1060 ---- // Dump all shares Util.moveObjects(bankrupter.getPortfolio().getCertificates(), bank.getPool()); + + bankrupter.setBankrupt(); + + // Finish the share selling round + if (getCurrentRound() instanceof ShareSellingRound) { + finishShareSellingRound(); + } } } ! public void registerBrokenBank(){ ReportBuffer.add(LocalText.getText("BankIsBrokenReportText")); *************** *** 1071,1079 **** ReportBuffer.add(""); ! List<String> gameReport = getGameReport(); for (String s:gameReport) ReportBuffer.add(s); ! // activate gameReport for UI setGameOverReportedUI(false); --- 1077,1085 ---- ReportBuffer.add(""); ! List<String> gameReport = getGameReport(); for (String s:gameReport) ReportBuffer.add(s); ! // activate gameReport for UI setGameOverReportedUI(false); *************** *** 1088,1092 **** return gameOver.booleanValue(); } ! public void setGameOverReportedUI(boolean b){ gameOverReportedUI = b; --- 1094,1098 ---- return gameOver.booleanValue(); } ! public void setGameOverReportedUI(boolean b){ gameOverReportedUI = b; *************** *** 1096,1100 **** return(gameOverReportedUI); } ! /* (non-Javadoc) * @see rails.game.GameManagerI#getGameReport() --- 1102,1106 ---- return(gameOverReportedUI); } ! /* (non-Javadoc) * @see rails.game.GameManagerI#getGameReport() *************** *** 1257,1261 **** public void setNextPlayer() { int currentPlayerIndex = getCurrentPlayerIndex(); ! currentPlayerIndex = ++currentPlayerIndex % numberOfPlayers; setCurrentPlayerIndex(currentPlayerIndex); } --- 1263,1269 ---- public void setNextPlayer() { int currentPlayerIndex = getCurrentPlayerIndex(); ! do { ! currentPlayerIndex = ++currentPlayerIndex % numberOfPlayers; ! } while (players.get(currentPlayerIndex).isBankrupt()); setCurrentPlayerIndex(currentPlayerIndex); } *************** *** 1510,1514 **** return guiHints; } ! public CorrectionManagerI getCorrectionManager(CorrectionType ct) { CorrectionManagerI cm = correctionManagers.get(ct); --- 1518,1522 ---- return guiHints; } ! public CorrectionManagerI getCorrectionManager(CorrectionType ct) { CorrectionManagerI cm = correctionManagers.get(ct); *************** *** 1520,1524 **** return cm; } ! } --- 1528,1532 ---- return cm; } ! } Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ShareSellingRound.java 27 Mar 2010 18:27:08 -0000 1.31 --- ShareSellingRound.java 18 May 2010 22:07:18 -0000 1.32 *************** *** 79,83 **** gameManager.registerBankruptcy(); ! return false; } --- 79,83 ---- gameManager.registerBankruptcy(); ! if (gameManager.isGameOver()) return false; } |
From: Erik V. <ev...@us...> - 2010-05-18 22:07:25
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15623/data Modified Files: GamesList.xml Log Message: 18EU bankruptcy rules Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** GamesList.xml 18 May 2010 04:12:23 -0000 1.35 --- GamesList.xml 18 May 2010 22:07:18 -0000 1.36 *************** *** 105,108 **** --- 105,109 ---- Not yet implemented: - High mountain yellow to green upgrade cost ($60) + - Bankruptcy rules (game currently hangs when a player goes bankrupt) </Description> <Option name="Extra3Trains" values="0,1,2" default="0"/> |
From: Stefan F. <ste...@us...> - 2010-05-18 21:36:20
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11104/rails/game Modified Files: Bonus.java Log Message: Added revenue modifier support for bonuses. Support for 1856 enabled. Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Bonus.java 21 Mar 2010 17:43:50 -0000 1.8 --- Bonus.java 18 May 2010 21:36:12 -0000 1.9 *************** *** 3,6 **** --- 3,14 ---- import java.util.List; + import java.util.Set; + + import org.apache.log4j.Logger; + + import rails.algorithms.NetworkVertex; + import rails.algorithms.RevenueAdapter; + import rails.algorithms.RevenueBonus; + import rails.algorithms.RevenueStaticModifier; /** *************** *** 16,20 **** * */ ! public class Bonus implements Closeable { private PublicCompanyI owner; --- 24,28 ---- * */ ! public class Bonus implements Closeable, RevenueStaticModifier { private PublicCompanyI owner; *************** *** 31,34 **** --- 39,45 ---- this.value = value; this.locations = locations; + + // add them to the call list of the RevenueManager + GameManager.getInstance().getRevenueManager().addStaticModifier(this); } *************** *** 113,115 **** --- 124,143 ---- return toString(); } + + /** + * Add bonus value to revenue calculator + */ + public void modifyCalculator(RevenueAdapter revenueAdapter) { + // 1. check operating company + if (owner != revenueAdapter.getCompany()) return; + + // 2. find vertices to hex + Set<NetworkVertex> bonusVertices = NetworkVertex.getVerticesByHex(revenueAdapter.getVertices(), locations); + for (NetworkVertex bonusVertex:bonusVertices) { + if (!bonusVertex.isStation()) continue; + RevenueBonus bonus = new RevenueBonus(value, name); + bonus.addVertex(bonusVertex); + revenueAdapter.addRevenueBonus(bonus); + } + } } |
From: Stefan F. <ste...@us...> - 2010-05-18 21:36:20
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11104/rails/game/special Modified Files: LocatedBonus.java SellBonusToken.java Log Message: Added revenue modifier support for bonuses. Support for 1856 enabled. Index: LocatedBonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/LocatedBonus.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LocatedBonus.java 28 Feb 2010 21:38:05 -0000 1.4 --- LocatedBonus.java 18 May 2010 21:36:12 -0000 1.5 *************** *** 43,49 **** } ! public void finishConfiguration (GameManager gameManager) throws ConfigurationException { - locations = gameManager.getMapManager().parseLocations(locationCodes); } --- 43,49 ---- } ! @Override ! public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { locations = gameManager.getMapManager().parseLocations(locationCodes); } Index: SellBonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SellBonusToken.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SellBonusToken.java 28 Feb 2010 21:38:05 -0000 1.7 --- SellBonusToken.java 18 May 2010 21:36:12 -0000 1.8 *************** *** 51,55 **** } ! public void finishConfiguration (GameManager gameManager) throws ConfigurationException { --- 51,56 ---- } ! @Override ! public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { |
From: Stefan F. <ste...@us...> - 2010-05-18 21:36:20
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11104/data/1856 Modified Files: Game.xml Log Message: Added revenue modifier support for bonuses. Support for 1856 enabled. Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/Game.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Game.xml 12 Mar 2010 20:28:27 -0000 1.38 --- Game.xml 18 May 2010 21:36:12 -0000 1.39 *************** *** 89,91 **** --- 89,93 ---- </Phase> </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + </Component> </ComponentManager> \ No newline at end of file |
From: Stefan F. <ste...@us...> - 2010-05-18 21:36:20
|
Update of /cvsroot/rails/18xx/rails/algorithms In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11104/rails/algorithms Modified Files: NetworkTrain.java RevenueAdapter.java RevenueManager.java NetworkVertex.java Log Message: Added revenue modifier support for bonuses. Support for 1856 enabled. Index: NetworkVertex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkVertex.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NetworkVertex.java 18 May 2010 04:12:22 -0000 1.10 --- NetworkVertex.java 18 May 2010 21:36:12 -0000 1.11 *************** *** 5,8 **** --- 5,9 ---- import java.util.Comparator; import java.util.HashSet; + import java.util.List; import java.util.Set; *************** *** 297,301 **** } } - /** --- 298,301 ---- *************** *** 320,325 **** return graph.removeVertex(oldVertex); } ! ! public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); --- 320,339 ---- return graph.removeVertex(oldVertex); } ! ! /** ! * Returns all vertices in a specified collection of hexes ! */ ! public static Set<NetworkVertex> getVerticesByHex(Collection<NetworkVertex> vertices, Collection<MapHex> hexes) { ! log.info("hexes = " + hexes); ! Set<NetworkVertex> hexVertices = new HashSet<NetworkVertex>(); ! for (NetworkVertex vertex:vertices) { ! if (vertex.getHex() != null && hexes.contains(vertex.getHex())) { ! hexVertices.add(vertex); ! } ! } ! return hexVertices; ! } ! ! public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); Index: RevenueManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RevenueManager.java 18 May 2010 04:12:22 -0000 1.1 --- RevenueManager.java 18 May 2010 21:36:12 -0000 1.2 *************** *** 40,63 **** List<Tag> modifierTags = tag.getChildren("StaticModifier"); ! for (Tag modifierTag:modifierTags) { ! // get classname ! String className = modifierTag.getAttributeAsString("class"); ! if (className == null) { ! throw new ConfigurationException(LocalText.getText( ! "ComponentHasNoClass", "StaticModifier")); ! } ! // create modifier ! RevenueStaticModifier modifier; ! try { ! modifier = (RevenueStaticModifier) Class.forName(className).newInstance(); ! } catch (Exception e) { ! throw new ConfigurationException(LocalText.getText( ! "ClassCannotBeInstantiated", className), e); } - // add them to the revenueManager - staticModifiers.add(modifier); - log.info("Added modifier " + className); } - } --- 40,64 ---- List<Tag> modifierTags = tag.getChildren("StaticModifier"); ! if (modifierTags != null) { ! for (Tag modifierTag:modifierTags) { ! // get classname ! String className = modifierTag.getAttributeAsString("class"); ! if (className == null) { ! throw new ConfigurationException(LocalText.getText( ! "ComponentHasNoClass", "StaticModifier")); ! } ! // create modifier ! RevenueStaticModifier modifier; ! try { ! modifier = (RevenueStaticModifier) Class.forName(className).newInstance(); ! } catch (Exception e) { ! throw new ConfigurationException(LocalText.getText( ! "ClassCannotBeInstantiated", className), e); ! } ! // add them to the revenueManager ! staticModifiers.add(modifier); ! log.info("Added modifier " + className); } } } *************** *** 71,74 **** --- 72,80 ---- } + public void addStaticModifier(RevenueStaticModifier modifier) { + staticModifiers.add(modifier); + log.info("Added modifier " + modifier); + } + void callStaticModifiers(RevenueAdapter revenueAdapter) { for (RevenueStaticModifier modifier:staticModifiers) { Index: NetworkTrain.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkTrain.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NetworkTrain.java 14 May 2010 15:19:57 -0000 1.6 --- NetworkTrain.java 18 May 2010 21:36:12 -0000 1.7 *************** *** 29,47 **** this.trainName = trainName; this.railsTrainType = trainType; } static NetworkTrain createFromRailsTrain(TrainI railsTrain){ ! int cities = railsTrain.getMajorStops(); ! int towns = railsTrain.getMinorStops(); ! boolean townsCostNothing = (railsTrain.getTownCountIndicator() == 0); ! int multiplyCities = railsTrain.getCityScoreFactor(); ! int multiplyTowns = railsTrain.getTownScoreFactor(); String trainName = railsTrain.getName(); TrainTypeI trainType = railsTrain.getType(); ! if (cities == 0 && towns == 0) { return null;// protection against pullman } else { ! return new NetworkTrain(cities, towns, townsCostNothing, multiplyCities, multiplyTowns, trainName, trainType); } --- 29,54 ---- this.trainName = trainName; this.railsTrainType = trainType; + log.info("Created NetworkTrain " + this.toString() + " / " + this.attributes()); } static NetworkTrain createFromRailsTrain(TrainI railsTrain){ ! int majors = railsTrain.getMajorStops(); ! int minors = railsTrain.getMinorStops(); ! if (railsTrain.getTownCountIndicator() == 0) { ! minors = 999; ! } ! int multiplyMajors = railsTrain.getCityScoreFactor(); ! int multiplyMinors = railsTrain.getTownScoreFactor(); ! boolean ignoreMinors = false; ! if (multiplyMinors == 0){ ! ignoreMinors = true; ! } String trainName = railsTrain.getName(); TrainTypeI trainType = railsTrain.getType(); ! if (majors == -1) { return null;// protection against pullman } else { ! return new NetworkTrain(majors, minors, ignoreMinors, multiplyMajors, multiplyMinors, trainName, trainType); } *************** *** 65,69 **** } else if (t.contains("D")) { log.info("RA: found Double Express train"); ! cities = Integer.parseInt(t.replace("D", "")); ignoreTowns = true; multiplyCities = 2; --- 72,76 ---- } else if (t.contains("D")) { log.info("RA: found Double Express train"); ! cities = Integer.parseInt(t.replace("D", "")); ignoreTowns = true; multiplyCities = 2; *************** *** 112,115 **** --- 119,132 ---- return railsTrainType; } + + public String attributes() { + StringBuffer attributes = new StringBuffer(); + attributes.append("majors = " + majors); + attributes.append(", minors = " + minors); + attributes.append(", ignoreMinors = " + ignoreMinors); + attributes.append(", mulitplyMajors = " + multiplyMajors); + attributes.append(", mulitplyMinors = " + multiplyMinors); + return attributes.toString(); + } public String toString() { Index: RevenueAdapter.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueAdapter.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RevenueAdapter.java 18 May 2010 04:12:22 -0000 1.14 --- RevenueAdapter.java 18 May 2010 21:36:12 -0000 1.15 *************** *** 79,82 **** --- 79,86 ---- } + public PublicCompanyI getCompany() { + return company; + } + public PhaseI getPhase() { return phase; *************** *** 187,192 **** // add all static modifiers ! gameManager.getRevenueManager().callStaticModifiers(this); ! } private void defineVertexVisitSets() { --- 191,197 ---- // add all static modifiers ! if (gameManager.getRevenueManager() != null) { ! gameManager.getRevenueManager().callStaticModifiers(this); ! } } private void defineVertexVisitSets() { |
From: Stefan F. <ste...@us...> - 2010-05-18 04:13:56
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20164/rails/ui/swing Modified Files: GameSetupWindow.java Log Message: Minor fix Index: GameSetupWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameSetupWindow.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GameSetupWindow.java 15 Feb 2010 23:30:13 -0000 1.23 --- GameSetupWindow.java 18 May 2010 04:13:48 -0000 1.24 *************** *** 211,214 **** --- 211,216 ---- DisplayBuffer.get(), "", JOptionPane.ERROR_MESSAGE); } + } else { // cancel pressed + return; } |
From: Stefan F. <ste...@us...> - 2010-05-18 04:13:35
|
Update of /cvsroot/rails/18xx/tiles In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20119/tiles Modified Files: HandmadeTiles.xml Log Message: 1835 Berlin defined as handmade Index: HandmadeTiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/tiles/HandmadeTiles.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HandmadeTiles.xml 30 Apr 2010 15:22:42 -0000 1.1 --- HandmadeTiles.xml 18 May 2010 04:13:27 -0000 1.2 *************** *** 7,9 **** --- 7,15 ---- <Track from="side3" gauge="normal" to="city1"/> </Tile> + <Tile colour="yellow" id="-806" name="Berlin"> + <Station id="city1" position="402" slots="1" type="City" city="Berlin" value="30"/> + <Station id="city2" position="001" slots="1" type="City" city="Berlin" value="30"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side5"/> + </Tile> </Tiles> |
From: Stefan F. <ste...@us...> - 2010-05-18 04:13:11
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20016 Modified Files: LocalisedText.properties Log Message: Added 2 players 70% certificate limit game option Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** LocalisedText.properties 13 May 2010 09:51:32 -0000 1.132 --- LocalisedText.properties 18 May 2010 04:13:03 -0000 1.133 *************** *** 520,523 **** --- 520,524 ---- TREASURY_SHARES=<html>Treasury<br>shares TreasuryOverHoldLimit=Treasury would get over the {0}% hold limit + TwoPlayersCertLimit70Percent=Certification Limit of 70% for 2 Players unconnected=unconnected UnexpectedAction=Unexpected action: {0} |
From: Stefan F. <ste...@us...> - 2010-05-18 04:13:11
|
Update of /cvsroot/rails/18xx/data/1830 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20016/data/1830 Modified Files: Game.xml Log Message: Added 2 players 70% certificate limit game option Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/Game.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Game.xml 9 Apr 2010 17:50:59 -0000 1.35 --- Game.xml 18 May 2010 04:13:03 -0000 1.36 *************** *** 23,26 **** --- 23,27 ---- <GameOption name="UnlimitedTiles" type="toggle" default="no"/> <GameOption name="LeaveAuctionOnPass" type="toggle" default="no"/> + <GameOption name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> <GameParameters> <PlayerShareLimit percentage="60"> *************** *** 28,32 **** by the game engine --> <IfOption name="NumberOfPlayers" value="2"> ! <Attributes percentage="70"/> </IfOption> </PlayerShareLimit> --- 29,35 ---- by the game engine --> <IfOption name="NumberOfPlayers" value="2"> ! <IfOption name="TwoPlayersCertLimit70Percent" value="yes"> ! <Attributes percentage="70"/> ! </IfOption> </IfOption> </PlayerShareLimit> |
From: Stefan F. <ste...@us...> - 2010-05-18 04:13:10
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20016/data/1889 Modified Files: Game.xml Log Message: Added 2 players 70% certificate limit game option Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Game.xml 11 May 2010 21:47:21 -0000 1.9 --- Game.xml 18 May 2010 04:13:03 -0000 1.10 *************** *** 20,23 **** --- 20,24 ---- <GameOption name="WithOptional6Train" type="toggle" default="no"/> <GameOption name="UnlimitedTopTrains" parm="D" type="toggle" default="yes"/> + <GameOption name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> <GameParameters> <PlayerShareLimit percentage="60"> *************** *** 25,29 **** by the game engine --> <IfOption name="NumberOfPlayers" value="2"> ! <Attributes percentage="70"/> </IfOption> </PlayerShareLimit> --- 26,32 ---- by the game engine --> <IfOption name="NumberOfPlayers" value="2"> ! <IfOption name="TwoPlayersCertLimit70Percent" value="yes"> ! <Attributes percentage="70"/> ! </IfOption> </IfOption> </PlayerShareLimit> |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:30
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19864/data Modified Files: GamesList.xml Log Message: Various updates to revenue calculation, especially RevenueStaticModifier and support for 18Kaas Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GamesList.xml 8 May 2010 14:52:50 -0000 1.34 --- GamesList.xml 18 May 2010 04:12:23 -0000 1.35 *************** *** 28,31 **** --- 28,32 ---- <Option name="UnlimitedTiles" type="toggle" default="no"/> <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> + <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> <Players minimum="3" maximum="6"/> </Game> *************** *** 75,78 **** --- 76,80 ---- <Option name="WithOptional6Train" type="toggle" default="no"/> <Option name="UnlimitedTopTrains" parm="D" type="toggle" default="yes"/> + <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> </Game> *************** *** 118,121 **** --- 120,124 ---- Should work, but has not been extensively tested. Limitations as with 1830. </Description> + <Option name="RuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="WithOptional6Train" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:30
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18Kaas In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19864/rails/game/specific/_18Kaas Added Files: RuhrRevenueModifier.java Log Message: Various updates to revenue calculation, especially RevenueStaticModifier and support for 18Kaas --- NEW FILE: RuhrRevenueModifier.java --- package rails.game.specific._18Kaas; import java.util.HashSet; import java.util.Set; import org.apache.log4j.Logger; import rails.algorithms.NetworkVertex; import rails.algorithms.RevenueAdapter; import rails.algorithms.RevenueBonus; import rails.algorithms.RevenueStaticModifier; import rails.game.ConfigurableComponentI; import rails.game.ConfigurationException; import rails.game.GameManagerI; import rails.util.Tag; public class RuhrRevenueModifier implements RevenueStaticModifier, ConfigurableComponentI { protected static Logger log = Logger.getLogger(RuhrRevenueModifier.class.getPackage().getName()); private boolean doublesOnlyMajors; public void configureFromXML(Tag tag) throws ConfigurationException { // does nothing } public void finishConfiguration(GameManagerI parent) throws ConfigurationException { doublesOnlyMajors = parent.getGameOption("RuhrgebiedDoublesOnlyMajors").equalsIgnoreCase("yes"); log.debug("Finish configuration of RuhrRevenueModifier, doublesOnlyMajors = " + doublesOnlyMajors); } // creates revenueBonuses that double the value of each station/value vertex public void modifyCalculator(RevenueAdapter revenueAdapter) { Set<NetworkVertex> ruhrGebied = new HashSet<NetworkVertex>(); for (NetworkVertex vertex:revenueAdapter.getVertices()) { // 1. get all vertices that point to Ruhrgebied if (vertex.getCityName() != null && vertex.getCityName().equals("Ruhrgebied")){ ruhrGebied.add(vertex); } } // 2. add revenue bonuses for stations for (NetworkVertex vertex:revenueAdapter.getVertices()) { if (!ruhrGebied.contains(vertex) && vertex.isStation() && (vertex.isMajor() || !doublesOnlyMajors)) { for (NetworkVertex ruhrVertex:ruhrGebied) { RevenueBonus bonus = new RevenueBonus(vertex.getValue(), "Ruhr/" + vertex.toString()); bonus.addVertex(vertex); bonus.addVertex(ruhrVertex); revenueAdapter.addRevenueBonus(bonus); } } } } } |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:30
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19864/rails/game Modified Files: Game.java MapHex.java GameManagerI.java GameManager.java Tile.java ComponentManager.java Log Message: Various updates to revenue calculation, especially RevenueStaticModifier and support for 18Kaas Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** GameManager.java 15 May 2010 16:36:09 -0000 1.101 --- GameManager.java 18 May 2010 04:12:23 -0000 1.102 *************** *** 11,14 **** --- 11,15 ---- import org.apache.log4j.NDC; + import rails.algorithms.RevenueManager; import rails.common.GuiDef; import rails.common.GuiHints; *************** *** 55,58 **** --- 56,60 ---- protected MapManager mapManager; protected TileManager tileManager; + protected RevenueManager revenueManager; protected Bank bank; *************** *** 446,449 **** --- 448,452 ---- MapManager mapManager, TileManager tileManager, + RevenueManager revenueManager, Bank bank) { this.gameName = gameName; *************** *** 455,458 **** --- 458,462 ---- this.mapManager = mapManager; this.tileManager = tileManager; + this.revenueManager = revenueManager; this.bank = bank; *************** *** 1304,1307 **** --- 1308,1318 ---- } + /** + * The RevenueManager is optional, thus a null reference might be returned + */ + public RevenueManager getRevenueManager() { + return revenueManager; + } + public Bank getBank () { return bank; Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Game.java 23 Mar 2010 18:44:37 -0000 1.53 --- Game.java 18 May 2010 04:12:23 -0000 1.54 *************** *** 7,10 **** --- 7,11 ---- import org.apache.log4j.Logger; + import rails.algorithms.RevenueManager; import rails.game.action.PossibleAction; import rails.game.special.SpecialProperty; *************** *** 25,28 **** --- 26,30 ---- protected MapManager mapManager; protected TileManager tileManager; + protected RevenueManager revenueManager; protected Bank bank; protected String name; *************** *** 162,165 **** --- 164,176 ---- + GAME_XML_FILE); } + + revenueManager = + (RevenueManager) componentManager.findComponent("RevenueManager"); + // revenueManager is optional so far + // if (revenueManager == null) { + // throw new ConfigurationException( + // "No RevenueManager XML element found in file " + // + GAME_XML_FILE); + // } /* *************** *** 170,174 **** gameManager.init(name, playerManager, companyManager, phaseManager, trainManager, stockMarket, mapManager, ! tileManager, bank); companyManager.finishConfiguration(gameManager); --- 181,185 ---- gameManager.init(name, playerManager, companyManager, phaseManager, trainManager, stockMarket, mapManager, ! tileManager, revenueManager, bank); companyManager.finishConfiguration(gameManager); *************** *** 179,182 **** --- 190,195 ---- stockMarket.finishConfiguration(gameManager); tileManager.finishConfiguration(gameManager); + if (revenueManager != null) + revenueManager.finishConfiguration(gameManager); } catch (Exception e) { String message = Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** MapHex.java 11 May 2010 21:47:21 -0000 1.44 --- MapHex.java 18 May 2010 04:12:23 -0000 1.45 *************** *** 203,207 **** revenueBonuses = new ArrayList<RevenueBonusTemplate>(); for (Tag bonusTag:bonusTags) { ! revenueBonuses.add(new RevenueBonusTemplate(bonusTag)); } } --- 203,209 ---- revenueBonuses = new ArrayList<RevenueBonusTemplate>(); for (Tag bonusTag:bonusTags) { ! RevenueBonusTemplate bonus = new RevenueBonusTemplate(); ! bonus.configureFromXML(bonusTag); ! revenueBonuses.add(bonus); } } Index: Tile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Tile.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Tile.java 15 May 2010 19:05:39 -0000 1.41 --- Tile.java 18 May 2010 04:12:23 -0000 1.42 *************** *** 283,287 **** revenueBonuses = new ArrayList<RevenueBonusTemplate>(); for (Tag bonusTag:bonusTags) { ! revenueBonuses.add(new RevenueBonusTemplate(bonusTag)); } } --- 283,289 ---- revenueBonuses = new ArrayList<RevenueBonusTemplate>(); for (Tag bonusTag:bonusTags) { ! RevenueBonusTemplate bonus = new RevenueBonusTemplate(); ! bonus.configureFromXML(bonusTag); ! revenueBonuses.add(bonus); } } Index: ComponentManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ComponentManager.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ComponentManager.java 23 Mar 2010 18:45:16 -0000 1.18 --- ComponentManager.java 18 May 2010 04:12:23 -0000 1.19 *************** *** 86,90 **** } String clazz = componentTag.getAttributeAsString(COMPONENT_CLASS_TAG); ! if (name == null) { throw new ConfigurationException(LocalText.getText( "ComponentHasNoClass", name)); --- 86,90 ---- } String clazz = componentTag.getAttributeAsString(COMPONENT_CLASS_TAG); ! if (clazz == null) { throw new ConfigurationException(LocalText.getText( "ComponentHasNoClass", name)); Index: GameManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManagerI.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GameManagerI.java 9 Apr 2010 21:26:12 -0000 1.33 --- GameManagerI.java 18 May 2010 04:12:23 -0000 1.34 *************** *** 4,7 **** --- 4,8 ---- import java.util.Map; + import rails.algorithms.RevenueManager; import rails.common.GuiDef; import rails.common.GuiHints; *************** *** 22,26 **** CompanyManagerI companyManager, PhaseManager phaseManager, TrainManager trainManager, StockMarketI stockMarket, ! MapManager mapManager, TileManager tileManager, Bank bank); public abstract void startGame(Map<String, String> gameOptions); --- 23,28 ---- CompanyManagerI companyManager, PhaseManager phaseManager, TrainManager trainManager, StockMarketI stockMarket, ! MapManager mapManager, TileManager tileManager, ! RevenueManager revenueManager, Bank bank); public abstract void startGame(Map<String, String> gameOptions); *************** *** 164,167 **** --- 166,170 ---- public StockMarketI getStockMarket(); public MapManager getMapManager(); + public RevenueManager getRevenueManager(); public Bank getBank (); |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:30
|
Update of /cvsroot/rails/18xx/rails/algorithms In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19864/rails/algorithms Modified Files: RevenueAdapter.java NetworkEdge.java NetworkVertex.java RevenueBonusTemplate.java RevenueCalculator.java RevenueTrainRun.java Added Files: RevenueManager.java RevenueStaticModifier.java Log Message: Various updates to revenue calculation, especially RevenueStaticModifier and support for 18Kaas Index: RevenueCalculator.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueCalculator.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RevenueCalculator.java 14 May 2010 15:19:57 -0000 1.13 --- RevenueCalculator.java 18 May 2010 04:12:22 -0000 1.14 *************** *** 541,545 **** for (int j=0; j < vertexNbVisitSets[vertexId]; j++) { trainVisited[trainId][vertexVisitSets[vertexId][j]] = arrive; ! log.info("RC: visited = " + arrive + " for vertex " + vertexVisitSets[vertexId][j] + " due to block rule"); } --- 541,545 ---- for (int j=0; j < vertexNbVisitSets[vertexId]; j++) { trainVisited[trainId][vertexVisitSets[vertexId][j]] = arrive; ! log.debug("RC: visited = " + arrive + " for vertex " + vertexVisitSets[vertexId][j] + " due to block rule"); } --- NEW FILE: RevenueManager.java --- package rails.algorithms; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.log4j.Logger; import rails.game.ConfigurableComponentI; import rails.game.ConfigurationException; import rails.game.GameManagerI; import rails.util.LocalText; import rails.util.Tag; /** * Coordinates and stores all elements related to revenue calulcation, * which are permanent. * The conversion of Rails elements is in the responsibility of the RevenueAdapter. * For each GameManager instance only one RevenueManager is created. * * @author freystef * */ public final class RevenueManager implements ConfigurableComponentI { protected static Logger log = Logger.getLogger(RevenueManager.class.getPackage().getName()); private Set<RevenueStaticModifier> staticModifiers; public RevenueManager() { staticModifiers = new HashSet<RevenueStaticModifier>(); } public void configureFromXML(Tag tag) throws ConfigurationException { // define static modifiers List<Tag> modifierTags = tag.getChildren("StaticModifier"); for (Tag modifierTag:modifierTags) { // get classname String className = modifierTag.getAttributeAsString("class"); if (className == null) { throw new ConfigurationException(LocalText.getText( "ComponentHasNoClass", "StaticModifier")); } // create modifier RevenueStaticModifier modifier; try { modifier = (RevenueStaticModifier) Class.forName(className).newInstance(); } catch (Exception e) { throw new ConfigurationException(LocalText.getText( "ClassCannotBeInstantiated", className), e); } // add them to the revenueManager staticModifiers.add(modifier); log.info("Added modifier " + className); } } public void finishConfiguration(GameManagerI parent) throws ConfigurationException { for (RevenueStaticModifier modifier:staticModifiers) { if (modifier instanceof ConfigurableComponentI) { ((ConfigurableComponentI)modifier).finishConfiguration(parent); } } } void callStaticModifiers(RevenueAdapter revenueAdapter) { for (RevenueStaticModifier modifier:staticModifiers) { modifier.modifyCalculator(revenueAdapter); } } } --- NEW FILE: RevenueStaticModifier.java --- package rails.algorithms; /** * Classes that change properties of the revenue calculation * before the actual calculation starts implement a the static modifier. * * They have to register themselves to the RevenueManager via the GameManager instance. * @author freystef * */ public interface RevenueStaticModifier{ public void modifyCalculator(RevenueAdapter revenueAdapter); } Index: NetworkVertex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkVertex.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NetworkVertex.java 11 May 2010 21:47:21 -0000 1.9 --- NetworkVertex.java 18 May 2010 04:12:22 -0000 1.10 *************** *** 4,9 **** --- 4,12 ---- import java.util.Collection; import java.util.Comparator; + import java.util.HashSet; + import java.util.Set; import org.apache.log4j.Logger; + import org.jgrapht.graph.SimpleGraph; import rails.game.City; *************** *** 21,25 **** Logger.getLogger(NetworkVertex.class.getPackage().getName()); ! private static enum VertexType { STATION, SIDE, --- 24,28 ---- Logger.getLogger(NetworkVertex.class.getPackage().getName()); ! public static enum VertexType { STATION, SIDE, *************** *** 258,263 **** public String toString(){ StringBuffer message = new StringBuffer(); ! if (isStation()) ! message.append( hex.getName() + "." + station.getNumber()); else if (isSide()) message.append(hex.getName() + "." + hex.getOrientationName(side)); --- 261,268 ---- public String toString(){ StringBuffer message = new StringBuffer(); ! if (isVirtual()) ! message.append(virtualId); ! else if (isStation()) ! message.append(hex.getName() + "." + station.getNumber()); else if (isSide()) message.append(hex.getName() + "." + hex.getOrientationName(side)); *************** *** 293,296 **** --- 298,325 ---- } + + /** + * replaces one vertex by another for a network graph + * copies all edges + */ + public static boolean replaceVertex(SimpleGraph<NetworkVertex, NetworkEdge> graph, + NetworkVertex oldVertex, NetworkVertex newVertex) { + // add new vertex + graph.addVertex(newVertex); + // replace old edges + Set<NetworkEdge> oldEdges = graph.edgesOf(oldVertex); + for (NetworkEdge oldEdge:oldEdges) { + NetworkEdge newEdge = NetworkEdge.replaceVertex(oldEdge, oldVertex, newVertex); + if (newEdge.getSource() == newVertex) { + graph.addEdge(newVertex, newEdge.getTarget(), newEdge); + } else { + graph.addEdge(newEdge.getSource(), newVertex, newEdge); + } + } + // remove old vertex + return graph.removeVertex(oldVertex); + } + + public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); Index: RevenueAdapter.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueAdapter.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RevenueAdapter.java 14 May 2010 15:19:57 -0000 1.13 --- RevenueAdapter.java 18 May 2010 04:12:22 -0000 1.14 *************** *** 83,90 **** } public Set<NetworkVertex> getVertices() { return graph.vertexSet(); } ! public Set<NetworkEdge> getEdges() { return graph.edgeSet(); --- 83,94 ---- } + public SimpleGraph<NetworkVertex,NetworkEdge> getGraph() { + return graph; + } + public Set<NetworkVertex> getVertices() { return graph.vertexSet(); } ! public Set<NetworkEdge> getEdges() { return graph.edgeSet(); *************** *** 163,167 **** // define graph, without HQ graph = graphBuilder.getRailRoadGraph(company, false); ! // define startVertexes startVertices.addAll(graphBuilder.getCompanyBaseTokenVertexes(company)); --- 167,174 ---- // define graph, without HQ graph = graphBuilder.getRailRoadGraph(company, false); ! ! // initialize vertices ! NetworkVertex.initAllRailsVertices(graph.vertexSet(), company, phase); ! // define startVertexes startVertices.addAll(graphBuilder.getCompanyBaseTokenVertexes(company)); *************** *** 179,182 **** --- 186,192 ---- } + // add all static modifiers + gameManager.getRevenueManager().callStaticModifiers(this); + } private void defineVertexVisitSets() { *************** *** 230,233 **** --- 240,244 ---- public void initRevenueCalculator(){ + // optimize graph (optimizeGraph clones the graph) rcGraph = NetworkGraphBuilder.optimizeGraph(graph, protectedVertices); *************** *** 235,239 **** // define the vertices and edges lists rcVertices = new ArrayList<NetworkVertex>(rcGraph.vertexSet()); - NetworkVertex.initAllRailsVertices(rcVertices, company, phase); // define ordering on vertexes by value Collections.sort(rcVertices, new NetworkVertex.ValueOrder()); --- 246,249 ---- Index: NetworkEdge.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkEdge.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NetworkEdge.java 11 May 2010 21:47:21 -0000 1.7 --- NetworkEdge.java 18 May 2010 04:12:22 -0000 1.8 *************** *** 163,166 **** --- 163,183 ---- } + /** + * for a given edge it replaces one of the vertices by a different one + * otherwise copies all edge attributes + * @return copied edge with replaced vertex, null if oldVertex is neither source, nor target + */ + public static NetworkEdge replaceVertex(NetworkEdge edge, NetworkVertex oldVertex, NetworkVertex newVertex) { + NetworkEdge newEdge; + if (edge.source == oldVertex) { + newEdge= new NetworkEdge(newVertex, edge.target, edge.greedy, edge.distance, edge.hiddenVertexes); + } else if (edge.target == oldVertex) { + newEdge= new NetworkEdge(edge.source, newVertex, edge.greedy, edge.distance, edge.hiddenVertexes); + } else { + newEdge = null; + } + return newEdge; + } + public static Shape getEdgeShape(HexMap map, NetworkEdge edge){ Point2D source = NetworkVertex.getVertexPoint2D(map, edge.getSource()); *************** *** 176,178 **** --- 193,196 ---- + } Index: RevenueTrainRun.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueTrainRun.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RevenueTrainRun.java 14 May 2010 15:19:57 -0000 1.1 --- RevenueTrainRun.java 18 May 2010 04:12:22 -0000 1.2 *************** *** 19,23 **** public class RevenueTrainRun { ! private static final int PRETTY_PRINT_LENGTH = 80; protected static Logger log = --- 19,23 ---- public class RevenueTrainRun { ! private static final int PRETTY_PRINT_LENGTH = 100; protected static Logger log = *************** *** 49,52 **** --- 49,58 ---- value += revenueAdapter.getVertexValue(vertex, train, revenueAdapter.getPhase()); } + // check revenueBonuses (complex) + for (RevenueBonus bonus:revenueAdapter.getRevenueBonuses()) { + if (bonus.checkComplexBonus(vertices, train.getRailsTrainType(), revenueAdapter.getPhase())) { + value += bonus.getValue(); + } + } return value; } *************** *** 102,109 **** for (RevenueBonus bonus:revenueAdapter.getRevenueBonuses()) { if (bonus.checkComplexBonus(vertices, train.getRailsTrainType(), revenueAdapter.getPhase())) { ! runPrettyPrint.append(", " + bonus.getName() + "(" + bonus.getValue() + ")"); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); } - } --- 108,115 ---- for (RevenueBonus bonus:revenueAdapter.getRevenueBonuses()) { if (bonus.checkComplexBonus(vertices, train.getRailsTrainType(), revenueAdapter.getPhase())) { ! runPrettyPrint.append(" + "); ! runPrettyPrint.append(bonus.getName() + "(" + bonus.getValue() + ")"); multiple = prettyPrintNewLine(runPrettyPrint, multiple, initLength); } } Index: RevenueBonusTemplate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueBonusTemplate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RevenueBonusTemplate.java 14 May 2010 15:19:57 -0000 1.2 --- RevenueBonusTemplate.java 18 May 2010 04:12:22 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import org.apache.log4j.Logger; + import rails.game.ConfigurableComponentI; import rails.game.ConfigurationException; import rails.game.GameManagerI; *************** *** 20,24 **** * @author freystef */ ! public class RevenueBonusTemplate { protected static Logger log = --- 21,25 ---- * @author freystef */ ! public final class RevenueBonusTemplate implements ConfigurableComponentI { protected static Logger log = *************** *** 26,33 **** // bonus value ! private final int value; // bonus name ! private final String name; // template condition attributes --- 27,34 ---- // bonus value ! private int value; // bonus name ! private String name; // template condition attributes *************** *** 36,48 **** private final List<String> identPhases; ! public RevenueBonusTemplate(Tag tag) throws ! ConfigurationException { ! ! value = tag.getAttributeAsInteger("value"); ! name = tag.getAttributeAsString("name"); ! identVertices = new ArrayList<Integer>(); identTrainTypes = new ArrayList<String>(); identPhases = new ArrayList<String>(); // check for vertices --- 37,49 ---- private final List<String> identPhases; ! public RevenueBonusTemplate() { identVertices = new ArrayList<Integer>(); identTrainTypes = new ArrayList<String>(); identPhases = new ArrayList<String>(); + } + + public void configureFromXML(Tag tag) throws ConfigurationException { + value = tag.getAttributeAsInteger("value"); + name = tag.getAttributeAsString("name"); // check for vertices *************** *** 78,84 **** } } ! log.info("Created " + this); } public RevenueBonus toRevenueBonus(MapHex hex, GameManagerI gm, NetworkGraphBuilder ngb) { log.info("Convert " + this); --- 79,94 ---- } } ! log.info("Configured " + this); ! } + /** + * is not used, use toRevenueBonus instead + */ + public void finishConfiguration(GameManagerI parent) + throws ConfigurationException { + throw new ConfigurationException("Use toRevenueBonus"); + } + public RevenueBonus toRevenueBonus(MapHex hex, GameManagerI gm, NetworkGraphBuilder ngb) { log.info("Convert " + this); *************** *** 136,138 **** --- 146,149 ---- return s.toString(); } + } |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:30
|
Update of /cvsroot/rails/18xx/data/18Kaas In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19864/data/18Kaas Modified Files: Map.xml Game.xml Log Message: Various updates to revenue calculation, especially RevenueStaticModifier and support for 18Kaas Index: Map.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/Map.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Map.xml 31 Jan 2010 22:16:03 -0000 1.6 --- Map.xml 18 May 2010 04:12:22 -0000 1.7 *************** *** 62,66 **** <Hex name="J13" tile="0"/> <Hex name="J15" tile="0" cost="80"/> ! <Hex name="J17" tile="-902" orientation="3" value="2" city="Ruhrgebied"/> <Hex name="K6" tile="0" cost="80"/> <Hex name="K8" tile="-11" orientation="5" label="B" city="Breda"/> --- 62,66 ---- <Hex name="J13" tile="0"/> <Hex name="J15" tile="0" cost="80"/> ! <Hex name="J17" tile="-902" orientation="3" value="0" city="Ruhrgebied"/> <Hex name="K6" tile="0" cost="80"/> <Hex name="K8" tile="-11" orientation="5" label="B" city="Breda"/> *************** *** 69,73 **** <Hex name="K14" tile="0"/> <Hex name="K16" tile="-10" cost="120" city="Venlo"/> ! <Hex name="K18" tile="-901" orientation="2" value="2" city="Ruhrgebied"/> <Hex name="L1" tile="-901" orientation="5" value="10,60" city="Engeland"/> <Hex name="L3" tile="-10"/> --- 69,73 ---- <Hex name="K14" tile="0"/> <Hex name="K16" tile="-10" cost="120" city="Venlo"/> ! <Hex name="K18" tile="-901" orientation="2" value="0" city="Ruhrgebied"/> <Hex name="L1" tile="-901" orientation="5" value="10,60" city="Engeland"/> <Hex name="L3" tile="-10"/> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/Game.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Game.xml 12 Mar 2010 17:15:05 -0000 1.14 --- Game.xml 18 May 2010 04:12:22 -0000 1.15 *************** *** 3,6 **** --- 3,7 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="18Kaas"/> + <GameOption name="RuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="WithOptional6Train" type="toggle" default="no"/> *************** *** 102,104 **** --- 103,108 ---- </Phase> </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + <StaticModifier class="rails.game.specific._18Kaas.RuhrRevenueModifier" /> + </Component> </ComponentManager> |
From: Stefan F. <ste...@us...> - 2010-05-18 04:12:12
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18Kaas In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19846/rails/game/specific/_18Kaas Log Message: Directory /cvsroot/rails/18xx/rails/game/specific/_18Kaas added to the repository |
From: Erik V. <ev...@us...> - 2010-05-16 21:00:23
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6589/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Fixed some bugs with recent rewrite of resetOperatingCompanies(). Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** OperatingRound_1856.java 15 May 2010 16:36:09 -0000 1.36 --- OperatingRound_1856.java 16 May 2010 21:00:15 -0000 1.37 *************** *** 514,518 **** if (cgrCanOperate) { operatingCompanyIndex = Math.max (0, operatingCompanyIndex); ! operatingCompanies.add(operatingCompanyIndex, cgr); setOperatingCompany(cgr); message = LocalText.getText("CanOperate", cgr.getName()); --- 514,518 ---- if (cgrCanOperate) { operatingCompanyIndex = Math.max (0, operatingCompanyIndex); ! operatingCompanies.add(operatingCompanyIndex+1, cgr); setOperatingCompany(cgr); message = LocalText.getText("CanOperate", cgr.getName()); *************** *** 523,526 **** --- 523,527 ---- } else { message = LocalText.getText("DoesNotForm", cgr.getName()); + roundFinished = !setNextOperatingCompany(false); } ReportBuffer.add(LocalText.getText("EndOfFormationRound", |
From: Erik V. <ev...@us...> - 2010-05-16 20:59:20
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6252/rails/game Modified Files: OperatingRound.java Log Message: Prevented concurrent modification when closing privates Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** OperatingRound.java 15 May 2010 16:36:09 -0000 1.130 --- OperatingRound.java 16 May 2010 20:59:12 -0000 1.131 *************** *** 505,508 **** --- 505,514 ---- int station = action.getChosenStation(); String companyName = operatingCompany.getName(); + + // TEMPORARY FIX to enable fixing invalidated saved files + //if ("N11".equals(hex.getName()) && station == 2) { + // station = 1; + // action.setChosenStation(1); + //} // Dummy loop to enable a quick jump out. *************** *** 1467,1473 **** companiesOperatedThisRound.add(operatingCompany); ! // Check if any privates must be closed ! // (now only applies to 1856 W&SR) ! for (PrivateCompanyI priv : operatingCompany.getPortfolio().getPrivateCompanies()) { priv.checkClosingIfExercised(true); } --- 1473,1480 ---- companiesOperatedThisRound.add(operatingCompany); ! // Check if any privates must be closed (now only applies to 1856 W&SR) ! // Copy list first to avoid concurrent modifications ! for (PrivateCompanyI priv : ! new ArrayList<PrivateCompanyI> (operatingCompany.getPortfolio().getPrivateCompanies())) { priv.checkClosingIfExercised(true); } *************** *** 1631,1634 **** --- 1638,1644 ---- if (exchangedTrain == null) { errMsg = LocalText.getText("NoExchangedTrainSpecified"); + // TEMPORARY FIX to clean up invalidated saved files - DOES NOT WORK!!?? + //exchangedTrain = operatingCompany.getPortfolio().getTrainList().get(0); + //action.setExchangedTrain(exchangedTrain); break; } else if (operatingCompany.getPortfolio().getTrainOfType(exchangedTrain.getType()) == null) { |
From: Erik V. <ev...@us...> - 2010-05-16 20:57:48
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5824/rails/util Modified Files: Util.java Log Message: Fixed parseColour() to catch empty or missing values Index: Util.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Util.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Util.java 28 Feb 2010 21:38:06 -0000 1.21 --- Util.java 16 May 2010 20:57:40 -0000 1.22 *************** *** 104,108 **** public static Color parseColour (String s) throws ConfigurationException{ Color c = null; ! if (s.indexOf(',') == -1) { // Assume hexadecimal RRGGBB try { --- 104,109 ---- public static Color parseColour (String s) throws ConfigurationException{ Color c = null; ! if (!Util.hasValue(s)) { ! } else if (s.indexOf(',') == -1) { // Assume hexadecimal RRGGBB try { |