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...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/18AL Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/CompanyManager.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CompanyManager.xml 31 Jan 2010 22:15:59 -0000 1.26 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.27 *************** *** 14,17 **** --- 14,18 ---- </BaseTokens> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> <Company name="Tusc" type="Private" basePrice="20" revenue="5"/> |
From: Erik V. <ev...@us...> - 2010-02-20 12:43:22
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16681/rails/game Modified Files: MapManager.java PublicCompanyI.java OperatingRound.java PublicCompany.java Log Message: Implemented 1835 token lay cost calculation Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** OperatingRound.java 17 Feb 2010 22:15:46 -0000 1.102 --- OperatingRound.java 20 Feb 2010 12:34:46 -0000 1.103 *************** *** 537,541 **** } ! cost = operatingCompany.getBaseTokenLayCost(); if (stl != null && stl.isFree()) cost = 0; --- 537,541 ---- } ! cost = operatingCompany.getBaseTokenLayCost(hex); if (stl != null && stl.isFree()) cost = 0; *************** *** 2245,2252 **** // LayBaseToken Actions if (operatingCompany.getNumberOfFreeBaseTokens() != 0) { ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, ! operatingCompany.getBaseTokenLayCost() ! )); } --- 2245,2255 ---- // LayBaseToken Actions if (operatingCompany.getNumberOfFreeBaseTokens() != 0) { ! int[] costs = operatingCompany.getBaseTokenLayCosts(); ! for (int cost : costs) { ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, ! cost ! )); ! } } *************** *** 2256,2260 **** )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 ! && operatingCompany.getBaseTokenLayCost() != 0) { possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0 --- 2259,2263 ---- )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 ! && operatingCompany.getBaseTokenLayCost(null) != 0) { possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0 Index: MapManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapManager.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MapManager.java 14 Feb 2010 20:47:34 -0000 1.17 --- MapManager.java 20 Feb 2010 12:34:43 -0000 1.18 *************** *** 238,241 **** --- 238,275 ---- return calculateHexDistance (hex1, hex2, 1, passed); } + + /** Cache to hold distances between tokenable cities */ + private Map<MapHex, int[]> distanceMap; + + /** + * Calculate the distances between a given tokenable city hex + * and all other tokenable city hexes. + * <p> The array is cached, so it need be calculated only once. + * @param hex Start hex + * @return Sorted int array containing all occurring distances only once. + */ + public int[] getCityDistances (MapHex hex) { + log.debug("+++ Checking distances from "+hex.getName()); + if (!hex.getCurrentTile().hasStations()) return new int[0]; + if (distanceMap == null) distanceMap = new HashMap<MapHex, int[]> (); + if (distanceMap.containsKey(hex)) return distanceMap.get(hex); + + int distance; + Set<Integer> distancesSet = new TreeSet<Integer> (); + for (MapHex hex2 : mHexes.values()) { + log.debug("--- Checking other hex "+hex2.getName()); + if (!hex2.getCurrentTile().hasStations()) continue; + distance = getHexDistance (hex, hex2); + distancesSet.add(distance); + log.debug("=== Distance is "+distance); + } + int[] distances = new int[distancesSet.size()]; + int i=0; + for (int distance2 : distancesSet) { + distances[i++] = distance2; + } + distanceMap.put(hex, distances); + return distances; + } /** Helper method to calculate the distance between two hexes. Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** PublicCompany.java 16 Feb 2010 20:15:57 -0000 1.86 --- PublicCompany.java 20 Feb 2010 12:34:50 -0000 1.87 *************** *** 31,34 **** --- 31,38 ---- protected static final int WHEN_FLOATED = 1; protected static final int START_OF_FIRST_OR = 2; + + // Base token lay cost calculation methods + public static final String BASE_COST_SEQUENCE = "sequence"; + public static final String BASE_COST_DISTANCE = "distance"; protected static final String[] tokenLayTimeNames = *************** *** 517,521 **** layCostTag.getAttributeAsString("method", baseTokenLayCostMethod); ! // Must validate the cost method! baseTokenLayCost = --- 521,533 ---- layCostTag.getAttributeAsString("method", baseTokenLayCostMethod); ! if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_SEQUENCE)) { ! baseTokenLayCostMethod = BASE_COST_SEQUENCE; ! } else if (baseTokenLayCostMethod.equalsIgnoreCase(BASE_COST_DISTANCE)) { ! baseTokenLayCostMethod = BASE_COST_DISTANCE; ! } else { ! throw new ConfigurationException( ! "Invalid base token lay cost calculation method: " ! + baseTokenLayCostMethod); ! } baseTokenLayCost = *************** *** 1651,1673 **** /** ! * Calculate the cost of laying a token. Currently hardcoded for the ! * "sequence" method. The other token layong costing methods will be ! * implemented later. ! * ! * @param index The sequence number of the token that the company is laying. * @return The cost of laying that token. */ ! public int getBaseTokenLayCost() { if (baseTokenLayCost == null) return 0; ! int index = getNumberOfLaidBaseTokens(); ! ! if (index >= baseTokenLayCost.length) { ! index = baseTokenLayCost.length - 1; ! } else if (index < 0) { ! index = 0; } ! return baseTokenLayCost[index]; } --- 1663,1715 ---- /** ! * Calculate the cost of laying a token, given the hex where ! * the token is laid. This only makes a diofference for de "distance" method. ! * @param hex The hex where the token is to be laid. * @return The cost of laying that token. */ ! public int getBaseTokenLayCost(MapHex hex) { if (baseTokenLayCost == null) return 0; ! if (baseTokenLayCostMethod.equals(BASE_COST_SEQUENCE)) { ! int index = getNumberOfLaidBaseTokens(); ! ! if (index >= baseTokenLayCost.length) { ! index = baseTokenLayCost.length - 1; ! } else if (index < 0) { ! index = 0; ! } ! return baseTokenLayCost[index]; ! } else if (baseTokenLayCostMethod.equals(BASE_COST_DISTANCE)) { ! if (hex == null) { ! return baseTokenLayCost[0]; ! } else { ! return mapManager.getHexDistance(hex, homeHex) * baseTokenLayCost[0]; ! } ! } else { ! return 0; } ! } ! ! /** Return all possible token lay costs to be incurred for the ! * company's next token lay. In the "distance" method, this will be an array. ! * @return ! */ ! public int[] getBaseTokenLayCosts () { ! ! if (baseTokenLayCostMethod.equals(BASE_COST_SEQUENCE)) { ! return new int[] {getBaseTokenLayCost(null)}; ! } else if (baseTokenLayCostMethod.equals(BASE_COST_DISTANCE)) { ! int[] distances = mapManager.getCityDistances(homeHex); ! int[] costs = new int[distances.length]; ! int i = 0; ! for (int distance : distances) { ! costs[i++] = distance * baseTokenLayCost[0]; ! } ! return costs; ! } else { ! return new int[] {0}; ! } ! } Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** PublicCompanyI.java 16 Feb 2010 20:15:42 -0000 1.47 --- PublicCompanyI.java 20 Feb 2010 12:34:46 -0000 1.48 *************** *** 154,158 **** public int getBaseTokensBuyCost(); ! public int getBaseTokenLayCost(); public boolean canHoldOwnShares(); --- 154,159 ---- public int getBaseTokensBuyCost(); ! public int getBaseTokenLayCost(MapHex hex); ! public int[] getBaseTokenLayCosts(); public boolean canHoldOwnShares(); |
From: Erik V. <ev...@us...> - 2010-02-20 12:43:04
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16681/data Modified Files: GamesList.xml Log Message: Implemented 1835 token lay cost calculation Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** GamesList.xml 17 Feb 2010 22:02:58 -0000 1.26 --- GamesList.xml 20 Feb 2010 12:34:29 -0000 1.27 *************** *** 49,52 **** --- 49,53 ---- </Description> <Option name="Variant" values="Standard,Clemens,Snake"/> + <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> <Players minimum="3" maximum="7"/> |
From: Erik V. <ev...@us...> - 2010-02-20 12:43:03
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16681/data/1835 Modified Files: Game.xml CompanyManager.xml Log Message: Implemented 1835 token lay cost calculation Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/CompanyManager.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CompanyManager.xml 6 Feb 2010 23:45:55 -0000 1.25 --- CompanyManager.xml 20 Feb 2010 12:34:43 -0000 1.26 *************** *** 6,14 **** <ShareUnit percentage="100"/> <Certificate type="President" shares="1"/> ! <StockPrice market="no"/> ! <BaseTokens> ! <LayCost method="distance" cost="20"/> ! </BaseTokens> ! <Payout split="always"/> <Trains number="2,2,1" mandatory="no"/> </CompanyType> --- 6,11 ---- <ShareUnit percentage="100"/> <Certificate type="President" shares="1"/> ! <StockPrice market="no"/> ! <Payout split="always"/> <Trains number="2,2,1" mandatory="no"/> </CompanyType> *************** *** 22,29 **** <!--NumberOfTileLays colour="yellow" phase="2" number="2"/--> <TileLays> ! <Number colour="yellow" phase="2" number="2"/> </TileLays> ! <Capitalisation type="incremental"/> ! <Trains number="4,4,3,2"/> </CompanyType> --- 19,29 ---- <!--NumberOfTileLays colour="yellow" phase="2" number="2"/--> <TileLays> ! <Number colour="yellow" phase="2" number="2"/> </TileLays> ! <BaseTokens> ! <LayCost method="distance" cost="20"/> ! </BaseTokens> ! <Capitalisation type="incremental"/> ! <Trains number="4,4,3,2"/> </CompanyType> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Game.xml 31 Jan 2010 22:15:57 -0000 1.25 --- Game.xml 20 Feb 2010 12:34:34 -0000 1.26 *************** *** 1,13 **** <?xml version="1.0"?> <ComponentManager> ! <Component name="GameManager" class="rails.game.GameManager"> <Game name="1835"/> <GameOption name="Variant" values="Standard,Clemens,Snake"/> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> <GameParameters> <PlayerShareLimit percentage="60"/> <BankPoolLimit percentage="50"/> ! <StockRound class="rails.game.specific._1835.StockRound_1835" sequence="SellBuySell"> <NoSaleInFirstSR/> <NoSaleIfNotOperated/> --- 1,17 ---- <?xml version="1.0"?> <ComponentManager> ! <Component name="GameManager" class="rails.game.GameManager"> ! <!--Component name="GameManager" class="rails.game.specific._1835.GameManager_1835"--> <Game name="1835"/> <GameOption name="Variant" values="Standard,Clemens,Snake"/> + <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> <GameParameters> <PlayerShareLimit percentage="60"/> <BankPoolLimit percentage="50"/> ! <StockRound class="rails.game.StockRound" sequence="SellBuySell"> + <!--StockRound class="rails.game.specific._1835.StockRound_1835" + sequence="SellBuySell"--> <NoSaleInFirstSR/> <NoSaleIfNotOperated/> *************** *** 49,53 **** rustedTrain="2"/> <Train name="4+4" majorStops="4" minorStops="4" cost="440" amount="1" ! rustedTrain="2+2"/> <Train name="5" majorStops="5" cost="500" amount="2" startPhase="5"/> <Train name="5+5" majorStops="5" minorStops="5" cost="600" amount="1"/> --- 53,57 ---- rustedTrain="2"/> <Train name="4+4" majorStops="4" minorStops="4" cost="440" amount="1" ! startPhase="4+4" rustedTrain="2+2"/> <Train name="5" majorStops="5" cost="500" amount="2" startPhase="5"/> <Train name="5+5" majorStops="5" minorStops="5" cost="600" amount="1"/> *************** *** 71,74 **** --- 75,81 ---- <Tiles colour="yellow,green"/> </Phase> + <Phase name="4+4"> + <Tiles colour="yellow,green"/> + </Phase> <Phase name="5"> <Tiles colour="yellow,green,brown"/> |
From: Erik V. <ev...@us...> - 2010-02-20 12:43:02
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17537/rails/game Modified Files: MapManager.java Log Message: Removed some debug logging Index: MapManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapManager.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MapManager.java 20 Feb 2010 12:34:43 -0000 1.18 --- MapManager.java 20 Feb 2010 12:42:54 -0000 1.19 *************** *** 250,254 **** */ public int[] getCityDistances (MapHex hex) { ! log.debug("+++ Checking distances from "+hex.getName()); if (!hex.getCurrentTile().hasStations()) return new int[0]; if (distanceMap == null) distanceMap = new HashMap<MapHex, int[]> (); --- 250,254 ---- */ public int[] getCityDistances (MapHex hex) { ! if (!hex.getCurrentTile().hasStations()) return new int[0]; if (distanceMap == null) distanceMap = new HashMap<MapHex, int[]> (); *************** *** 258,266 **** Set<Integer> distancesSet = new TreeSet<Integer> (); for (MapHex hex2 : mHexes.values()) { - log.debug("--- Checking other hex "+hex2.getName()); if (!hex2.getCurrentTile().hasStations()) continue; distance = getHexDistance (hex, hex2); distancesSet.add(distance); - log.debug("=== Distance is "+distance); } int[] distances = new int[distancesSet.size()]; --- 258,264 ---- |
From: Erik V. <ev...@us...> - 2010-02-19 19:58:38
|
Update of /cvsroot/rails/18xx/data/1851 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17901/data/1851 Modified Files: Game.xml Log Message: Fixed BankBreaks finish value Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1851/Game.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Game.xml 31 Jan 2010 22:15:58 -0000 1.11 --- Game.xml 19 Feb 2010 19:58:23 -0000 1.12 *************** *** 14,18 **** <EndOfGame> <Bankruptcy/> ! <BankBreaks limit="0" finish="OR"/> <!-- 0 = "Runs out"; -1 = "broken" --> </EndOfGame> --- 14,18 ---- <EndOfGame> <Bankruptcy/> ! <BankBreaks limit="0" finish="CurrentOR"/> <!-- 0 = "Runs out"; -1 = "broken" --> </EndOfGame> |
From: Erik V. <ev...@us...> - 2010-02-18 21:30:34
|
Update of /cvsroot/rails/18xx/data/1851 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18537/data/1851 Modified Files: StockMarket.xml Log Message: Fixed stock price on K3 Index: StockMarket.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1851/StockMarket.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StockMarket.xml 31 Jan 2010 22:15:58 -0000 1.2 --- StockMarket.xml 18 Feb 2010 21:30:20 -0000 1.3 *************** *** 65,69 **** <StockSpace name="K1" price="220" /> <StockSpace name="K2" price="200" /> ! <StockSpace name="K3" price="280" /> <StockSpace name="L1" price="245" /> <StockSpace name="L2" price="220" /> --- 65,69 ---- <StockSpace name="K1" price="220" /> <StockSpace name="K2" price="200" /> ! <StockSpace name="K3" price="180" /> <StockSpace name="L1" price="245" /> <StockSpace name="L2" price="220" /> |
From: Erik V. <ev...@us...> - 2010-02-17 22:15:54
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19335/rails/game Modified Files: OperatingRound.java Log Message: Fixed DISCARD_TRAINS step as a GameDef.OrStep value Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** OperatingRound.java 17 Feb 2010 22:02:47 -0000 1.101 --- OperatingRound.java 17 Feb 2010 22:15:46 -0000 1.102 *************** *** 83,89 **** GameDef.OrStep.FINAL }; - // side steps - public static final int STEP_DISCARD_TRAINS = -2; - protected boolean doneAllowed = false; --- 83,86 ---- *************** *** 1575,1579 **** // Check if any companies must discard trains if (getCurrentPhase() != previousPhase && checkForExcessTrains()) { ! stepObject.set(STEP_DISCARD_TRAINS); } --- 1572,1576 ---- // Check if any companies must discard trains if (getCurrentPhase() != previousPhase && checkForExcessTrains()) { ! stepObject.set(GameDef.OrStep.DISCARD_TRAINS); } |
From: Erik V. <ev...@us...> - 2010-02-17 22:11:57
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18693/rails/game Modified Files: GameDef.java Log Message: Added comment Index: GameDef.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameDef.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameDef.java 6 Feb 2010 23:45:21 -0000 1.4 --- GameDef.java 17 Feb 2010 22:11:49 -0000 1.5 *************** *** 36,39 **** --- 36,40 ---- public enum OrStep { + /* In-sequence steps */ INITIAL, LAY_TRACK, |
From: Stefan F. <ste...@us...> - 2010-02-17 22:03:36
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17084/rails/ui/swing Modified Files: ORUIManager.java Log Message: Added noMap support for 1856 (includes ClosePrivate actions) some minor fixes to corrections Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ORUIManager.java 14 Feb 2010 20:48:20 -0000 1.54 --- ORUIManager.java 17 Feb 2010 22:02:56 -0000 1.55 *************** *** 318,321 **** --- 318,325 ---- useSpecialProperty ((UseSpecialProperty)actions.get(0)); + } else if (actions.get(0) instanceof CorrectionAction) { + + processCorrectionAction((CorrectionAction)actions.get(0)); + } *************** *** 1155,1158 **** --- 1159,1169 ---- } + protected void processCorrectionAction(CorrectionAction action) { + + gameUIManager.processOnServer((PossibleAction)action); + + } + + public void updateStatus() { *************** *** 1376,1380 **** } } ! checkForGameSpecificActions(); --- 1387,1402 ---- } } ! ! // Close Private ! if (possibleActions.contains(ClosePrivate.class)) { ! for (ClosePrivate action: possibleActions.getType(ClosePrivate.class)) { ! if (!action.isInCorrectionMenu()) ! orPanel.addSpecialAction(action, action.getInfo()); ! } ! } ! ! // Correction Actions ! ! checkForGameSpecificActions(); |
From: Stefan F. <ste...@us...> - 2010-02-17 22:03:34
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17084/data/1856 Modified Files: Game.xml Log Message: Added noMap support for 1856 (includes ClosePrivate actions) some minor fixes to corrections Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/Game.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Game.xml 4 Feb 2010 22:23:01 -0000 1.35 --- Game.xml 17 Feb 2010 22:02:52 -0000 1.36 *************** *** 3,6 **** --- 3,7 ---- <Component name="GameManager" class="rails.game.specific._1856.GameManager_1856"> <Game name="1856"/> + <Option name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedBonusTokens" type="toggle" default="no"/> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-02-17 22:03:31
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17084/rails/game Modified Files: OperatingRound.java CompanyManager.java PrivateCompany.java Log Message: Added noMap support for 1856 (includes ClosePrivate actions) some minor fixes to corrections Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** OperatingRound.java 16 Feb 2010 20:15:42 -0000 1.100 --- OperatingRound.java 17 Feb 2010 22:02:47 -0000 1.101 *************** *** 237,240 **** --- 237,244 ---- result = exchangeTokens ((ExchangeTokens)selectedAction); + } else if (selectedAction instanceof ClosePrivate) { + + result = executeClosePrivate((ClosePrivate)selectedAction); + } else if (selectedAction instanceof NullAction) { *************** *** 937,941 **** } ! public boolean executeCorrectCash(CorrectCashI action){ CashHolder ch = action.getCashHolder(); --- 941,945 ---- } ! protected boolean executeCorrectCash(CorrectCashI action){ CashHolder ch = action.getCashHolder(); *************** *** 1022,1025 **** --- 1026,1049 ---- } + protected boolean executeClosePrivate(ClosePrivate action) { + + PrivateCompanyI priv = action.getPrivateCompany(); + + String errMsg = null; + + if (priv.isClosed()) + errMsg = LocalText.getText("PrivateAlreadyClosed", priv.getName()); + + if (errMsg != null) { + DisplayBuffer.add(errMsg); + return false; + } + + moveStack.start(true); + + priv.setClosed(); + + return true; + } /** *************** *** 2077,2081 **** prepareRevenueAndDividendAction(); if (noMapMode) ! prepareOperatingCostsAction(); } else if (step == GameDef.OrStep.BUY_TRAIN) { setBuyableTrains(); --- 2101,2105 ---- prepareRevenueAndDividendAction(); if (noMapMode) ! prepareNoMapActions(); } else if (step == GameDef.OrStep.BUY_TRAIN) { setBuyableTrains(); *************** *** 2087,2091 **** //} if (noMapMode && (operatingCompany.getLastRevenue() == 0)) ! prepareOperatingCostsAction(); } else if (step == GameDef.OrStep.DISCARD_TRAINS) { --- 2111,2115 ---- //} if (noMapMode && (operatingCompany.getLastRevenue() == 0)) ! prepareNoMapActions(); } else if (step == GameDef.OrStep.DISCARD_TRAINS) { *************** *** 2213,2217 **** } ! protected void prepareOperatingCostsAction() { // LayTile Actions --- 2237,2241 ---- } ! protected void prepareNoMapActions() { // LayTile Actions *************** *** 2221,2224 **** --- 2245,2249 ---- )); } + // LayBaseToken Actions if (operatingCompany.getNumberOfFreeBaseTokens() != 0) { *************** *** 2228,2240 **** )); } ! // Default Actions possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_TILE, 0 )); ! if (operatingCompany.getNumberOfFreeBaseTokens() != 0) { possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0 )); } } --- 2253,2273 ---- )); } ! ! // Default OperatingCost Actions possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_TILE, 0 )); ! if (operatingCompany.getNumberOfFreeBaseTokens() != 0 ! && operatingCompany.getBaseTokenLayCost() != 0) { possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0 )); } + + // Private Company Closure + for (PrivateCompanyI priv: companyManager.getAllPrivateCompanies()) { + if ((!priv.isClosed()) && (priv.closesIfAllExercised() || priv.closesIfAnyExercised())) + possibleActions.add(new ClosePrivate(priv)); + } } Index: CompanyManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/CompanyManager.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CompanyManager.java 4 Feb 2010 21:27:58 -0000 1.22 --- CompanyManager.java 17 Feb 2010 22:02:51 -0000 1.23 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import org.apache.log4j.Logger; import rails.util.LocalText; import rails.util.Tag; public class CompanyManager implements CompanyManagerI, ConfigurableComponentI { /** A List with all private companies */ private List<PrivateCompanyI> lPrivateCompanies = new ArrayList<PrivateCompanyI>(); /** A List with all public companies */ private List<PublicCompanyI> lPublicCompanies = new ArrayList<PublicCompanyI>(); /** A map with all private companies by name */ private Map<String, PrivateCompanyI> mPrivateCompanies = new HashMap<String, PrivateCompanyI>(); /** A map with all public (i.e. non-private) companies by name */ private Map<String, PublicCompanyI> mPublicCompanies = new HashMap<String, PublicCompanyI>(); /** A map of all type names to maps of companies of that type by name */ // TODO Redundant, current usage can be replaced. private Map<String, Map<String, CompanyI>> mCompaniesByTypeAndName = new HashMap<String, Map<String, CompanyI>>(); /** A list of all company types */ private List<CompanyTypeI> lCompanyTypes = new ArrayList<CompanyTypeI>(); /** A list of all start packets (usually one) */ private List<StartPacket> startPackets = new ArrayList<StartPacket>(); /** A map of all start packets, keyed by name. Default name is "Initial" */ private Map<String, StartPacket> startPacketMap = new HashMap<String, StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); protected GameManagerI gameManager; /* * NOTES: 1. we don't have a map over all companies, because some games have * duplicate names, e.g. B&O in 1830. 2. we have both a map and a list of * private/public companies to preserve configuration sequence while * allowing direct access. */ /** * No-args constructor. */ public CompanyManager() { // Nothing to do here, everything happens when configured. } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { gameManager = GameManager.getInstance(); /** A map with all company types, by type name */ // Localised here as it has no permanent use Map<String, CompanyTypeI> mCompanyTypes = new HashMap<String, CompanyTypeI>(); for (Tag compTypeTag : tag.getChildren(CompanyTypeI.ELEMENT_ID)) { // Extract the attributes of the Component String name = compTypeTag.getAttributeAsString(CompanyTypeI.NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompanyType")); } String className = compTypeTag.getAttributeAsString(CompanyTypeI.CLASS_TAG); if (className == null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeHasNoClass", name)); } if (mCompanyTypes.get(name) != null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeConfiguredTwice", name)); } CompanyTypeI companyType = new CompanyType(name, className); mCompanyTypes.put(name, companyType); lCompanyTypes.add(companyType); // Further parsing is done within CompanyType companyType.configureFromXML(compTypeTag); } /* Read and configure the companies */ for (Tag companyTag : tag.getChildren(CompanyI.COMPANY_ELEMENT_ID)) { // Extract the attributes of the Component String name = companyTag.getAttributeAsString(CompanyI.COMPANY_NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompany")); } String type = companyTag.getAttributeAsString(CompanyI.COMPANY_TYPE_TAG); if (type == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasNoType", name)); } CompanyTypeI cType = mCompanyTypes.get(type); if (cType == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasUnknownType", name, type )); } try { CompanyI company = cType.createCompany(name, companyTag); /* Private or public */ if (company instanceof PrivateCompanyI) { mPrivateCompanies.put(name, (PrivateCompanyI) company); lPrivateCompanies.add((PrivateCompanyI) company); } else if (company instanceof PublicCompanyI) { ((PublicCompanyI)company).setIndex (numberOfPublicCompanies++); mPublicCompanies.put(name, (PublicCompanyI) company); lPublicCompanies.add((PublicCompanyI) company); } /* By type and name */ if (!mCompaniesByTypeAndName.containsKey(type)) mCompaniesByTypeAndName.put(type, new HashMap<String, CompanyI>()); (mCompaniesByTypeAndName.get(type)).put( name, company); } catch (Exception e) { throw new ConfigurationException(LocalText.getText( "ClassCannotBeInstantiated", cType.getClassName()), e); } } /* Read and configure the start packets */ List<Tag> packetTags = tag.getChildren("StartPacket"); if (packetTags != null) { for (Tag packetTag : tag.getChildren("StartPacket")) { // Extract the attributes of the Component String name = packetTag.getAttributeAsString("name", StartPacket.DEFAULT_NAME); String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); startPacketMap.put(name, sp); sp.configureFromXML(packetTag); } } } // Post XML parsing initialisations public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.finishConfiguration(gameManager); } for (PrivateCompanyI comp : lPrivateCompanies) { comp.finishConfiguration(gameManager); } } /** * @see rails.game.CompanyManagerI#getCompany(java.lang.String) * */ public PrivateCompanyI getPrivateCompany(String name) { return mPrivateCompanies.get(name); } public PublicCompanyI getPublicCompany(String name) { return mPublicCompanies.get(name); } public List<PrivateCompanyI> getAllPrivateCompanies() { return lPrivateCompanies; } public List<PublicCompanyI> getAllPublicCompanies() { return lPublicCompanies; } public PublicCompanyI getCompanyByName(String name) { for (int i = 0; i < lPublicCompanies.size(); i++) { PublicCompany co = (PublicCompany) lPublicCompanies.get(i); if (name.equalsIgnoreCase(co.getName())) { return lPublicCompanies.get(i); } } return null; } public List<CompanyTypeI> getCompanyTypes() { return lCompanyTypes; } public CompanyI getCompany(String type, String name) { if (mCompaniesByTypeAndName.containsKey(type)) { return (mCompaniesByTypeAndName.get(type)).get(name); } else { return null; } } public void closeAllPrivates() { if (lPrivateCompanies == null) return; for (PrivateCompanyI priv : lPrivateCompanies) { priv.setClosed(); } } public List<PrivateCompanyI> getPrivatesOwnedByPlayers() { List<PrivateCompanyI> privatesOwnedByPlayers = new ArrayList<PrivateCompanyI>(); for (PrivateCompanyI priv : getAllPrivateCompanies()) { if (priv.getPortfolio().getOwner() instanceof Player) { privatesOwnedByPlayers.add(priv); } } return privatesOwnedByPlayers; } public StartPacket getStartPacket (int index) { return startPackets.get(index); } public StartPacket getStartPacket (String name) { return startPacketMap.get(name); } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import org.apache.log4j.Logger; import rails.util.LocalText; import rails.util.Tag; public class CompanyManager implements CompanyManagerI, ConfigurableComponentI { /** A List with all private companies */ private List<PrivateCompanyI> lPrivateCompanies = new ArrayList<PrivateCompanyI>(); /** A List with all public companies */ private List<PublicCompanyI> lPublicCompanies = new ArrayList<PublicCompanyI>(); /** A map with all private companies by name */ private Map<String, PrivateCompanyI> mPrivateCompanies = new HashMap<String, PrivateCompanyI>(); /** A map with all public (i.e. non-private) companies by name */ private Map<String, PublicCompanyI> mPublicCompanies = new HashMap<String, PublicCompanyI>(); /** A map of all type names to maps of companies of that type by name */ // TODO Redundant, current usage can be replaced. private Map<String, Map<String, CompanyI>> mCompaniesByTypeAndName = new HashMap<String, Map<String, CompanyI>>(); /** A list of all company types */ private List<CompanyTypeI> lCompanyTypes = new ArrayList<CompanyTypeI>(); /** A list of all start packets (usually one) */ private List<StartPacket> startPackets = new ArrayList<StartPacket>(); /** A map of all start packets, keyed by name. Default name is "Initial" */ private Map<String, StartPacket> startPacketMap = new HashMap<String, StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); protected GameManagerI gameManager; /* * NOTES: 1. we don't have a map over all companies, because some games have * duplicate names, e.g. B&O in 1830. 2. we have both a map and a list of * private/public companies to preserve configuration sequence while * allowing direct access. */ /** * No-args constructor. */ public CompanyManager() { // Nothing to do here, everything happens when configured. } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { gameManager = GameManager.getInstance(); /** A map with all company types, by type name */ // Localised here as it has no permanent use Map<String, CompanyTypeI> mCompanyTypes = new HashMap<String, CompanyTypeI>(); for (Tag compTypeTag : tag.getChildren(CompanyTypeI.ELEMENT_ID)) { // Extract the attributes of the Component String name = compTypeTag.getAttributeAsString(CompanyTypeI.NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompanyType")); } String className = compTypeTag.getAttributeAsString(CompanyTypeI.CLASS_TAG); if (className == null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeHasNoClass", name)); } if (mCompanyTypes.get(name) != null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeConfiguredTwice", name)); } CompanyTypeI companyType = new CompanyType(name, className); mCompanyTypes.put(name, companyType); lCompanyTypes.add(companyType); // Further parsing is done within CompanyType companyType.configureFromXML(compTypeTag); } /* Read and configure the companies */ for (Tag companyTag : tag.getChildren(CompanyI.COMPANY_ELEMENT_ID)) { // Extract the attributes of the Component String name = companyTag.getAttributeAsString(CompanyI.COMPANY_NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompany")); } String type = companyTag.getAttributeAsString(CompanyI.COMPANY_TYPE_TAG); if (type == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasNoType", name)); } CompanyTypeI cType = mCompanyTypes.get(type); if (cType == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasUnknownType", name, type )); } try { CompanyI company = cType.createCompany(name, companyTag); /* Private or public */ if (company instanceof PrivateCompanyI) { mPrivateCompanies.put(name, (PrivateCompanyI) company); lPrivateCompanies.add((PrivateCompanyI) company); } else if (company instanceof PublicCompanyI) { ((PublicCompanyI)company).setIndex (numberOfPublicCompanies++); mPublicCompanies.put(name, (PublicCompanyI) company); lPublicCompanies.add((PublicCompanyI) company); } /* By type and name */ if (!mCompaniesByTypeAndName.containsKey(type)) mCompaniesByTypeAndName.put(type, new HashMap<String, CompanyI>()); (mCompaniesByTypeAndName.get(type)).put( name, company); } catch (Exception e) { throw new ConfigurationException(LocalText.getText( "ClassCannotBeInstantiated", cType.getClassName()), e); } } /* Read and configure the start packets */ List<Tag> packetTags = tag.getChildren("StartPacket"); if (packetTags != null) { for (Tag packetTag : tag.getChildren("StartPacket")) { // Extract the attributes of the Component String name = packetTag.getAttributeAsString("name", StartPacket.DEFAULT_NAME); String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); startPacketMap.put(name, sp); sp.configureFromXML(packetTag); } } } // Post XML parsing initialisations public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.finishConfiguration(gameManager); } for (PrivateCompanyI comp : lPrivateCompanies) { comp.finishConfiguration(gameManager); } } /** * @see rails.game.CompanyManagerI#getCompany(java.lang.String) * */ public PrivateCompanyI getPrivateCompany(String name) { return mPrivateCompanies.get(name); } public PublicCompanyI getPublicCompany(String name) { return mPublicCompanies.get(name); } public List<PrivateCompanyI> getAllPrivateCompanies() { return lPrivateCompanies; } public List<PublicCompanyI> getAllPublicCompanies() { return lPublicCompanies; } public PublicCompanyI getCompanyByName(String name) { for (int i = 0; i < lPublicCompanies.size(); i++) { PublicCompany co = (PublicCompany) lPublicCompanies.get(i); if (name.equalsIgnoreCase(co.getName())) { return lPublicCompanies.get(i); } } return null; } public List<CompanyTypeI> getCompanyTypes() { return lCompanyTypes; } public CompanyI getCompany(String type, String name) { if (mCompaniesByTypeAndName.containsKey(type)) { return (mCompaniesByTypeAndName.get(type)).get(name); } else { return null; } } public void closeAllPrivates() { if (lPrivateCompanies == null) return; for (PrivateCompanyI priv : lPrivateCompanies) { if (priv.isCloseable()) // check if private is closeable priv.setClosed(); } } public List<PrivateCompanyI> getPrivatesOwnedByPlayers() { List<PrivateCompanyI> privatesOwnedByPlayers = new ArrayList<PrivateCompanyI>(); for (PrivateCompanyI priv : getAllPrivateCompanies()) { if (priv.getPortfolio().getOwner() instanceof Player) { privatesOwnedByPlayers.add(priv); } } return privatesOwnedByPlayers; } public StartPacket getStartPacket (int index) { return startPackets.get(index); } public StartPacket getStartPacket (String name) { return startPacketMap.get(name); } } \ No newline at end of file Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** PrivateCompany.java 6 Feb 2010 14:57:31 -0000 1.35 --- PrivateCompany.java 17 Feb 2010 22:02:52 -0000 1.36 *************** *** 217,221 **** if (isClosed()) return; ! if (!isCloseable()) return; /* sfy 1889 */ super.setClosed(); --- 217,221 ---- if (isClosed()) return; ! // if (!isCloseable()) return; /* moved hat to call in closeAllPrivates, to allow other closing actions */ super.setClosed(); |
From: Stefan F. <ste...@us...> - 2010-02-17 22:03:25
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17084/rails/game/correct Modified Files: OperatingCost.java CorrectionAction.java Added Files: ClosePrivate.java Log Message: Added noMap support for 1856 (includes ClosePrivate actions) some minor fixes to corrections --- NEW FILE: ClosePrivate.java --- package rails.game.correct; import java.io.IOException; import java.io.ObjectInputStream; import rails.game.*; import rails.game.action.PossibleAction; import rails.util.Util; /** * Correction action that allows the closure of a private company. */ public class ClosePrivate extends PossibleAction implements CorrectionAction { private static final long serialVersionUID = 1L; /* Preconditions */ /** shows in correction menu */ private boolean inCorrectionMenu; /** private company to close */ private PrivateCompanyI privateCompany; /** converted to name */ private String privateCompanyName; /* Postconditions: None */ public ClosePrivate(PrivateCompanyI priv) { privateCompany = priv; privateCompanyName = priv.getName(); } public boolean isInCorrectionMenu(){ return inCorrectionMenu; } public void setCorrectionMenu(boolean menu){ inCorrectionMenu = menu; } public PrivateCompanyI getPrivateCompany() { return privateCompany; } public String getPrivateCompanyName () { return privateCompanyName; } public String getInfo(){ return ("Close Private " + privateCompanyName); } @Override public boolean equals(PossibleAction action) { if (!(action instanceof ClosePrivate)) return false; ClosePrivate a = (ClosePrivate) action; return (a.privateCompany == this.privateCompany && a.inCorrectionMenu == this.inCorrectionMenu ); } @Override public String toString() { StringBuffer b = new StringBuffer("ClosePrivate"); if (!acted) { b.append(" (not acted)"); if (privateCompany != null) b.append(", privateCompany="+privateCompany); b.append(", inCorrectionMenu="+inCorrectionMenu); } else { b.append(" (acted)"); if (privateCompany != null) b.append(", privateCompany="+privateCompany); } return b.toString(); } /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (Util.hasValue(privateCompanyName)) privateCompany = getCompanyManager().getPrivateCompany(privateCompanyName); } } Index: CorrectionAction.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/CorrectionAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CorrectionAction.java 14 Feb 2010 20:48:15 -0000 1.1 --- CorrectionAction.java 17 Feb 2010 22:02:46 -0000 1.2 *************** *** 10,14 **** */ ! interface CorrectionAction { public boolean isInCorrectionMenu(); --- 10,14 ---- */ ! public interface CorrectionAction { public boolean isInCorrectionMenu(); Index: OperatingCost.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/OperatingCost.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OperatingCost.java 16 Feb 2010 20:17:09 -0000 1.2 --- OperatingCost.java 17 Feb 2010 22:02:45 -0000 1.3 *************** *** 9,14 **** /** ! * Correction action that changes the cash position of a cashholder. ! * * @author Stefan Frey */ --- 9,15 ---- /** ! * Correction action that mirrors operating actions like tile and token lays, but ! * only changes the cash position of a cashholder. ! * (Extends PossibleAction instead of PossibleORAction to allow for generalization) * @author Stefan Frey */ *************** *** 62,69 **** --- 63,72 ---- return inCorrectionMenu; } + public void setCorrectionMenu(boolean menu){ inCorrectionMenu = menu; } + public CashHolder getCashHolder() { return operatingCompany; *************** *** 74,78 **** } ! public int getAmount() { if (acted) return -operatingCost; --- 77,81 ---- } ! public int getAmount() { if (acted) return -operatingCost; |
From: Stefan F. <ste...@us...> - 2010-02-17 22:03:08
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17084/data Modified Files: GamesList.xml Log Message: Added noMap support for 1856 (includes ClosePrivate actions) some minor fixes to corrections Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GamesList.xml 17 Feb 2010 00:35:04 -0000 1.25 --- GamesList.xml 17 Feb 2010 22:02:58 -0000 1.26 *************** *** 72,75 **** --- 72,76 ---- - The restriction that shares cannot be sold in the same round that these are bought is not enforced. </Description> + <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedBonusTokens" type="toggle" default="no"/> <Option name="UnlimitedTiles" type="toggle" default="no"/> |
From: Erik V. <ev...@us...> - 2010-02-17 22:01:56
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16919/rails/game Modified Files: StartRound_1830.java StockRound.java StartRound_1835.java TreasuryShareRound.java Log Message: Added missing 2nd argument to "WrongPlayer" error messages Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TreasuryShareRound.java 31 Jan 2010 22:22:28 -0000 1.20 --- TreasuryShareRound.java 17 Feb 2010 22:01:44 -0000 1.21 *************** *** 261,265 **** // Only the player that has the turn may act if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 261,265 ---- // Only the player that has the turn may act if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, currentPlayer.getName()); break; } *************** *** 515,519 **** if (!playerName.equals(currentPlayer.getName())) { ! DisplayBuffer.add(LocalText.getText("WrongPlayer", playerName)); return false; } --- 515,519 ---- if (!playerName.equals(currentPlayer.getName())) { ! DisplayBuffer.add(LocalText.getText("WrongPlayer", playerName, currentPlayer.getName())); return false; } Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StartRound_1830.java 5 Feb 2010 19:57:26 -0000 1.30 --- StartRound_1830.java 17 Feb 2010 22:01:43 -0000 1.31 *************** *** 188,192 **** // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 188,192 ---- // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, player.getName()); break; } *************** *** 286,290 **** // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 286,290 ---- // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, player.getName()); break; } Index: StartRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1835.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** StartRound_1835.java 5 Feb 2010 19:58:18 -0000 1.24 --- StartRound_1835.java 17 Feb 2010 22:01:44 -0000 1.25 *************** *** 228,232 **** // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 228,232 ---- // Check player if (!playerName.equals(player.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, player.getName()); break; } Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** StockRound.java 16 Feb 2010 20:15:36 -0000 1.62 --- StockRound.java 17 Feb 2010 22:01:44 -0000 1.63 *************** *** 510,514 **** // Only the player that has the turn may buy if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 510,514 ---- // Only the player that has the turn may buy if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, currentPlayer.getName()); break; } *************** *** 655,659 **** // Only the player that has the turn may buy if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName); break; } --- 655,659 ---- // Only the player that has the turn may buy if (!playerName.equals(currentPlayer.getName())) { ! errMsg = LocalText.getText("WrongPlayer", playerName, currentPlayer.getName()); break; } *************** *** 1173,1177 **** if (!playerName.equals(currentPlayer.getName())) { ! DisplayBuffer.add(LocalText.getText("WrongPlayer", playerName)); return false; } --- 1173,1177 ---- if (!playerName.equals(currentPlayer.getName())) { ! DisplayBuffer.add(LocalText.getText("WrongPlayer", playerName, currentPlayer.getName())); return false; } |
From: Stefan F. <ste...@us...> - 2010-02-17 01:13:00
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11394/rails/ui/swing Modified Files: ORWindow.java Log Message: NoMapMode: Does not display the map (set to invisible). Index: ORWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORWindow.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ORWindow.java 31 Jan 2010 22:22:34 -0000 1.34 --- ORWindow.java 17 Feb 2010 00:21:33 -0000 1.35 *************** *** 80,84 **** setLocation(10, 10); setVisible(false); ! setSize(800, 600); final JFrame frame = this; --- 80,91 ---- setLocation(10, 10); setVisible(false); ! ! // make map and upgrade panels invisible for noMapMode ! if (gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.NO_MAP_MODE)) { ! mapPanel.setVisible(false); ! upgradePanel.setVisible(false); ! setSize(800, 500); ! } else ! setSize(800, 600); final JFrame frame = this; |
From: Stefan F. <ste...@us...> - 2010-02-17 01:12:54
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11394/rails/game Modified Files: GameManager.java Log Message: NoMapMode: Does not display the map (set to invisible). Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** GameManager.java 31 Jan 2010 22:22:28 -0000 1.82 --- GameManager.java 17 Feb 2010 00:22:15 -0000 1.83 *************** *** 491,494 **** --- 491,498 ---- } + + if (GameOption.convertValueToBoolean("NoMapMode", getGameOption("NoMapMode"))) + guiParameters.put(GuiDef.Parm.NO_MAP_MODE, true); + } |
From: Stefan F. <ste...@us...> - 2010-02-17 00:58:51
|
Update of /cvsroot/rails/18xx/rails/common In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11394/rails/common Modified Files: GuiDef.java Log Message: NoMapMode: Does not display the map (set to invisible). Index: GuiDef.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/common/GuiDef.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GuiDef.java 6 Feb 2010 23:48:26 -0000 1.3 --- GuiDef.java 17 Feb 2010 00:22:02 -0000 1.4 *************** *** 37,41 **** CAN_ANY_COMPANY_BUY_PRIVATES, DO_BONUS_TOKENS_EXIST, ! HAS_ANY_COMPANY_LOANS } --- 37,42 ---- CAN_ANY_COMPANY_BUY_PRIVATES, DO_BONUS_TOKENS_EXIST, ! HAS_ANY_COMPANY_LOANS, ! NO_MAP_MODE } |
From: Stefan F. <ste...@us...> - 2010-02-17 00:58:50
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13145/data/18EU Modified Files: Game.xml Log Message: NoMapMode default "no" for 1889 Added NoMapMode to 18EU Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Game.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Game.xml 31 Jan 2010 22:16:02 -0000 1.18 --- Game.xml 17 Feb 2010 00:34:52 -0000 1.19 *************** *** 5,8 **** --- 5,9 ---- <GameOption name="Extra3Trains" values="0,1,2" default="0"/> <GameOption name="Extra4Trains" values="0,1" default="0"/> + <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> <GameParameters> |
From: Stefan F. <ste...@us...> - 2010-02-17 00:58:49
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13145/data Modified Files: GamesList.xml Log Message: NoMapMode default "no" for 1889 Added NoMapMode to 18EU Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GamesList.xml 14 Feb 2010 20:48:15 -0000 1.24 --- GamesList.xml 17 Feb 2010 00:35:04 -0000 1.25 *************** *** 103,107 **** </Description> <Players minimum="2" maximum="6"/> ! <Option name="NoMapMode" type="toggle" default="yes" /> <Option name="BeginnerGame" type="toggle" default="no" /> <Option name="WithOptional6Train" type="toggle" default="no"/> --- 103,107 ---- </Description> <Players minimum="2" maximum="6"/> ! <Option name="NoMapMode" type="toggle" default="no" /> <Option name="BeginnerGame" type="toggle" default="no" /> <Option name="WithOptional6Train" type="toggle" default="no"/> *************** *** 137,140 **** --- 137,141 ---- <Option name="Extra3Trains" values="0,1,2" default="0"/> <Option name="Extra4Trains" values="0,1" default="0"/> + <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> <Players minimum="2" maximum="6"/> |
From: Stefan F. <ste...@us...> - 2010-02-17 00:58:48
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13145/data/1889 Modified Files: Game.xml Log Message: NoMapMode default "no" for 1889 Added NoMapMode to 18EU Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Game.xml 14 Feb 2010 20:47:29 -0000 1.5 --- Game.xml 17 Feb 2010 00:34:52 -0000 1.6 *************** *** 16,20 **** See GamesList.xml for the real ones. --> ! <GameOption name="NoMapMode" type="toggle" default="yes" /> <GameOption name="BeginnerGame" type="toggle" default="no" /> <GameOption name="WithOptional6Train" type="toggle" default="no"/> --- 16,20 ---- See GamesList.xml for the real ones. --> ! <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="BeginnerGame" type="toggle" default="no" /> <GameOption name="WithOptional6Train" type="toggle" default="no"/> |
From: Erik V. <ev...@us...> - 2010-02-16 20:25:46
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32693/rails/game/specific/_1835 Added Files: GameManager_1835.java PrussianFormationRound.java Log Message: New 1835 stuff --- NEW FILE: PrussianFormationRound.java --- package rails.game.specific._1835; import java.util.List; import rails.common.GuiDef; import rails.game.*; import rails.game.action.MergeCompanies; import rails.game.action.NullAction; import rails.game.action.StartCompany; import rails.util.LocalText; public class PrussianFormationRound extends StockRound { private PublicCompanyI prussian; private PhaseI phase; private boolean startPr; private boolean forcedStart; private boolean mergePr; private boolean forcedMerge; private enum Step { START, MERGE }; Step step; public static String PR_ID = "Pr"; public static String M2_ID = "M2"; public PrussianFormationRound (GameManagerI gameManager) { super (gameManager); guiHints.setVisibilityHint(GuiDef.Panel.MAP, true); guiHints.setVisibilityHint(GuiDef.Panel.STATUS, true); } public void start() { prussian = companyManager.getCompanyByName(PR_ID); phase = getCurrentPhase(); startPr = !prussian.hasStarted(); forcedStart = phase.getName().equals("4+4"); mergePr = !prussianIsComplete(gameManager); forcedMerge = phase.getName().equals("5"); ReportBuffer.add(LocalText.getText("StartFormationRound", PR_ID)); log.debug("StartPr="+startPr+" forcedStart="+forcedStart +" mergePr="+mergePr+" forcedMerge="+forcedMerge); step = startPr ? Step.START : Step.MERGE; } public boolean setPossibleActions() { if (step == Step.START) { PublicCompanyI m2 = companyManager.getCompanyByName(M2_ID); Player m2Owner = m2.getPresident(); setCurrentPlayer(m2Owner); ReportBuffer.add(LocalText.getText("StartingPlayer", getCurrentPlayer().getName())); possibleActions.add(new MergeCompanies(m2, prussian)); if (!forcedStart) { possibleActions.add(new NullAction(NullAction.PASS)); } } return true; } public static boolean prussianIsComplete(GameManagerI gameManager) { List<PublicCertificateI> unissued = gameManager.getBank().getUnavailable().getCertificatesPerCompany(PR_ID); return unissued == null || unissued.isEmpty(); } @Override public String toString() { return "1835 PrussianFormationRound"; } } --- NEW FILE: GameManager_1835.java --- /* $Header: /cvsroot/rails/18xx/rails/game/specific/_1835/GameManager_1835.java,v 1.1 2010/02/16 20:25:38 evos Exp $ */ package rails.game.specific._1835; import rails.game.*; public class GameManager_1835 extends GameManager { public static String PR_NAME = PrussianFormationRound.PR_ID; private RoundI previousRound; public GameManager_1835() { super(); } @Override public void nextRound(RoundI round) { if (!(round instanceof PrussianFormationRound)) { PhaseI phase = getCurrentPhase(); if (phase.getName().equals("4") || phase.getName().equals("4+4") || phase.getName().equals("5")) { if (!PrussianFormationRound.prussianIsComplete(this)) { previousRound = round; startPrussianFormationRound (); return; } } } super.nextRound(round); } private void startPrussianFormationRound() { createRound (PrussianFormationRound.class).start (); } } |
From: Erik V. <ev...@us...> - 2010-02-16 20:22:07
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31501/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Minor cleanup Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** GUIHex.java 8 Feb 2010 21:24:01 -0000 1.37 --- GUIHex.java 16 Feb 2010 20:21:59 -0000 1.38 *************** *** 327,337 **** City city; Point p; ! homes: for (PublicCompanyI company : homes.keySet()) { if (company.isClosed()) continue; - city = homes.get(company); // Only draw the company name if there isn't yet a token of that company ! if (model.hasTokenOfCompany(company)) continue homes; p = getTokenCenter (1, 0, getHexModel().getCities().size(), city.getNumber()-1); --- 327,337 ---- City city; Point p; ! for (PublicCompanyI company : homes.keySet()) { if (company.isClosed()) continue; // Only draw the company name if there isn't yet a token of that company ! if (model.hasTokenOfCompany(company)) continue; + city = homes.get(company); p = getTokenCenter (1, 0, getHexModel().getCities().size(), city.getNumber()-1); |
From: Erik V. <ev...@us...> - 2010-02-16 20:20:32
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30456/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Minor cleanup Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** StockRound_18EU.java 31 Jan 2010 22:22:33 -0000 1.35 --- StockRound_18EU.java 16 Feb 2010 20:20:24 -0000 1.36 *************** *** 73,77 **** Portfolio from; int price; - int number; // 18EU special: until phase 5, we can only --- 73,76 ---- |
From: Erik V. <ev...@us...> - 2010-02-16 20:19:58
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30179/rails/game/specific/_1856 Modified Files: CGRFormationRound.java Log Message: Split start round and starting player messages Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CGRFormationRound.java 31 Jan 2010 22:22:32 -0000 1.32 --- CGRFormationRound.java 16 Feb 2010 20:19:47 -0000 1.33 *************** *** 66,71 **** ReportBuffer.add(LocalText.getText("StartFormationRound", ! cgrName, ! startingPlayer.getName())); guiHints.setCurrentRoundType(getClass()); --- 66,71 ---- ReportBuffer.add(LocalText.getText("StartFormationRound", ! cgrName)); ! ReportBuffer.add(LocalText.getText("StartingPlayer", startingPlayer.getName())); guiHints.setCurrentRoundType(getClass()); |