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-30 10:42:50
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data Modified Files: GamesList.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** GamesList.xml 26 May 2010 19:48:57 -0000 1.37 --- GamesList.xml 30 May 2010 10:42:39 -0000 1.38 *************** *** 23,26 **** --- 23,28 ---- --> <Option name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="WithOptional6Train" type="toggle" default="no"/> *************** *** 29,33 **** <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> ! <Players minimum="3" maximum="6"/> </Game> --- 31,35 ---- <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> ! <Players minimum="2" maximum="6"/> </Game> *************** *** 40,43 **** --- 42,47 ---- - No random assignment of private companies (players should do this off-line and enter the result) </Description> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> *************** *** 55,59 **** - 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"/> --- 59,65 ---- - The restriction that shares cannot be sold in the same round that these are bought is not enforced. </Description> ! <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> ! <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> ! <!-- <Option name="NoMapMode" type="toggle" default="no" /> --> <Option name="UnlimitedBonusTokens" type="toggle" default="no"/> <Option name="UnlimitedTiles" type="toggle" default="no"/> *************** *** 72,75 **** --- 78,83 ---- </Description> <Players minimum="2" maximum="6"/> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="BeginnerGame" type="toggle" default="no" /> *************** *** 90,93 **** --- 98,103 ---- - Privates cannot be traded between players. </Description> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name ="18ALOptimizeNamedTrains" type="toggle" default="yes"/> <Option name="UnlimitedTopTrains" parm="4D" type="toggle" default="no"/> *************** *** 108,111 **** --- 118,123 ---- - Bankruptcy rules (game currently hangs when a player goes bankrupt) </Description> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="Extra3Trains" values="0,1,2" default="0"/> <Option name="Extra4Trains" values="0,1" default="0"/> *************** *** 122,126 **** 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"/> --- 134,140 ---- Should work, but has not been extensively tested. Limitations as with 1830. </Description> ! <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> ! <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> ! <Option name="18KaasRuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="WithOptional6Train" type="toggle" default="no"/> *************** *** 149,152 **** --- 163,168 ---- </Description> <Option name="Variant" values="Standard,Clemens,Snake"/> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> *************** *** 165,168 **** --- 181,186 ---- Aspects not present in 1830 have not been implemented yet. </Description> + <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> + <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> *************** *** 179,184 **** - No random assignment of private companies (players should do this off-line and enter the result) </Description> ! <Players minimum="3" maximum="5" /><Option name="UnlimitedTiles" type="toggle" default="no"> ! </Option> </Game> --- 197,204 ---- - No random assignment of private companies (players should do this off-line and enter the result) </Description> ! <Players minimum="3" maximum="5" /> ! <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> ! <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> ! <Option name="UnlimitedTiles" type="toggle" default="no"/> </Game> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:49
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/18AL Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/Game.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Game.xml 26 May 2010 19:48:57 -0000 1.33 --- Game.xml 30 May 2010 10:42:39 -0000 1.34 *************** *** 3,6 **** --- 3,8 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="18AL"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name ="18ALOptimizeNamedTrains" default="no"/> <GameOption name="UnlimitedTopTrains" parm="4D" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:49
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1835 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Game.xml 8 May 2010 14:23:21 -0000 1.32 --- Game.xml 30 May 2010 10:42:39 -0000 1.33 *************** *** 5,8 **** --- 5,10 ---- <Game name="1835"/> <GameOption name="Variant" values="Standard,Clemens,Snake"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:49
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/18EU Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Game.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Game.xml 23 May 2010 18:10:44 -0000 1.24 --- Game.xml 30 May 2010 10:42:39 -0000 1.25 *************** *** 3,6 **** --- 3,8 ---- <Component name="GameManager" class="rails.game.specific._18EU.GameManager_18EU"> <Game name="18EU"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="Extra3Trains" values="0,1,2" default="0"/> <GameOption name="Extra4Trains" values="0,1" default="0"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:48
|
Update of /cvsroot/rails/18xx/rails/common In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/rails/common Modified Files: GuiDef.java Log Message: Added GameOptions for revenue calculation and route awareness Index: GuiDef.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/common/GuiDef.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GuiDef.java 17 Feb 2010 00:22:02 -0000 1.4 --- GuiDef.java 30 May 2010 10:42:39 -0000 1.5 *************** *** 38,42 **** DO_BONUS_TOKENS_EXIST, HAS_ANY_COMPANY_LOANS, ! NO_MAP_MODE } --- 38,44 ---- DO_BONUS_TOKENS_EXIST, HAS_ANY_COMPANY_LOANS, ! NO_MAP_MODE, ! REVENUE_SUGGEST, ! ROUTE_HIGHLIGHT } |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1851 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1851 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1851/Game.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Game.xml 24 May 2010 07:49:27 -0000 1.17 --- Game.xml 30 May 2010 10:42:39 -0000 1.18 *************** *** 3,6 **** --- 3,8 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="1851"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1889 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Game.xml 18 May 2010 04:13:03 -0000 1.10 --- Game.xml 30 May 2010 10:42:38 -0000 1.11 *************** *** 16,19 **** --- 16,21 ---- See GamesList.xml for the real ones. --> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="BeginnerGame" type="toggle" default="no" /> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1825 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1825 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1825/Game.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Game.xml 11 Mar 2010 23:20:26 -0000 1.1 --- Game.xml 30 May 2010 10:42:39 -0000 1.2 *************** *** 13,16 **** --- 13,18 ---- in a dropdown the first item is always the default). --> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <PlayerShareLimit percentage="100"/> <BankPoolLimit percentage="100"></BankPoolLimit> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/18Kaas In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/18Kaas Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/Game.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Game.xml 23 May 2010 18:10:44 -0000 1.16 --- Game.xml 30 May 2010 10:42:39 -0000 1.17 *************** *** 3,6 **** --- 3,8 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="18Kaas"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="RuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> <GameOption name="NoMapMode" type="toggle" default="no" /> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1830 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1830 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/Game.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Game.xml 18 May 2010 04:13:03 -0000 1.36 --- Game.xml 30 May 2010 10:42:39 -0000 1.37 *************** *** 18,22 **** <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> <GameOption name="NoMapMode" type="toggle" default="no" /> ! <GameOption name="BeginnerGame" type="toggle" default="no" /> <GameOption name="WithOptional6Train" type="toggle" default="no"/> <GameOption name="UnlimitedTopTrains" parm="D" type="toggle" default="no"/> --- 18,24 ---- <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> <GameOption name="NoMapMode" type="toggle" default="no" /> ! <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> ! <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> ! <GameOption name="BeginnerGame" type="toggle" default="no" /> <GameOption name="WithOptional6Train" type="toggle" default="no"/> <GameOption name="UnlimitedTopTrains" parm="D" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/rails/ui/swing Modified Files: UpgradesPanel.java ORUIManager.java ORPanel.java Log Message: Added GameOptions for revenue calculation and route awareness Index: UpgradesPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/UpgradesPanel.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** UpgradesPanel.java 29 May 2010 23:33:43 -0000 1.27 --- UpgradesPanel.java 30 May 2010 10:42:39 -0000 1.28 *************** *** 498,502 **** text.append("<HTML><BODY>" + tile.getExternalId()); if (tile.countFreeTiles() != -1) { ! text.append("<BR/>#" + tile.countFreeTiles()); } text.append("</BODY></HTML>"); --- 498,502 ---- text.append("<HTML><BODY>" + tile.getExternalId()); if (tile.countFreeTiles() != -1) { ! text.append("<BR> #" + tile.countFreeTiles()); } text.append("</BODY></HTML>"); Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** ORUIManager.java 29 May 2010 23:33:43 -0000 1.77 --- ORUIManager.java 30 May 2010 10:42:39 -0000 1.78 *************** *** 10,13 **** --- 10,14 ---- import rails.algorithms.*; + import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 198,231 **** boolean mapHexes = false; hexUpgrades = new ArrayList<MapHex>(); ! for (LayTile layTile:allowedTileLays) { ! switch (layTile.getType()) { ! case (LayTile.GENERIC): ! mapHexes = true; break; ! case (LayTile.SPECIAL_PROPERTY): ! SpecialPropertyI sp = layTile.getSpecialProperty(); if (sp == null || !(sp instanceof SpecialTileLay) || ((SpecialTileLay)sp).requiresConnection()) break; ! case (LayTile.LOCATION_SPECIFIC): ! if (layTile.getLocations() != null) ! hexUpgrades.addAll(layTile.getLocations()); } - } ! // standard upgrades ! if (mapHexes) { ! // generate network graph to indicate the allowed tiles ! List<MapHex> mapHexUpgrades = NetworkGraphBuilder.getMapHexes(getCompanyGraph()); ! for (MapHex hex:mapHexUpgrades) { ! if (hex.isUpgradeableNow(gameUIManager.getCurrentPhase())) ! hexUpgrades.add(hex); } - } ! // activate upgrades ! for (MapHex hex:hexUpgrades) { ! GUIHex guiHex = map.getHexByName(hex.getName()); ! guiHex.setSelectable(true); } } --- 199,236 ---- boolean mapHexes = false; hexUpgrades = new ArrayList<MapHex>(); ! ! if (gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.ROUTE_HIGHLIGHT)) { ! for (LayTile layTile:allowedTileLays) { ! switch (layTile.getType()) { ! case (LayTile.GENERIC): ! mapHexes = true; break; ! case (LayTile.SPECIAL_PROPERTY): ! SpecialPropertyI sp = layTile.getSpecialProperty(); if (sp == null || !(sp instanceof SpecialTileLay) || ((SpecialTileLay)sp).requiresConnection()) break; ! case (LayTile.LOCATION_SPECIFIC): ! if (layTile.getLocations() != null) ! hexUpgrades.addAll(layTile.getLocations()); ! } } ! // standard upgrades ! if (mapHexes) { ! // generate network graph to indicate the allowed tiles ! List<MapHex> mapHexUpgrades = NetworkGraphBuilder.getMapHexes(getCompanyGraph()); ! for (MapHex hex:mapHexUpgrades) { ! if (hex.isUpgradeableNow(gameUIManager.getCurrentPhase())) ! hexUpgrades.add(hex); ! } } ! // activate upgrades ! for (MapHex hex:hexUpgrades) { ! GUIHex guiHex = map.getHexByName(hex.getName()); ! guiHex.setSelectable(true); ! } ! } } *************** *** 245,267 **** boolean mapHexes = false; hexUpgrades = new ArrayList<MapHex>(); ! for (LayToken layToken:allowedTokenLays) { ! SpecialPropertyI sp = layToken.getSpecialProperty(); ! if (sp == null) { ! mapHexes = true; ! } else if (layToken.getLocations() != null) ! hexUpgrades.addAll(layToken.getLocations()); ! } - // standard tokens - if (mapHexes) { - // generate network graph to indicate the token lays - hexUpgrades = NetworkGraphBuilder.getStationHexes(getCompanyGraph(), orComp); for (LayToken layToken:allowedTokenLays) { ! if (layToken.getLocations() != null) hexUpgrades.addAll(layToken.getLocations()); } ! for (MapHex hex:hexUpgrades) { ! GUIHex guiHex = map.getHexByName(hex.getName()); ! guiHex.setSelectable(true); } } --- 250,275 ---- boolean mapHexes = false; hexUpgrades = new ArrayList<MapHex>(); ! if (gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.ROUTE_HIGHLIGHT)) { for (LayToken layToken:allowedTokenLays) { ! SpecialPropertyI sp = layToken.getSpecialProperty(); ! if (sp == null) { ! mapHexes = true; ! } else if (layToken.getLocations() != null) hexUpgrades.addAll(layToken.getLocations()); } ! ! // standard tokens ! if (mapHexes) { ! // generate network graph to indicate the token lays ! hexUpgrades = NetworkGraphBuilder.getStationHexes(getCompanyGraph(), orComp); ! for (LayToken layToken:allowedTokenLays) { ! if (layToken.getLocations() != null) ! hexUpgrades.addAll(layToken.getLocations()); ! } ! for (MapHex hex:hexUpgrades) { ! GUIHex guiHex = map.getHexByName(hex.getName()); ! guiHex.setSelectable(true); ! } } } Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** ORPanel.java 24 May 2010 11:42:35 -0000 1.69 --- ORPanel.java 30 May 2010 10:42:39 -0000 1.70 *************** *** 567,599 **** protected void addNetworkInfo() { - CompanyManagerI cm = orUIManager.getGameUIManager().getGameManager().getCompanyManager(); JMenu networkMenu = new JMenu(LocalText.getText("NetworkInfo")); networkMenu.setEnabled(true); infoMenu.add(networkMenu); ! JMenuItem item = new JMenuItem("All"); ! item.addActionListener(this); ! item.setActionCommand(NETWORK_INFO_CMD); ! networkMenu.add(item); ! ! for (PublicCompanyI comp : cm.getAllPublicCompanies()) { ! if (!comp.hasFloated() || comp.isClosed()) continue; ! item = new JMenuItem(comp.getName()); item.addActionListener(this); item.setActionCommand(NETWORK_INFO_CMD); networkMenu.add(item); } } protected void executeNetworkInfo(String companyName) { GameManagerI gm = orUIManager.getGameUIManager().getGameManager(); - MapManager mapManager = gm.getMapManager(); ! if (companyName.equals("All")) { NetworkGraphBuilder nwGraph = NetworkGraphBuilder.createMapGraph(gm); SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = nwGraph.getMapGraph(); ! NetworkGraphBuilder.visualize(mapGraph, "Map Network"); mapGraph = NetworkGraphBuilder.optimizeGraph(mapGraph); NetworkGraphBuilder.visualize(mapGraph, "Optimized Map Network"); --- 567,607 ---- protected void addNetworkInfo() { + boolean route_highlight = orUIManager.gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.ROUTE_HIGHLIGHT); + boolean revenue_suggest = orUIManager.gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.REVENUE_SUGGEST); + + if (!route_highlight && !revenue_suggest) return; + JMenu networkMenu = new JMenu(LocalText.getText("NetworkInfo")); networkMenu.setEnabled(true); infoMenu.add(networkMenu); ! if (route_highlight) { ! JMenuItem item = new JMenuItem("Network"); item.addActionListener(this); item.setActionCommand(NETWORK_INFO_CMD); networkMenu.add(item); } + + if (revenue_suggest) { + CompanyManagerI cm = orUIManager.getGameUIManager().getGameManager().getCompanyManager(); + for (PublicCompanyI comp : cm.getAllPublicCompanies()) { + if (!comp.hasFloated() || comp.isClosed()) continue; + JMenuItem item = new JMenuItem(comp.getName()); + item.addActionListener(this); + item.setActionCommand(NETWORK_INFO_CMD); + networkMenu.add(item); + } + } } protected void executeNetworkInfo(String companyName) { GameManagerI gm = orUIManager.getGameUIManager().getGameManager(); ! if (companyName.equals("Network")) { NetworkGraphBuilder nwGraph = NetworkGraphBuilder.createMapGraph(gm); SimpleGraph<NetworkVertex, NetworkEdge> mapGraph = nwGraph.getMapGraph(); ! // NetworkGraphBuilder.visualize(mapGraph, "Map Network"); mapGraph = NetworkGraphBuilder.optimizeGraph(mapGraph); NetworkGraphBuilder.visualize(mapGraph, "Optimized Map Network"); *************** *** 777,783 **** // initialize and start the revenue adapter ! revenueAdapter = initRevenueCalculation(orComp); ! revenueThread = new Thread(revenueAdapter); ! revenueThread.start(); } --- 785,793 ---- // initialize and start the revenue adapter ! if (orUIManager.gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.REVENUE_SUGGEST)) { ! revenueAdapter = initRevenueCalculation(orComp); ! revenueThread = new Thread(revenueAdapter); ! revenueThread.start(); ! } } |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1870 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1870 Modified Files: Game.xml CompanyManager.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1870/CompanyManager.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CompanyManager.xml 1 May 2010 16:12:48 -0000 1.26 --- CompanyManager.xml 30 May 2010 10:42:39 -0000 1.27 *************** *** 28,34 **** <Company name="Brdg" type="Private" basePrice="40" revenue="10" ! longname="Mississippi River Bridge Company" /> ! ! <Company name="Cattl" type="Private" tokens="1" basePrice="50" revenue="10" longname="The Southern Cattle Company" /> --- 28,36 ---- <Company name="Brdg" type="Private" basePrice="40" revenue="10" ! longname="Mississippi River Bridge Company" > ! <ClosingConditions><CloseManually/></ClosingConditions> ! </Company> ! ! <Company name="Cattl" type="Private" tokens="1" basePrice="50" revenue="10" longname="The Southern Cattle Company" /> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1870/Game.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Game.xml 31 Jan 2010 22:15:59 -0000 1.26 --- Game.xml 30 May 2010 10:42:39 -0000 1.27 *************** *** 3,6 **** --- 3,8 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="1870"/> + <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> + <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> <GameOption name="LeaveAuctionOnPass" type="toggle" default="no"/> |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/data/1856 Modified Files: Game.xml Log Message: Added GameOptions for revenue calculation and route awareness Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/Game.xml,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Game.xml 18 May 2010 21:36:12 -0000 1.39 --- Game.xml 30 May 2010 10:42:39 -0000 1.40 *************** *** 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"/> --- 3,9 ---- <Component name="GameManager" class="rails.game.specific._1856.GameManager_1856"> <Game name="1856"/> ! <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> ! <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> ! <!-- <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-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18Kaas In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/rails/game/specific/_18Kaas Modified Files: RuhrRevenueModifier.java Log Message: Added GameOptions for revenue calculation and route awareness Index: RuhrRevenueModifier.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18Kaas/RuhrRevenueModifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RuhrRevenueModifier.java 24 May 2010 07:49:26 -0000 1.2 --- RuhrRevenueModifier.java 30 May 2010 10:42:39 -0000 1.3 *************** *** 28,32 **** public void finishConfiguration(GameManagerI parent) throws ConfigurationException { ! doublesOnlyMajors = parent.getGameOption("RuhrgebiedDoublesOnlyMajors").equalsIgnoreCase("yes"); log.debug("Finish configuration of RuhrRevenueModifier, doublesOnlyMajors = " + doublesOnlyMajors); } --- 28,32 ---- public void finishConfiguration(GameManagerI parent) throws ConfigurationException { ! doublesOnlyMajors = parent.getGameOption("18KaasRuhrgebiedDoublesOnlyMajors").equalsIgnoreCase("yes"); log.debug("Finish configuration of RuhrRevenueModifier, doublesOnlyMajors = " + doublesOnlyMajors); } |
From: Stefan F. <ste...@us...> - 2010-05-30 10:42:47
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15333/rails/game Modified Files: GameManager.java Log Message: Added GameOptions for revenue calculation and route awareness Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** GameManager.java 18 May 2010 22:07:18 -0000 1.103 --- GameManager.java 30 May 2010 10:42:39 -0000 1.104 *************** *** 509,514 **** --- 509,521 ---- } + // define guiParameters from gameOptions if (GameOption.convertValueToBoolean(getGameOption("NoMapMode"))) guiParameters.put(GuiDef.Parm.NO_MAP_MODE, true); + + if (getGameOption("RouteAwareness").equalsIgnoreCase("Highlight")) + guiParameters.put(GuiDef.Parm.ROUTE_HIGHLIGHT, true); + + if (getGameOption("RevenueCalculation").equalsIgnoreCase("Suggest")) + guiParameters.put(GuiDef.Parm.REVENUE_SUGGEST, true); } *************** *** 1328,1332 **** public String getGameOption (String key) { ! return gameOptions.get(key); } --- 1335,1344 ---- public String getGameOption (String key) { ! // check the System properties for overwrites first ! if (Util.hasValue(System.getProperty(key))) { ! return System.getProperty(key); ! } else { ! return gameOptions.get(key); ! } } |
From: Stefan F. <ste...@us...> - 2010-05-29 23:33:51
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13817/rails/ui/swing Modified Files: UpgradesPanel.java ORUIManager.java Log Message: Updated and slightly restricted map correction functionality Index: UpgradesPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/UpgradesPanel.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** UpgradesPanel.java 29 May 2010 09:38:58 -0000 1.26 --- UpgradesPanel.java 29 May 2010 23:33:43 -0000 1.27 *************** *** 16,20 **** import rails.game.*; import rails.game.action.*; - import rails.game.correct.CorrectionAction; import rails.game.correct.MapCorrectionAction; import rails.ui.swing.elements.ActionLabel; --- 16,19 ---- *************** *** 28,31 **** --- 27,31 ---- private ORUIManager orUIManager; private List<ActionLabel> tokenLabels; + private List<CorrectionTokenLabel> correctionTokenLabels; private int selectedTokenIndex; private List<LayToken> possibleTokenLays = new ArrayList<LayToken>(3); *************** *** 42,45 **** --- 42,46 ---- private final String INIT_DONE_TEXT = "LayTile"; private boolean tokenMode = false; + private boolean correctionTokenMode = false; private JButton cancelButton = new JButton(LocalText.getText(INIT_CANCEL_TEXT)); *************** *** 173,177 **** HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! hexLabel.setText("<HTML><BODY>" + tile.getExternalId() + "<BR/>#" + tile.countFreeTiles() + "</BODY></HTML>"); hexLabel.setOpaque(true); hexLabel.setVisible(true); --- 174,178 ---- HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! hexLabel.setTextFromTile(tile); hexLabel.setOpaque(true); hexLabel.setVisible(true); *************** *** 192,195 **** --- 193,201 ---- // populate version for corrections public void showCorrectionTileUpgrades() { + // deactivate correctionTokenMode and tokenmode + correctionTokenMode = false; + tokenMode = false; + + // activate upgrade panel upgradePanel.removeAll(); GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); *************** *** 217,224 **** HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! if (tile.getExternalId() > 0) ! hexLabel.setText("<HTML><BODY>" + tile.getExternalId() + "<BR/>#" + tile.countFreeTiles() + "</BODY></HTML>"); ! else ! hexLabel.setText(""); hexLabel.setOpaque(true); hexLabel.setVisible(true); --- 223,227 ---- HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! hexLabel.setTextFromTile(tile); hexLabel.setOpaque(true); hexLabel.setVisible(true); *************** *** 238,242 **** // populate version for corrections ! public void showCorrectionTokenUpgrades() { upgradePanel.removeAll(); GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); --- 241,250 ---- // populate version for corrections ! public void showCorrectionTokenUpgrades(MapCorrectionAction action) { ! // activate correctionTokenMode and deactivate standard tokenMode ! correctionTokenMode = true; ! tokenMode = false; ! ! // activate upgrade panel upgradePanel.removeAll(); GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); *************** *** 254,259 **** String description = null; TokenIcon icon; ! ActionLabel tokenLabel; ! tokenLabels = new ArrayList<ActionLabel>(); for (TokenI token:tokens) { if (token instanceof BaseToken) { --- 262,267 ---- String description = null; TokenIcon icon; ! CorrectionTokenLabel tokenLabel; ! correctionTokenLabels = new ArrayList<CorrectionTokenLabel>(); for (TokenI token:tokens) { if (token instanceof BaseToken) { *************** *** 264,268 **** } icon = new TokenIcon(25, fgColour, bgColour, text); ! tokenLabel = new ActionLabel(icon); tokenLabel.setName(description); tokenLabel.setText(description); --- 272,276 ---- } icon = new TokenIcon(25, fgColour, bgColour, text); ! tokenLabel = new CorrectionTokenLabel(icon, token); tokenLabel.setName(description); tokenLabel.setText(description); *************** *** 272,276 **** tokenLabel.setBorder(border); tokenLabel.addMouseListener(this); ! tokenLabels.add(tokenLabel); upgradePanel.add(tokenLabel); } --- 280,285 ---- tokenLabel.setBorder(border); tokenLabel.addMouseListener(this); ! tokenLabel.addPossibleAction(action); ! correctionTokenLabels.add(tokenLabel); upgradePanel.add(tokenLabel); } *************** *** 307,310 **** --- 316,328 ---- } + private void setSelectedCorrectionToken() { + if (correctionTokenLabels == null || correctionTokenLabels.isEmpty()) return; + int index = -1; + for (CorrectionTokenLabel tokenLabel : correctionTokenLabels) { + tokenLabel.setBackground(++index == selectedTokenIndex + ? selectedLabelBgColour : defaultLabelBgColour); + } + } + private BufferedImage getHexImage(int tileId) { return GameUIManager.getImageLoader().getTile(tileId, 10); *************** *** 387,390 **** --- 405,412 ---- } setSelectedToken(); + } else if (correctionTokenMode) { + int id = correctionTokenLabels.indexOf(source); + selectedTokenIndex = id; + log.info("Correction Token index = " + selectedTokenIndex + " selected"); } else { *************** *** 400,404 **** if (!(source instanceof JLabel)) return; ! if (!tokenMode) { // tile mode HexLabel tile = (HexLabel) e.getSource(); --- 422,426 ---- if (!(source instanceof JLabel)) return; ! if (!tokenMode && !correctionTokenMode) { // tile mode HexLabel tile = (HexLabel) e.getSource(); *************** *** 414,418 **** if (!(source instanceof JLabel)) return; ! if (!tokenMode) { // tile mode HexLabel tile = (HexLabel) e.getSource(); --- 436,440 ---- if (!(source instanceof JLabel)) return; ! if (!tokenMode && !correctionTokenMode) { // tile mode HexLabel tile = (HexLabel) e.getSource(); *************** *** 430,433 **** --- 452,474 ---- } + + /** ActionLabel extension that allows to attach the token */ + private class CorrectionTokenLabel extends ActionLabel { + + private static final long serialVersionUID = 1L; + + private TokenI token; + + CorrectionTokenLabel(Icon tokenIcon, TokenI token) { + super(tokenIcon); + this.token = token; + } + + TokenI getToken() { + return token; + } + + } + /** JLabel extension to allow attaching the internal hex ID */ private class HexLabel extends JLabel { *************** *** 451,454 **** --- 492,507 ---- return toolTip; } + + void setTextFromTile(TileI tile) { + StringBuffer text = new StringBuffer(); + if (tile.getExternalId() > 0) { + text.append("<HTML><BODY>" + tile.getExternalId()); + if (tile.countFreeTiles() != -1) { + text.append("<BR/>#" + tile.countFreeTiles()); + } + text.append("</BODY></HTML>"); + } + this.setText(text.toString()); + } protected void setToolTip() { Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ORUIManager.java 29 May 2010 09:38:58 -0000 1.76 --- ORUIManager.java 29 May 2010 23:33:43 -0000 1.77 *************** *** 13,16 **** --- 13,17 ---- import rails.game.action.*; import rails.game.correct.*; + import rails.game.correct.MapCorrectionManager.ActionStep; import rails.game.special.*; import rails.ui.swing.elements.*; *************** *** 879,882 **** --- 880,917 ---- } + private Station correctionRelayBaseToken(BaseToken token, List<Station> possibleStations){ + GUIHex selectedHex = map.getSelectedHex(); + + PublicCompanyI company = token.getCompany(); + List<String> prompts = new ArrayList<String>(); + + Map<String, Station> promptToStationMap = new HashMap<String, Station>(); + String prompt; + for (Station station:possibleStations) { + prompt = LocalText.getText( + "SelectStationForTokenOption", + station.getNumber(), + ((MapHex) selectedHex.getModel()).getConnectionString( + selectedHex.getProvisionalTile(), + selectedHex.getProvisionalTileRotation(), + station.getNumber())) ; + prompts.add(prompt); + promptToStationMap.put(prompt, station); + } + String selected = + (String) JOptionPane.showInputDialog(orWindow, + LocalText.getText("SelectStationForToken", + "", + selectedHex.getName(), + company.getName()), + LocalText.getText("WhichStation"), + JOptionPane.PLAIN_MESSAGE, null, + prompts.toArray(), prompts.get(0)); + if (selected == null) return null; + Station station = promptToStationMap.get(selected); + return station; + } + + /** * Lay Token finished. *************** *** 1210,1214 **** if (mapCorrectionEnabled) { if (selectedHex != null && selectedHex.getProvisionalTile() != null) { ! mapCorrectionAction.selectOrientation(selectedHex.getProvisionalTileRotation()); if (orWindow.process(mapCorrectionAction)) { selectedHex.fixTile(); --- 1245,1253 ---- if (mapCorrectionEnabled) { if (selectedHex != null && selectedHex.getProvisionalTile() != null) { ! if (mapCorrectionAction.getStep() == ActionStep.SELECT_ORIENTATION) { ! mapCorrectionAction.selectOrientation(selectedHex.getProvisionalTileRotation()); ! } else if (mapCorrectionAction.getStep() == ActionStep.CONFIRM) { ! mapCorrectionAction.selectConfirmed(); ! } if (orWindow.process(mapCorrectionAction)) { selectedHex.fixTile(); *************** *** 1694,1699 **** public void updateUpgradesPanel(MapCorrectionAction action) { setLocalStep(MAP_CORRECTION); - GUIHex selectedHex = map.getSelectedHex(); boolean showTilesInUpgrade = true; switch (action.getStep()) { --- 1733,1738 ---- public void updateUpgradesPanel(MapCorrectionAction action) { setLocalStep(MAP_CORRECTION); GUIHex selectedHex = map.getSelectedHex(); + boolean showTilesInUpgrade = true; switch (action.getStep()) { *************** *** 1706,1709 **** --- 1745,1752 ---- tileUpgrades = new ArrayList<TileI>(); showTilesInUpgrade = true; + // checks if there is still a hex selected (due to errors) + if (selectedHex != null) { + map.selectHex(null); + } break; case SELECT_TILE: *************** *** 1713,1722 **** upgradePanel.setCancelEnabled(true); tileUpgrades = action.getTiles(); // checks if there is still a tile displayed (due to errors) ! if (selectedHex.canFixTile()){ selectedHex.removeTile(); - map.setSelectedHex(selectedHex); } ! showTilesInUpgrade = true; break; case SELECT_ORIENTATION: --- 1756,1767 ---- upgradePanel.setCancelEnabled(true); tileUpgrades = action.getTiles(); + showTilesInUpgrade = true; // checks if there is still a tile displayed (due to errors) ! if (selectedHex != null && selectedHex.canFixTile()){ selectedHex.removeTile(); } ! // activate hex selection ! map.selectHex(null); ! map.selectHex(map.getHexByName(action.getLocation().getName())); break; case SELECT_ORIENTATION: *************** *** 1726,1756 **** upgradePanel.setCancelEnabled(true); // next step already set to finished => preprinted tile with fixed orientation ! if (action.getNextStep() == MapCorrectionManager.ActionStep.FINISHED) { ! selectedHex.setTileOrientation(action.getOrientation()); ! map.repaint(selectedHex.getBounds()); ! if (orWindow.process(mapCorrectionAction)) { ! selectedHex.fixTile(); ! } else { ! selectedHex.removeTile(); ! } ! map.selectHex(null); ! return; ! } showTilesInUpgrade = true; break; case RELAY_BASETOKENS: ! upgradePanel.setDoneText("RelayToken"); upgradePanel.setDoneEnabled(true); upgradePanel.setCancelText("Cancel"); upgradePanel.setCancelEnabled(true); ! tokenLays= action.getTokensToRelay(); ! showTilesInUpgrade = false; } ! log.debug("Active map tile correction"); if (showTilesInUpgrade) { upgradePanel.showCorrectionTileUpgrades(); } else { ! upgradePanel.showCorrectionTokenUpgrades(); } } --- 1771,1828 ---- upgradePanel.setCancelEnabled(true); // next step already set to finished => preprinted tile with fixed orientation ! // if (action.getNextStep() == MapCorrectionManager.ActionStep.FINISHED) { ! // selectedHex.setTileOrientation(action.getOrientation()); ! // map.repaint(selectedHex.getBounds()); ! // if (orWindow.process(mapCorrectionAction)) { ! // selectedHex.fixTile(); ! // } else { ! // selectedHex.removeTile(); ! // } ! // map.selectHex(null); ! // return; } ! ! // } showTilesInUpgrade = true; break; case RELAY_BASETOKENS: ! // define open slots for each station ! List<Station> possibleStations = new ArrayList<Station>(action.getPossibleStations()); ! Map<Station, Integer> openSlots = new HashMap<Station, Integer>(); ! for (Station station:possibleStations) { ! openSlots.put(station, station.getBaseSlots()); ! } ! // ask for the new stations ! List<Station> chosenStations = new ArrayList<Station>(); ! for (BaseToken token:action.getTokensToRelay()) { ! Station chosenStation = correctionRelayBaseToken(token, possibleStations); ! chosenStations.add(chosenStation); ! // check the number of available slots ! openSlots.put(chosenStation, openSlots.get(chosenStation) - 1); ! if (openSlots.get(chosenStation) == 0) { ! possibleStations.remove(chosenStation); ! } ! } ! action.selectRelayBaseTokens(chosenStations); ! if (orWindow.process(mapCorrectionAction)) { ! selectedHex.fixTile(); ! } else { ! selectedHex.removeTile(); ! } ! map.selectHex(null); ! return; ! case CONFIRM: ! // only wait for laytile or cancel command, for those lays that do not need adjustment of orientation ! upgradePanel.setDoneText("LayTile"); upgradePanel.setDoneEnabled(true); upgradePanel.setCancelText("Cancel"); upgradePanel.setCancelEnabled(true); ! showTilesInUpgrade = true; } ! log.debug("Active map tile correction"); if (showTilesInUpgrade) { upgradePanel.showCorrectionTileUpgrades(); } else { ! upgradePanel.showCorrectionTokenUpgrades(action); } } |
From: Stefan F. <ste...@us...> - 2010-05-29 23:33:51
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13817/rails/game/correct Modified Files: MapCorrectionManager.java MapCorrectionAction.java Log Message: Updated and slightly restricted map correction functionality Index: MapCorrectionAction.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/MapCorrectionAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapCorrectionAction.java 29 May 2010 09:38:58 -0000 1.2 --- MapCorrectionAction.java 29 May 2010 23:33:43 -0000 1.3 *************** *** 4,10 **** import java.io.ObjectInputStream; import java.util.ArrayList; - import java.util.HashMap; import java.util.List; - import java.util.Map; import rails.game.correct.MapCorrectionManager.*; --- 4,8 ---- *************** *** 15,19 **** import rails.game.TileI; import rails.game.TileManager; - import rails.game.TokenI; import rails.game.action.PossibleAction; import rails.util.Util; --- 13,16 ---- *************** *** 154,157 **** --- 151,158 ---- } + public void selectConfirmed() { + setNextStep(ActionStep.RELAY_BASETOKENS); + } + public void selectOrientation(int orientation) { setOrientation(orientation); *************** *** 192,204 **** } b.append(" Step=" + step); ! if (nextStep != null) b.append(" NextStep=" + nextStep); if (step.ordinal() > ActionStep.SELECT_HEX.ordinal()) b.append(" Hex=" + location.getName()); if (step == ActionStep.SELECT_TILE) b.append(" Possible tiles=" + tiles); ! if (step.ordinal() > ActionStep.SELECT_TILE.ordinal()) b.append(" Chosen tile=" + tiles); ! if (step.ordinal() > ActionStep.SELECT_ORIENTATION.ordinal()) b.append(" Orientation=" + orientation); if (step.ordinal() >= ActionStep.RELAY_BASETOKENS.ordinal()) --- 193,210 ---- } b.append(" Step=" + step); ! ActionStep executedStep; ! if (nextStep != null) { b.append(" NextStep=" + nextStep); + executedStep = nextStep; + } else { + executedStep = step; + } if (step.ordinal() > ActionStep.SELECT_HEX.ordinal()) b.append(" Hex=" + location.getName()); if (step == ActionStep.SELECT_TILE) b.append(" Possible tiles=" + tiles); ! if (executedStep.ordinal() >= ActionStep.SELECT_TILE.ordinal()) b.append(" Chosen tile=" + tiles); ! if (executedStep.ordinal() >= ActionStep.SELECT_ORIENTATION.ordinal()) b.append(" Orientation=" + orientation); if (step.ordinal() >= ActionStep.RELAY_BASETOKENS.ordinal()) *************** *** 206,210 **** if (step.ordinal() == ActionStep.RELAY_BASETOKENS.ordinal()) b.append(" Possible Stations=" + possibleStations); ! if (step.ordinal() > ActionStep.RELAY_BASETOKENS.ordinal()) b.append(" Selected stations for relay=" + stationsForRelay); return b.toString(); --- 212,216 ---- if (step.ordinal() == ActionStep.RELAY_BASETOKENS.ordinal()) b.append(" Possible Stations=" + possibleStations); ! if (executedStep.ordinal() >= ActionStep.RELAY_BASETOKENS.ordinal()) b.append(" Selected stations for relay=" + stationsForRelay); return b.toString(); Index: MapCorrectionManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/MapCorrectionManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapCorrectionManager.java 29 May 2010 09:38:58 -0000 1.2 --- MapCorrectionManager.java 29 May 2010 23:33:43 -0000 1.3 *************** *** 4,8 **** import java.util.HashMap; import java.util.List; - import java.util.Map; import rails.game.BaseToken; --- 4,7 ---- *************** *** 21,25 **** public static enum ActionStep { ! SELECT_HEX,SELECT_TILE,SELECT_ORIENTATION,RELAY_BASETOKENS,FINISHED,CANCELLED; } --- 20,24 ---- public static enum ActionStep { ! SELECT_HEX,SELECT_TILE,SELECT_ORIENTATION,CONFIRM,RELAY_BASETOKENS,FINISHED,CANCELLED; } *************** *** 56,59 **** --- 55,62 ---- // already finished, thus on reload action.setNextStep(ActionStep.FINISHED); + } else if (action.getNextStep() == ActionStep.CANCELLED) { + // cancelled => set to null and return + activeTileAction = null; + return true; } *************** *** 73,77 **** LocalText.getText("TileNotAvailable", chosenTile.getExternalId()); ! // return to step of hex selection action.selectHex(hex); break; --- 76,80 ---- LocalText.getText("TileNotAvailable", chosenTile.getExternalId()); ! // return to step of tile selection action.selectHex(hex); break; *************** *** 90,94 **** errMsg = LocalText.getText("CorrectMapNotEnoughSlots", chosenTile.getExternalId()); ! // return to step of hex selection action.selectHex(hex); break; --- 93,109 ---- errMsg = LocalText.getText("CorrectMapNotEnoughSlots", chosenTile.getExternalId()); ! // return to step of tile selection ! action.selectHex(hex); ! break; ! } ! // check if chosenTile requires relays ! // this is not implemented yet, thus error message ! if (chosenTile.getNumStations() >= 2 ! && hex.getCurrentTile().getColourNumber() >= chosenTile.getColourNumber() ! // B. or the current tile requires relays ! || hex.getCurrentTile().relayBaseTokensOnUpgrade()) { ! errMsg = ! LocalText.getText("CorrectMapRequiresRelays", chosenTile.getExternalId()); ! // return to step of tile selection action.selectHex(hex); break; *************** *** 104,109 **** errMsg )); ; - // stay at the same step - action.setNextStep(action.getStep()); } --- 119,122 ---- *************** *** 128,135 **** if (preprintedTile == chosenTile) { action.selectOrientation(hex.getPreprintedTileRotation()); ! return execute(action); } else if (chosenTile.getFixedOrientation() != -1) { action.selectOrientation(chosenTile.getFixedOrientation()); ! return execute(action); } else { break; --- 141,150 ---- if (preprintedTile == chosenTile) { action.selectOrientation(hex.getPreprintedTileRotation()); ! action.setNextStep(ActionStep.CONFIRM); ! break; } else if (chosenTile.getFixedOrientation() != -1) { action.selectOrientation(chosenTile.getFixedOrientation()); ! action.setNextStep(ActionStep.CONFIRM); ! break; } else { break; *************** *** 161,167 **** } case FINISHED: - // lays tiles gameManager.getMoveStack().start(false); int orientation = action.getOrientation(); hex.upgrade(chosenTile, orientation, new HashMap<String,Integer>()); --- 176,182 ---- } case FINISHED: gameManager.getMoveStack().start(false); + // lays tile int orientation = action.getOrientation(); hex.upgrade(chosenTile, orientation, new HashMap<String,Integer>()); *************** *** 172,179 **** --- 187,203 ---- gameManager.addToNextPlayerMessages(msg, true); + // relays tokens + // if (action.getTokensToRelay() != null) { + // for (BaseToken token:action.getTokensToRelay()) { + // int i = action.getTokensToRelay().indexOf(token); + // + // } + // } + activeTileAction = null; break; case CANCELLED: + // should be captured above activeTileAction = null; } |
From: Stefan F. <ste...@us...> - 2010-05-29 23:33:51
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13817 Modified Files: LocalisedText.properties Log Message: Updated and slightly restricted map correction functionality Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** LocalisedText.properties 29 May 2010 09:38:58 -0000 1.136 --- LocalisedText.properties 29 May 2010 23:33:43 -0000 1.137 *************** *** 142,146 **** CorrectCashToolTip=Click here to adjust cash position CorrectCashZero=Impossible for zero amount ! CorrectMap=Map correction mode is active: CorrectMapRELAY_BASETOKENS=Relay the base tokens CorrectMapSELECT_HEX=Select hex to lay a tile on --- 142,147 ---- CorrectCashToolTip=Click here to adjust cash position CorrectCashZero=Impossible for zero amount ! CorrectMap=Map correction mode is active: ! CorrectMapCONFIRM=Select another tile or hex, or press Lay Tile to confirm tile, or press cancel CorrectMapRELAY_BASETOKENS=Relay the base tokens CorrectMapSELECT_HEX=Select hex to lay a tile on *************** *** 150,153 **** --- 151,155 ---- CorrectMapLaysTileAt=CORRECTION: Lays tile #{0} at hex {1}/{2} CorrectMapNotEnoughSlots=Tile #{0} has not enough slots for base tokens + CorrectMapRequiresRelays=Lay of Tile #{0} would require relay of base tokens. CorrectionMainMenu=Correction CorrectionModeActivate={1} activated by {0} |
From: Stefan F. <ste...@us...> - 2010-05-29 09:39:07
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1284/rails/game Modified Files: TileManager.java TileI.java Tile.java Log Message: Start of refining of the map correction Index: TileI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TileI.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TileI.java 15 May 2010 19:05:39 -0000 1.20 --- TileI.java 29 May 2010 09:38:58 -0000 1.21 *************** *** 49,53 **** public List<TileI> getUpgrades(MapHex hex, PhaseI phase); ! public List<TileI> getAllUpgrades(); public List<TileI> getValidUpgrades(MapHex hex, PhaseI phase); --- 49,53 ---- public List<TileI> getUpgrades(MapHex hex, PhaseI phase); ! public List<TileI> getAllUpgrades(MapHex hex); public List<TileI> getValidUpgrades(MapHex hex, PhaseI phase); Index: TileManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TileManager.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TileManager.java 28 Mar 2010 17:05:55 -0000 1.16 --- TileManager.java 29 May 2010 09:38:58 -0000 1.17 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.LocalText; import rails.util.Tag; public class TileManager implements ConfigurableComponentI { protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); // private static List<String> directories = new ArrayList<String>(); private List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); //directories.add("data/" + ComponentManager.getGameName()); directories.add("data/" + GameManager.getInstance().getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (TileI tile : tileMap.values()) { tile.finishConfiguration(this); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } /** returns the set of all possible upgrade tiles */ public List<TileI> getAllUpgrades(TileI tile) { TreeSet<TileI> tileSet = new TreeSet<TileI>(); return new ArrayList<TileI>(recursiveUpgrades(tile, tileSet)); } private TreeSet<TileI> recursiveUpgrades(TileI tile, TreeSet<TileI> tileSet) { tileSet.add(tile); List<TileI> directUpgrades = tile.getAllUpgrades(); for (TileI upgrade:directUpgrades) if (!tileSet.contains(upgrade)) tileSet = recursiveUpgrades(upgrade, tileSet); return tileSet; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.LocalText; import rails.util.Tag; public class TileManager implements ConfigurableComponentI { protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); // private static List<String> directories = new ArrayList<String>(); private List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); //directories.add("data/" + ComponentManager.getGameName()); directories.add("data/" + GameManager.getInstance().getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (TileI tile : tileMap.values()) { tile.finishConfiguration(this); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } /** returns the set of all possible upgrade tiles */ public List<TileI> getAllUpgrades(TileI tile, MapHex hex) { TreeSet<TileI> tileSet = new TreeSet<TileI>(); return new ArrayList<TileI>(recursiveUpgrades(tile, hex, tileSet)); } private TreeSet<TileI> recursiveUpgrades(TileI tile, MapHex hex, TreeSet<TileI> tileSet) { tileSet.add(tile); List<TileI> directUpgrades = tile.getAllUpgrades(hex); for (TileI upgrade:directUpgrades) if (!tileSet.contains(upgrade)) tileSet = recursiveUpgrades(upgrade, hex, tileSet); return tileSet; } } \ No newline at end of file Index: Tile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Tile.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Tile.java 18 May 2010 04:12:23 -0000 1.42 --- Tile.java 29 May 2010 09:38:58 -0000 1.43 *************** *** 394,406 **** /** ! * Get all possible upgrades for a specific tile * * @return A List of valid upgrade TileI objects. */ ! public List<TileI> getAllUpgrades() { List<TileI> upgr = new ArrayList<TileI>(); for (Upgrade upgrade : upgrades) { ! upgr.add(upgrade.getTile()); } return upgr; --- 394,409 ---- /** ! * Get all possible upgrades for a specific tile on a certain hex * * @return A List of valid upgrade TileI objects. */ ! public List<TileI> getAllUpgrades(MapHex hex) { List<TileI> upgr = new ArrayList<TileI>(); for (Upgrade upgrade : upgrades) { ! TileI tile = upgrade.getTile(); ! if (upgrade.isAllowedForHex(hex)) { ! upgr.add(tile); ! } } return upgr; |
From: Stefan F. <ste...@us...> - 2010-05-29 09:39:07
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1284/rails/game/correct Modified Files: MapCorrectionManager.java MapCorrectionAction.java Log Message: Start of refining of the map correction Index: MapCorrectionAction.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/MapCorrectionAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapCorrectionAction.java 28 Mar 2010 17:05:56 -0000 1.1 --- MapCorrectionAction.java 29 May 2010 09:38:58 -0000 1.2 *************** *** 4,14 **** --- 4,19 ---- import java.io.ObjectInputStream; import java.util.ArrayList; + import java.util.HashMap; import java.util.List; + import java.util.Map; import rails.game.correct.MapCorrectionManager.*; + import rails.game.BaseToken; + import rails.game.Station; import rails.game.MapHex; import rails.game.MapManager; import rails.game.TileI; import rails.game.TileManager; + import rails.game.TokenI; import rails.game.action.PossibleAction; import rails.util.Util; *************** *** 38,42 **** /** Orientation: how to lay the tile */ private int orientation; ! /** * Instantiates a new map tile correction action. --- 43,55 ---- /** Orientation: how to lay the tile */ private int orientation; ! ! /** RelayBaseTokens: how to relay the base tokens */ ! transient private List<BaseToken> tokensToRelay; ! private String[]tokensToRelayOwner; ! transient private List<Station> stationsForRelay; ! private int[] stationForRelayId; ! transient private List<Station> possibleStations; ! private int[] possibleStationsId; ! /** * Instantiates a new map tile correction action. *************** *** 63,67 **** public TileI getChosenTile() { ! if (step.ordinal() > ActionStep.SELECT_TILE.ordinal()) return tiles.get(0); else --- 76,80 ---- public TileI getChosenTile() { ! if (nextStep.ordinal() > ActionStep.SELECT_TILE.ordinal()) return tiles.get(0); else *************** *** 69,73 **** } ! public void setTiles(List<TileI> tiles) { this.tiles = tiles; this.tileIds = new int[tiles.size()]; --- 82,86 ---- } ! void setTiles(List<TileI> tiles) { this.tiles = tiles; this.tileIds = new int[tiles.size()]; *************** *** 76,79 **** --- 89,116 ---- } + public List<Station> getStationsForRelay() { + return stationsForRelay; + } + + private void setStationsForRelay(List<Station> stations) { + this.stationsForRelay = stations; + } + + public List<BaseToken> getTokensToRelay() { + return tokensToRelay; + } + + void setTokensToRelay(List<BaseToken> tokens) { + this.tokensToRelay = tokens; + } + + public List<Station> getPossibleStations() { + return possibleStations; + } + + void setPossibleStations(List<Station> possibleStations) { + this.possibleStations = possibleStations; + } + public int getOrientation(){ return orientation; *************** *** 88,92 **** } ! private void setNextStep(ActionStep step) { this.nextStep = step; if (step == null) --- 125,129 ---- } ! void setNextStep(ActionStep step) { this.nextStep = step; if (step == null) *************** *** 119,122 **** --- 156,164 ---- public void selectOrientation(int orientation) { setOrientation(orientation); + setNextStep(ActionStep.RELAY_BASETOKENS); + } + + public void selectRelayBaseTokens(List<Station> chosenStations) { + setStationsForRelay(chosenStations); setNextStep(ActionStep.FINISHED); } *************** *** 160,163 **** --- 202,211 ---- if (step.ordinal() > ActionStep.SELECT_ORIENTATION.ordinal()) b.append(" Orientation=" + orientation); + if (step.ordinal() >= ActionStep.RELAY_BASETOKENS.ordinal()) + b.append(" Tokens to relay=" + tokensToRelay); + if (step.ordinal() == ActionStep.RELAY_BASETOKENS.ordinal()) + b.append(" Possible Stations=" + possibleStations); + if (step.ordinal() > ActionStep.RELAY_BASETOKENS.ordinal()) + b.append(" Selected stations for relay=" + stationsForRelay); return b.toString(); } Index: MapCorrectionManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/MapCorrectionManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapCorrectionManager.java 28 Mar 2010 17:05:56 -0000 1.1 --- MapCorrectionManager.java 29 May 2010 09:38:58 -0000 1.2 *************** *** 1,14 **** package rails.game.correct; import java.util.HashMap; import java.util.List; ! import rails.game.correct.MapCorrectionAction.*; ! import rails.game.GameManager; import rails.game.MapHex; import rails.game.ReportBuffer; import rails.game.TileI; import rails.game.TileManager; import rails.util.LocalText; --- 1,19 ---- package rails.game.correct; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; + import java.util.Map; ! import rails.game.BaseToken; ! import rails.game.City; ! import rails.game.DisplayBuffer; import rails.game.GameManager; import rails.game.MapHex; import rails.game.ReportBuffer; + import rails.game.Station; import rails.game.TileI; import rails.game.TileManager; + import rails.game.TokenI; import rails.util.LocalText; *************** *** 16,20 **** public static enum ActionStep { ! SELECT_HEX,SELECT_TILE,SELECT_ORIENTATION,FINISHED,CANCELLED; } --- 21,25 ---- public static enum ActionStep { ! SELECT_HEX,SELECT_TILE,SELECT_ORIENTATION,RELAY_BASETOKENS,FINISHED,CANCELLED; } *************** *** 42,76 **** if (action instanceof MapCorrectionAction) return execute((MapCorrectionAction) action); ! else return super.executeCorrection(action); } private boolean execute(MapCorrectionAction action){ MapHex hex = action.getLocation(); TileI chosenTile = action.getChosenTile(); - TileManager tmgr = gameManager.getTileManager(); TileI preprintedTile = tmgr.getTile(hex.getPreprintedTileId()); ! // already finished, thus on reload ! ActionStep executeStep = action.getStep(); ! if (executeStep != ActionStep.FINISHED) ! executeStep = action.moveToNextStep(); ! ! switch (executeStep) { case SELECT_TILE: // create list of possible up and downgrades ! List<TileI> possibleTiles = tmgr.getAllUpgrades(preprintedTile); if (preprintedTile == hex.getCurrentTile()) possibleTiles.remove(hex.getCurrentTile()); // remove preprinted tile if still laid action.setTiles(possibleTiles); break; - case SELECT_ORIENTATION: // default orientation for preprinted files ! if (preprintedTile == chosenTile) action.selectOrientation(hex.getPreprintedTileRotation()); ! break; case FINISHED: // lays tiles --- 47,163 ---- if (action instanceof MapCorrectionAction) return execute((MapCorrectionAction) action); ! else // any other action, could be a correctionMode action return super.executeCorrection(action); } private boolean execute(MapCorrectionAction action){ + + if (action.getStep() == ActionStep.FINISHED) { + // already finished, thus on reload + action.setNextStep(ActionStep.FINISHED); + } MapHex hex = action.getLocation(); + TileI chosenTile = action.getChosenTile(); TileManager tmgr = gameManager.getTileManager(); TileI preprintedTile = tmgr.getTile(hex.getPreprintedTileId()); ! // check conditions ! String errMsg = null; ! while (true) { ! // check if chosenTile is still available (not for preprinted) ! if (chosenTile != null && chosenTile.getExternalId() > 0 && chosenTile != hex.getCurrentTile() ! && chosenTile.countFreeTiles() == 0) { ! errMsg = ! LocalText.getText("TileNotAvailable", ! chosenTile.getExternalId()); ! // return to step of hex selection ! action.selectHex(hex); ! break; ! } ! // check if chosenTile contains enough slots ! List<BaseToken> baseTokens = hex.getBaseTokens(); ! if (chosenTile != null && baseTokens != null && !baseTokens.isEmpty()) { ! List<Station> stations = chosenTile.getStations(); ! int nbSlots = 0; ! if (stations != null) { ! for (Station station:stations) { ! nbSlots += station.getBaseSlots(); ! } ! } ! if (baseTokens.size() > nbSlots) { ! errMsg = ! LocalText.getText("CorrectMapNotEnoughSlots", chosenTile.getExternalId()); ! // return to step of hex selection ! action.selectHex(hex); ! break; ! } ! } ! break; ! } ! ! if (errMsg != null) { ! DisplayBuffer.add(LocalText.getText("CorrectMapCannotLayTile", ! chosenTile.getExternalId(), ! hex.getName(), ! errMsg )); ! ; ! // stay at the same step ! action.setNextStep(action.getStep()); ! } ! ! ActionStep nextStep; ! // not yet finished, move to next step ! if (action.getStep() != ActionStep.FINISHED) ! nextStep = action.getNextStep(); ! else ! nextStep = ActionStep.FINISHED; ! ! // preparation for the next step ! switch (nextStep) { case SELECT_TILE: // create list of possible up and downgrades ! List<TileI> possibleTiles = tmgr.getAllUpgrades(preprintedTile, hex); if (preprintedTile == hex.getCurrentTile()) possibleTiles.remove(hex.getCurrentTile()); // remove preprinted tile if still laid action.setTiles(possibleTiles); break; case SELECT_ORIENTATION: // default orientation for preprinted files ! if (preprintedTile == chosenTile) { action.selectOrientation(hex.getPreprintedTileRotation()); ! return execute(action); ! } else if (chosenTile.getFixedOrientation() != -1) { ! action.selectOrientation(chosenTile.getFixedOrientation()); ! return execute(action); ! } else { ! break; ! } ! case RELAY_BASETOKENS: ! // check if relays are necessary: ! // A. downgrades or equalgrades to a tile with two stations or more ! if (chosenTile.getNumStations() >= 2 ! && hex.getCurrentTile().getColourNumber() >= chosenTile.getColourNumber() ! // B. or the current tile requires relays ! || hex.getCurrentTile().relayBaseTokensOnUpgrade()) { ! // define tokens for relays ! List<BaseToken> tokens = new ArrayList<BaseToken>(); ! for (City oldCity:hex.getCities()) { ! for (TokenI token:oldCity.getTokens()) { ! if (token instanceof BaseToken) { ! tokens.add((BaseToken)token); ! } ! } ! } ! action.setTokensToRelay(tokens); ! // define possible stations ! action.setPossibleStations(chosenTile.getStations()); ! break; ! } else { ! action.selectRelayBaseTokens(null); ! // move to FINISHED ! return execute(action); ! } case FINISHED: // lays tiles *************** *** 91,94 **** --- 178,185 ---- activeTileAction = null; } + + if (action.getStep() != ActionStep.FINISHED) { + action.moveToNextStep(); + } return true; |
From: Stefan F. <ste...@us...> - 2010-05-29 09:39:07
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1284 Modified Files: LocalisedText.properties Log Message: Start of refining of the map correction Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** LocalisedText.properties 26 May 2010 19:48:57 -0000 1.135 --- LocalisedText.properties 29 May 2010 09:38:58 -0000 1.136 *************** *** 142,150 **** CorrectCashToolTip=Click here to adjust cash position CorrectCashZero=Impossible for zero amount ! CorrectMap=Map correction mode is active: CorrectMapSELECT_HEX=Select hex to lay a tile on CorrectMapSELECT_TILE=Select a tile, select another hex, or press cancel CorrectMapSELECT_ORIENTATION=Click tile to rotate it, or select another tile or hex, or press Lay Tile to confirm tile, or press cancel CorrectMapLaysTileAt=CORRECTION: Lays tile #{0} at hex {1}/{2} CorrectionMainMenu=Correction CorrectionModeActivate={1} activated by {0} --- 142,153 ---- CorrectCashToolTip=Click here to adjust cash position CorrectCashZero=Impossible for zero amount ! CorrectMap=Map correction mode is active: ! CorrectMapRELAY_BASETOKENS=Relay the base tokens CorrectMapSELECT_HEX=Select hex to lay a tile on CorrectMapSELECT_TILE=Select a tile, select another hex, or press cancel CorrectMapSELECT_ORIENTATION=Click tile to rotate it, or select another tile or hex, or press Lay Tile to confirm tile, or press cancel + CorrectMapCannotLayTile=Map correction cannot lay tile #{0} on hex {1} : {2} CorrectMapLaysTileAt=CORRECTION: Lays tile #{0} at hex {1}/{2} + CorrectMapNotEnoughSlots=Tile #{0} has not enough slots for base tokens CorrectionMainMenu=Correction CorrectionModeActivate={1} activated by {0} |
From: Stefan F. <ste...@us...> - 2010-05-29 09:39:06
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1284/rails/ui/swing Modified Files: UpgradesPanel.java ORUIManager.java Log Message: Start of refining of the map correction Index: UpgradesPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/UpgradesPanel.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** UpgradesPanel.java 28 Mar 2010 17:05:56 -0000 1.25 --- UpgradesPanel.java 29 May 2010 09:38:58 -0000 1.26 *************** *** 173,177 **** HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! hexLabel.setText("" + tile.getExternalId()); hexLabel.setOpaque(true); hexLabel.setVisible(true); --- 173,177 ---- HexLabel hexLabel = new HexLabel(hexIcon, tile.getId()); hexLabel.setName(tile.getName()); ! hexLabel.setText("<HTML><BODY>" + tile.getExternalId() + "<BR/>#" + tile.countFreeTiles() + "</BODY></HTML>"); hexLabel.setOpaque(true); hexLabel.setVisible(true); *************** *** 191,195 **** // populate version for corrections ! public void showCorrectionUpgrades() { upgradePanel.removeAll(); GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); --- 191,195 ---- // populate version for corrections ! public void showCorrectionTileUpgrades() { upgradePanel.removeAll(); GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); *************** *** 218,222 **** hexLabel.setName(tile.getName()); if (tile.getExternalId() > 0) ! hexLabel.setText("" + tile.getExternalId()); else hexLabel.setText(""); --- 218,222 ---- hexLabel.setName(tile.getName()); if (tile.getExternalId() > 0) ! hexLabel.setText("<HTML><BODY>" + tile.getExternalId() + "<BR/>#" + tile.countFreeTiles() + "</BODY></HTML>"); else hexLabel.setText(""); *************** *** 237,240 **** --- 237,287 ---- } + // populate version for corrections + public void showCorrectionTokenUpgrades() { + upgradePanel.removeAll(); + GridLayout panelLayout = (GridLayout)upgradePanel.getLayout(); + List<? extends TokenI> tokens = orUIManager.tokenLays; + + if (tokens == null || tokens.size() == 0) { + // reset to the number of elements + panelLayout.setRows(defaultNbPanelElements); + // set to position 0 + scrollPane.getVerticalScrollBar().setValue(0); + } else { + Color fgColour = null; + Color bgColour = null; + String text = null; + String description = null; + TokenIcon icon; + ActionLabel tokenLabel; + tokenLabels = new ArrayList<ActionLabel>(); + for (TokenI token:tokens) { + if (token instanceof BaseToken) { + PublicCompanyI comp = ((BaseToken)token).getCompany(); + fgColour = comp.getFgColour(); + bgColour = comp.getBgColour(); + description = text = comp.getName(); + } + icon = new TokenIcon(25, fgColour, bgColour, text); + tokenLabel = new ActionLabel(icon); + tokenLabel.setName(description); + tokenLabel.setText(description); + tokenLabel.setBackground(defaultLabelBgColour); + tokenLabel.setOpaque(true); + tokenLabel.setVisible(true); + tokenLabel.setBorder(border); + tokenLabel.addMouseListener(this); + tokenLabels.add(tokenLabel); + upgradePanel.add(tokenLabel); + } + + } + upgradePanel.add(doneButton); + upgradePanel.add(cancelButton); + + // repaint(); + revalidate(); + + } public void clear() { Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ORUIManager.java 24 May 2010 07:49:26 -0000 1.75 --- ORUIManager.java 29 May 2010 09:38:58 -0000 1.76 *************** *** 52,55 **** --- 52,56 ---- private boolean tokenLayingEnabled = false; public List<LayToken> allowedTokenLays = new ArrayList<LayToken>(); + public List<? extends TokenI> tokenLays; private int selectedTokenIndex; private LayToken selectedTokenAllowance; *************** *** 588,592 **** switch (mapCorrectionAction.getStep()) { case SELECT_HEX: ! case SELECT_TILE: // if tile is selected see checkClickedHex = true; break; --- 589,593 ---- switch (mapCorrectionAction.getStep()) { case SELECT_HEX: ! case SELECT_TILE: // if tile is selected checkClickedHex = true; break; *************** *** 1694,1697 **** --- 1695,1700 ---- setLocalStep(MAP_CORRECTION); + GUIHex selectedHex = map.getSelectedHex(); + boolean showTilesInUpgrade = true; switch (action.getStep()) { case SELECT_HEX: *************** *** 1702,1705 **** --- 1705,1709 ---- upgradePanel.setCancelEnabled(false); tileUpgrades = new ArrayList<TileI>(); + showTilesInUpgrade = true; break; case SELECT_TILE: *************** *** 1709,1712 **** --- 1713,1722 ---- upgradePanel.setCancelEnabled(true); tileUpgrades = action.getTiles(); + // checks if there is still a tile displayed (due to errors) + if (selectedHex.canFixTile()){ + selectedHex.removeTile(); + map.setSelectedHex(selectedHex); + } + showTilesInUpgrade = true; break; case SELECT_ORIENTATION: *************** *** 1715,1722 **** upgradePanel.setCancelText("Cancel"); upgradePanel.setCancelEnabled(true); - // next step already set to finished => preprinted tile with fixed orientation if (action.getNextStep() == MapCorrectionManager.ActionStep.FINISHED) { - GUIHex selectedHex = map.getSelectedHex(); selectedHex.setTileOrientation(action.getOrientation()); map.repaint(selectedHex.getBounds()); --- 1725,1730 ---- *************** *** 1729,1737 **** return; } break; } log.debug("Active map tile correction"); ! upgradePanel.showCorrectionUpgrades(); } --- 1737,1757 ---- return; } + showTilesInUpgrade = true; break; + case RELAY_BASETOKENS: + upgradePanel.setDoneText("RelayToken"); + upgradePanel.setDoneEnabled(true); + upgradePanel.setCancelText("Cancel"); + upgradePanel.setCancelEnabled(true); + tokenLays= action.getTokensToRelay(); + showTilesInUpgrade = false; } log.debug("Active map tile correction"); ! if (showTilesInUpgrade) { ! upgradePanel.showCorrectionTileUpgrades(); ! } else { ! upgradePanel.showCorrectionTokenUpgrades(); ! } } |
From: Stefan F. <ste...@us...> - 2010-05-26 20:18:19
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv2064/data/18AL Modified Files: Game.xml Log Message: Added optimizing option for named trains in 18AL Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/Game.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Game.xml 25 May 2010 19:38:30 -0000 1.32 --- Game.xml 26 May 2010 19:48:57 -0000 1.33 *************** *** 3,6 **** --- 3,7 ---- <Component name="GameManager" class="rails.game.GameManager"> <Game name="18AL"/> + <GameOption name ="18ALOptimizeNamedTrains" default="no"/> <GameOption name="UnlimitedTopTrains" parm="4D" type="toggle" default="no"/> <GameOption name="Obsolete4Trains" type="toggle" default="yes"/> |
From: Stefan F. <ste...@us...> - 2010-05-26 20:18:13
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv2064/data Modified Files: GamesList.xml Log Message: Added optimizing option for named trains in 18AL Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GamesList.xml 18 May 2010 22:07:18 -0000 1.36 --- GamesList.xml 26 May 2010 19:48:57 -0000 1.37 *************** *** 90,93 **** --- 90,94 ---- - Privates cannot be traded between players. </Description> + <Option name ="18ALOptimizeNamedTrains" type="toggle" default="yes"/> <Option name="UnlimitedTopTrains" parm="4D" type="toggle" default="no"/> <Option name="Obsolete4Trains" type="toggle" default="yes"/> |
From: Stefan F. <ste...@us...> - 2010-05-26 20:17:03
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6488/data/18EU Modified Files: CompanyManager.xml Log Message: Added 18EU minor restriction of tile lays in later phases Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/CompanyManager.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CompanyManager.xml 24 May 2010 11:20:42 -0000 1.16 --- CompanyManager.xml 26 May 2010 20:16:55 -0000 1.17 *************** *** 8,12 **** <TileLays> <Number colour="yellow" phase="2" number="2" occurrences="1"/> ! <Number colour="green" phase="3,4" number="0"/> </TileLays> <BaseTokens> --- 8,14 ---- <TileLays> <Number colour="yellow" phase="2" number="2" occurrences="1"/> ! <Number colour="green" phase="3,4,5,6,8" number="0"/> ! <Number colour="brown" phase="5,6,8" number="0"/> ! <Number colour="grey" phase="8" number="0"/> </TileLays> <BaseTokens> |