From: <ev...@us...> - 2011-01-29 16:48:28
|
Revision: 1476 http://rails.svn.sourceforge.net/rails/?rev=1476&view=rev Author: evos Date: 2011-01-29 16:48:22 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Allow game option names with localised parameters. Applies to 18Kaas to display "Version of Map" Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/data/18Kaas/Game.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/game/GameOption.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-01-28 19:49:39 UTC (rev 1475) +++ trunk/18xx/LocalisedText.properties 2011-01-29 16:48:22 UTC (rev 1476) @@ -644,6 +644,7 @@ Variant=Variant VariantIs=Variant is {0}. Version=Version +VersionOf=version of {0} WantToReplaceToken=Do you want to replace the {0} home token with one of {1}? WarningNeedCash=Warning: {0} will be deducted from the company revenue or from your personal cash WHICH_PRICE=Which price? Modified: trunk/18xx/data/18Kaas/Game.xml =================================================================== --- trunk/18xx/data/18Kaas/Game.xml 2011-01-28 19:49:39 UTC (rev 1475) +++ trunk/18xx/data/18Kaas/Game.xml 2011-01-29 16:48:22 UTC (rev 1476) @@ -2,7 +2,7 @@ <ComponentManager> <Component name="GameManager" class="rails.game.GameManager"> <Game name="18Kaas"/> - <GameOption name="Version" values="v1,v2" default="v2" /> + <GameOption name="VersionOf" parm="{MAP}" values="v1,v2" default="v2" /> <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="18KaasRuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-01-28 19:49:39 UTC (rev 1475) +++ trunk/18xx/data/GamesList.xml 2011-01-29 16:48:22 UTC (rev 1476) @@ -139,7 +139,8 @@ Should work, but has not been extensively tested. Limitations as with 1830. </Description> - <Option name="Version" values="v1,v2" default="v2" /> + <Option name="VersionOf" parm="{MAP}" values="v1,v2" default="v2" /> + <!-- Note: a parameter in braces {...} will be localised for display--> <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> <Option name="18KaasRuhrgebiedDoublesOnlyMajors" type="toggle" default="yes" /> Modified: trunk/18xx/rails/game/GameOption.java =================================================================== --- trunk/18xx/rails/game/GameOption.java 2011-01-28 19:49:39 UTC (rev 1475) +++ trunk/18xx/rails/game/GameOption.java 2011-01-29 16:48:22 UTC (rev 1476) @@ -2,6 +2,8 @@ package rails.game; import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import rails.util.LocalText; @@ -27,10 +29,14 @@ // Some other common game options public static final String VARIANT = "Variant"; + // A regex to match parameters against + private static final Pattern pattern = Pattern.compile("\\{(.*)\\}"); public GameOption(String name, String[] parameters) { this.name = name; - if (parameters != null) parm = parameters.clone(); + if (parameters != null) { + parm = parameters.clone(); + } parametrisedName = constructParametrisedName (name, parameters); optionsMap.put(parametrisedName, this); } @@ -50,7 +56,15 @@ } public String getLocalisedName() { - return LocalText.getText(name, (Object[]) parm); + String[] localisedParms = null; + if (parm != null) { + localisedParms = parm.clone(); + for (int i=0; i<parm.length; i++) { + Matcher m = pattern.matcher(parm[i]); + if (m.matches()) localisedParms[i] = LocalText.getText(m.group(1)); + } + } + return LocalText.getText(name, (Object[]) localisedParms); } public String getType() { @@ -61,12 +75,6 @@ return isBoolean; } - /* - public void setParameters(String[] parameters) { - parm = parameters.clone(); - } - */ - public void setAllowedValues(List<String> values) { allowedValues = values; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wak...@us...> - 2011-02-01 17:25:18
|
Revision: 1477 http://rails.svn.sourceforge.net/rails/?rev=1477&view=rev Author: wakko666 Date: 2011-02-01 17:25:11 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Bump version numbers to 1.4.1 Modified Paths: -------------- trunk/18xx/build.xml trunk/18xx/rails/game/Game.java trunk/18xx/rails.bat trunk/18xx/rails.sh Modified: trunk/18xx/build.xml =================================================================== --- trunk/18xx/build.xml 2011-01-29 16:48:22 UTC (rev 1476) +++ trunk/18xx/build.xml 2011-02-01 17:25:11 UTC (rev 1477) @@ -9,7 +9,7 @@ <property name="debuglevel" value="source,lines,vars"/> <property name="target" value="1.5"/> <property name="source" value="1.5"/> - <property name="version" value="1.4"/> + <property name="version" value="1.4.1"/> <taskdef name="jarbundler" classpath="tools/lib/jarbundler-2.1.0.jar" classname="net.sourceforge.jarbundler.JarBundler" /> Modified: trunk/18xx/rails/game/Game.java =================================================================== --- trunk/18xx/rails/game/Game.java 2011-01-29 16:48:22 UTC (rev 1476) +++ trunk/18xx/rails/game/Game.java 2011-02-01 17:25:11 UTC (rev 1477) @@ -13,7 +13,7 @@ import rails.util.Tag; public class Game { - public static final String version = "1.4+"; + public static final String version = "1.4.1"; /** The component Manager */ protected ComponentManager componentManager; Modified: trunk/18xx/rails.bat =================================================================== (Binary files differ) Modified: trunk/18xx/rails.sh =================================================================== --- trunk/18xx/rails.sh 2011-01-29 16:48:22 UTC (rev 1476) +++ trunk/18xx/rails.sh 2011-02-01 17:25:11 UTC (rev 1477) @@ -1,3 +1,3 @@ #!/bin/bash -java -jar ./rails-1.4.jar $1 \ No newline at end of file +java -jar ./rails-1.4.1.jar $1 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-02-06 19:29:12
|
Revision: 1482 http://rails.svn.sourceforge.net/rails/?rev=1482&view=rev Author: evos Date: 2011-02-06 19:29:06 +0000 (Sun, 06 Feb 2011) Log Message: ----------- Added "Load Recent Game" option to game setup screen. This option offers a selection of the 20 most recent saved files in and below the configured save directory. Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/ui/swing/GameSetupWindow.java trunk/18xx/rails/ui/swing/GameUIManager.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-02-05 20:00:15 UTC (rev 1481) +++ trunk/18xx/LocalisedText.properties 2011-02-06 19:29:06 UTC (rev 1482) @@ -352,6 +352,7 @@ LeaveAuctionOnPass=Leave private auction on pass LoadFailed=Load failed, reason: {0} LoadGame=Load Game +LoadRecentGame=Load Recent LOAD=Load LoadInterrupted=Load interrupted at this point, you can continue play from here LoansNotAllowed={0} may not take any loans Modified: trunk/18xx/rails/ui/swing/GameSetupWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-02-05 20:00:15 UTC (rev 1481) +++ trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-02-06 19:29:06 UTC (rev 1482) @@ -4,6 +4,7 @@ import java.awt.*; import java.awt.event.*; import java.io.File; +import java.io.IOException; import java.util.*; import java.util.List; @@ -13,8 +14,7 @@ import rails.common.GuiDef; import rails.game.*; -import rails.util.Config; -import rails.util.LocalText; +import rails.util.*; /** * The Game Setup Window displays the first window presented to the user. This @@ -25,7 +25,7 @@ private static final long serialVersionUID = 1L; GridBagConstraints gc; JPanel gameListPane, playersPane, buttonPane, optionsPane; - JButton newButton, loadButton, recoveryButton, quitButton, optionButton, infoButton, + JButton newButton, loadButton, recentButton, recoveryButton, quitButton, optionButton, infoButton, creditsButton, randomizeButton, configureButton; JComboBox gameNameBox = new JComboBox(); JComboBox[] playerBoxes = new JComboBox[Player.MAX_PLAYERS]; @@ -39,6 +39,9 @@ List<GameOption> availableOptions = new ArrayList<GameOption>(); String gameName; Game game; + + SortedSet<File> recentFiles; + String savedFileExtension; private ConfigWindow configWindow; @@ -68,6 +71,7 @@ newButton = new JButton(LocalText.getText("NewGame")); loadButton = new JButton(LocalText.getText("LoadGame")); + recentButton = new JButton(LocalText.getText("LoadRecentGame")); recoveryButton = new JButton(LocalText.getText("RecoverGame")); quitButton = new JButton(LocalText.getText("QUIT")); optionButton = new JButton(LocalText.getText("OPTIONS")); @@ -77,6 +81,7 @@ newButton.setMnemonic(KeyEvent.VK_N); loadButton.setMnemonic(KeyEvent.VK_L); + recentButton.setMnemonic(KeyEvent.VK_D); recoveryButton.setMnemonic(KeyEvent.VK_R); quitButton.setMnemonic(KeyEvent.VK_Q); optionButton.setMnemonic(KeyEvent.VK_O); @@ -99,6 +104,7 @@ newButton.addActionListener(this); loadButton.addActionListener(this); + recentButton.addActionListener(this); recoveryButton.addActionListener(this); quitButton.addActionListener(this); optionButton.addActionListener(this); @@ -109,6 +115,7 @@ buttonPane.add(newButton); buttonPane.add(loadButton); + buttonPane.add(recentButton); recoveryButton.setEnabled(Config.get("save.recovery.active", "no").equalsIgnoreCase("yes")); buttonPane.add(recoveryButton); @@ -116,7 +123,7 @@ buttonPane.add(quitButton); buttonPane.add(creditsButton); - buttonPane.setLayout(new GridLayout(3, 2)); + buttonPane.setLayout(new GridLayout(0, 2)); buttonPane.setBorder(BorderFactory.createLoweredBevelBorder()); optionsPane.setLayout(new FlowLayout()); @@ -252,6 +259,42 @@ } else { // cancel pressed return; } + } else if (arg0.getSource().equals(recentButton)) { + File saveDirectory = new File(Config.get("save.directory")); + if (saveDirectory == null) return; + + recentFiles = new TreeSet<File>(new Comparator<File> (){ + public int compare (File a, File b) { + return Math.round(b.lastModified() - a.lastModified()); + } + }); + savedFileExtension = Config.get("save.filename.extension"); + if (!Util.hasValue(savedFileExtension)) { + savedFileExtension = GameUIManager.DEFAULT_SAVE_EXTENSION; + } + savedFileExtension = "."+savedFileExtension; + + getRecentFiles(saveDirectory); + if (recentFiles == null || recentFiles.size() == 0) return; + File[] files = recentFiles.toArray(new File[]{}); + int numOptions = 20; + String[] options = new String[numOptions]; + int dirPathLength = saveDirectory.getPath().length(); + for (int i=0; i<numOptions;i++) { + // Get path relative to saveDirectory + options[i] = files[i].getPath().substring(dirPathLength+1); + } + String text = LocalText.getText("Select"); + String result = (String) JOptionPane.showInputDialog(this, text, text, + JOptionPane.OK_CANCEL_OPTION, + null, options, options[0]); + if (result == null) return; + File selectedFile = files[Arrays.asList(options).indexOf(result)]; + if (selectedFile != null) { + loadAndStartGame(selectedFile.getPath(), selectedFile.getParent()); + } else { // cancel pressed + return; + } } else if (arg0.getSource().equals(recoveryButton)) { String filePath = Config.get("save.recovery.filepath", "18xx_autosave.rails"); loadAndStartGame(filePath, null); @@ -317,6 +360,17 @@ } } } + + private void getRecentFiles (File dir) { + if (!dir.exists() || !dir.isDirectory()) return; + for (File entry : dir.listFiles()) { + if (entry.isFile() && entry.getName().endsWith(savedFileExtension)) { + recentFiles.add(entry); + } else if (entry.isDirectory()){ + getRecentFiles(entry); + } + } + } private void toggleOptions() { if (optionsPane.isVisible()) { Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-02-05 20:00:15 UTC (rev 1481) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-02-06 19:29:06 UTC (rev 1482) @@ -54,7 +54,7 @@ protected static final String DEFAULT_SAVE_DIRECTORY = "save"; protected static final String DEFAULT_SAVE_PATTERN = "yyyyMMdd_HHmm"; - protected static final String DEFAULT_SAVE_EXTENSION = "rails"; + public static final String DEFAULT_SAVE_EXTENSION = "rails"; protected static final String NEXT_PLAYER_SUFFIX = "NEXT_PLAYER"; protected String saveDirectory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-02-13 18:07:43
|
Revision: 1485 http://rails.svn.sourceforge.net/rails/?rev=1485&view=rev Author: evos Date: 2011-02-13 18:07:34 +0000 (Sun, 13 Feb 2011) Log Message: ----------- Initial commit for 1830 Coalfields Modified Paths: -------------- trunk/18xx/data/1830/CompanyManager.xml trunk/18xx/data/1830/Game.xml trunk/18xx/data/1830/Map.xml trunk/18xx/data/1830/TileSet.xml trunk/18xx/data/1830/Tiles.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/game/TileManager.java trunk/18xx/rails/util/Tag.java trunk/18xx/tiles/TileDictionary.18t trunk/18xx/tiles/TileDictionary.xml trunk/18xx/tiles/Tiles.xml trunk/18xx/tools/ConvertTilesXML.java Added Paths: ----------- trunk/18xx/tiles/svg/tile-30001.svg trunk/18xx/tiles/svg/tile-30002.svg trunk/18xx/tiles/svg/tile-30003.svg trunk/18xx/tiles/svg/tile-30004.svg trunk/18xx/tiles/svg/tile-30005.svg trunk/18xx/tiles/svg/tile1061.svg trunk/18xx/tiles/svg/tile1062.svg trunk/18xx/tiles/svg/tile1717.svg trunk/18xx/tiles/svg/tile2053.svg trunk/18xx/tiles/svg/tile2061.svg Property Changed: ---------------- trunk/18xx/ trunk/18xx/tiles/ Property changes on: trunk/18xx ___________________________________________________________________ Modified: svn:ignore - *.bat *.txt .cvsignore .classpath .externalToolBuilders 18xx.zip deploy.xml .project zip.xml NewUIstuff.zip COMP.WPS rails.jar rails.jardesc Rails-1.0.1.jar my_my.properties log rails-1.0.1.jar rails*.zip rails-*.jar tools rails-?.*.* jar/* classes/* 18xx_autosave.rails 18xx_autosave.rails.tmp user.profiles + *.bat *.txt .cvsignore .classpath .externalToolBuilders 18xx.zip deploy.xml .project zip.xml NewUIstuff.zip COMP.WPS rails.jar rails.jardesc Rails-1.0.1.jar my_my.properties log rails-1.0.1.jar rails*.zip rails-*.jar tools rails-?.*.* jar/* classes/* 18xx_autosave.rails 18xx_autosave.rails.tmp user.profiles o Modified: trunk/18xx/data/1830/CompanyManager.xml =================================================================== --- trunk/18xx/data/1830/CompanyManager.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/1830/CompanyManager.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -97,7 +97,12 @@ </Company> <Company name="C&O" type="Public" tokens="3" fgColour="000000" bgColour="A0E0FF" longname="Chesapeake & Ohio"> - <Home hex="F6"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Home hex="F6"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Home hex="K13"/> + </IfOption> </Company> <Company name="CPR" type="Public" tokens="4" fgColour="FFFFFF" bgColour="FF0000" longname="Canadian Pacific Railroad"> @@ -109,7 +114,14 @@ <Home hex="E5" city="0" allCitiesBlocked="yes" /> </Company> </IfOption> - <StartPacket roundClass="rails.game.StartRound_1830"> + <IfOption name="Variant" value="Coalfields"> + <Company name="N&W" type="Public" tokens="3" fgColour="FFFF00" bgColour="000080" + longname="Norfolk & Western"> + <Home hex="L16" city="0" allCitiesBlocked="yes" /> + </Company> + </IfOption> + + <StartPacket roundClass="rails.game.StartRound_1830"> <Bidding initial="5" minimum="5" increment="1"/> <Item name="SVNRR" type="Private" basePrice="20"/> <Item name="C&StL" type="Private" basePrice="40"/> Modified: trunk/18xx/data/1830/Game.xml =================================================================== --- trunk/18xx/data/1830/Game.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/1830/Game.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -15,7 +15,7 @@ <!-- The options in Game.xml are not currently used. See GamesList.xml for the real ones. --> - <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> + <GameOption name="Variant" values="Basegame,Pere Marquette,Coalfields" 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" /> @@ -48,7 +48,7 @@ </EndOfGame> </Component> <Component name="PlayerManager" class="rails.game.PlayerManager"> - <IfOption name="Variant" value="Basegame"> + <IfOption name="Variant" value="Basegame,"> <Players number="2" cash="1200" certLimit="28"/> <Players number="3" cash="800" certLimit="20"/> <Players number="4" cash="600" certLimit="16"/> @@ -63,6 +63,14 @@ <Players number="6" cash="400" certLimit="12"/> <Players number="7" cash="360" certLimit="11"/> </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Players number="2" cash="1200" certLimit="29"/> + <Players number="3" cash="800" certLimit="21"/> + <Players number="4" cash="600" certLimit="17"/> + <Players number="5" cash="480" certLimit="14"/> + <Players number="6" cash="400" certLimit="12"/> + <Players number="7" cash="360" certLimit="11"/> + </IfOption> </Component> <Component name="Bank" class="rails.game.Bank"> <Bank amount="12000"/> Modified: trunk/18xx/data/1830/Map.xml =================================================================== --- trunk/18xx/data/1830/Map.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/1830/Map.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -1,96 +1,149 @@ -<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="vertical" even="B"> - <Hex name="A9" tile="-901" orientation="0" value="30,50" city="Canadian West"/> - <Hex name="A11" tile="-902" orientation="1" value="30,50" city="Canadian West"/> - <Hex name="A17" tile="-7" orientation="1" city="Montreal"/> - <Hex name="A19" tile="-103" orientation="0"/> - <Hex name="B10" tile="-10"/> - <Hex name="B12" tile="0"/> - <Hex name="B14" tile="0"/> - <Hex name="B16" tile="-10" impassable="C17"/> - <Hex name="B18" tile="0" cost="80"/> - <Hex name="B20" tile="-1"/> - <Hex name="B22" tile="0"/> - <Hex name="B24" tile="-902" orientation="2" value="20,30"/> - <Hex name="C7" tile="0"/> - <Hex name="C9" tile="0"/> - <Hex name="C11" tile="0" impassable="D12"/> - <Hex name="C13" tile="0" impassable="D12"/> - <Hex name="C15" tile="-58" orientation="2"/> - <Hex name="C17" tile="0" cost="120"/> - <Hex name="C19" tile="0" cost="80"/> - <Hex name="C21" tile="0" cost="120"/> - <Hex name="C23" tile="0"/> - <Hex name="D2" tile="-5"/> - <Hex name="D4" tile="-1"/> - <Hex name="D6" tile="0" cost="80"/> - <Hex name="D8" tile="0"/> - <Hex name="D10" tile="-20" cost="80" label="OO"/> - <Hex name="D12" tile="0"/> - <Hex name="D14" tile="-102" value="20"/> - <Hex name="D16" tile="0"/> - <Hex name="D18" tile="0"/> - <Hex name="D20" tile="0"/> - <Hex name="D22" tile="0" cost="120"/> - <Hex name="D24" tile="-7" orientation="2"/> - <Hex name="E3" tile="0"/> - <Hex name="E5" tile="-20" label="OO" cost="80"/> - <Hex name="E7" tile="-1" impassable="F8"/> - <Hex name="E9" tile="-7" orientation="4"/> - <Hex name="E11" tile="-20" label="OO"/> - <Hex name="E13" tile="0"/> - <Hex name="E15" tile="0"/> - <Hex name="E17" tile="0" cost="120"/> - <Hex name="E19" tile="-10"/> - <Hex name="E21" tile="0" cost="120"/> - <Hex name="E23" tile="-11" orientation="5" label="B" city="Boston"/> - <Hex name="F2" tile="-903" orientation="5" value="40,70" city="Chicago"/> - <Hex name="F4" tile="-10" cost="80"/> - <Hex name="F6" tile="-105" city="Cleveland"/> - <Hex name="F8" tile="0"/> - <Hex name="F10" tile="-1"/> - <Hex name="F12" tile="0"/> - <Hex name="F14" tile="0"/> - <Hex name="F16" tile="-10" cost="120"/> - <Hex name="F18" tile="0"/> - <Hex name="F20" tile="-2"/> - <Hex name="F22" tile="-10" cost="80"/> - <Hex name="F24" tile="-3" orientation="2"/> - <Hex name="G3" tile="0"/> - <Hex name="G5" tile="0"/> - <Hex name="G7" tile="-2"/> - <Hex name="G9" tile="0"/> - <Hex name="G11" tile="0"/> - <Hex name="G13" tile="0" cost="120"/> - <Hex name="G15" tile="0" cost="120"/> - <Hex name="G17" tile="-2"/> - <Hex name="G19" tile="-21" orientation="1" cost="80" city="New York"/> - <Hex name="H2" tile="0"/> - <Hex name="H4" tile="-10"/> - <Hex name="H6" tile="0"/> - <Hex name="H8" tile="0"/> - <Hex name="H10" tile="-10"/> - <Hex name="H12" tile="-101" home="PRR"/> - <Hex name="H14" tile="0"/> - <Hex name="H16" tile="-10"/> - <Hex name="H18" tile="-20" label="OO"/> - <Hex name="I1" tile="-901" orientation="5" value="30,60" city="Gulf"/> - <Hex name="I3" tile="0"/> - <Hex name="I5" tile="0"/> - <Hex name="I7" tile="0"/> - <Hex name="I9" tile="0"/> - <Hex name="I11" tile="0" cost="120"/> - <Hex name="I13" tile="0"/> - <Hex name="I15" tile="-11" label="B" city="Baltimore"/> - <Hex name="I17" tile="0" cost="80"/> - <Hex name="I19" tile="-3" orientation="2"/> - <Hex name="J2" tile="-902" orientation="5" value="30,60" city="Gulf"/> - <Hex name="J4" tile="0"/> - <Hex name="J6" tile="0"/> - <Hex name="J8" tile="0"/> - <Hex name="J10" tile="0" cost="120"/> - <Hex name="J12" tile="0" cost="120"/> - <Hex name="J14" tile="-10" cost="80" city="Washington"/> - <Hex name="K13" tile="-902" orientation="4" value="30,40" city="Deep South"/> - <Hex name="K15" tile="-104" orientation="3"/> - -</Map> +<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" + letterOrientation="vertical" even="B"> + <Hex name="A9" tile="-901" orientation="0" value="30,50" city="Canadian West"/> + <Hex name="A11" tile="-902" orientation="1" value="30,50" city="Canadian West"/> + <Hex name="A17" tile="-7" orientation="1" city="Montreal"/> + <Hex name="A19" tile="-103" orientation="0"/> + <Hex name="B10" tile="-10"/> + <Hex name="B12" tile="0"/> + <Hex name="B14" tile="0"/> + <Hex name="B16" tile="-10" impassable="C17"/> + <Hex name="B18" tile="0" cost="80"/> + <Hex name="B20" tile="-1"/> + <Hex name="B22" tile="0"/> + <Hex name="B24" tile="-902" orientation="2" value="20,30"/> + <Hex name="C7" tile="0"/> + <Hex name="C9" tile="0"/> + <Hex name="C11" tile="0" impassable="D12"/> + <Hex name="C13" tile="0" impassable="D12"/> + <Hex name="C15" tile="-58" orientation="2"/> + <Hex name="C17" tile="0" cost="120"/> + <Hex name="C19" tile="0" cost="80"/> + <Hex name="C21" tile="0" cost="120"/> + <Hex name="C23" tile="0"/> + <Hex name="D2" tile="-5"/> + <Hex name="D4" tile="-1"/> + <Hex name="D6" tile="0" cost="80"/> + <Hex name="D8" tile="0"/> + <Hex name="D10" tile="-20" cost="80" label="OO"/> + <Hex name="D12" tile="0"/> + <Hex name="D14" tile="-102" value="20"/> + <Hex name="D16" tile="0"/> + <Hex name="D18" tile="0"/> + <Hex name="D20" tile="0"/> + <Hex name="D22" tile="0" cost="120"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="D24" tile="-7" orientation="2"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="D24" tile="-30001"/> + </IfOption> + <Hex name="E3" tile="0"/> + <Hex name="E5" tile="-20" label="OO" cost="80"/> + <Hex name="E7" tile="-1" impassable="F8"/> + <Hex name="E9" tile="-7" orientation="4"/> + <Hex name="E11" tile="-20" label="OO"/> + <Hex name="E13" tile="0"/> + <Hex name="E15" tile="0"/> + <Hex name="E17" tile="0" cost="120"/> + <Hex name="E19" tile="-10"/> + <Hex name="E21" tile="0" cost="120"/> + <Hex name="E23" tile="-11" orientation="5" label="B" city="Boston"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="F2" tile="-903" orientation="5" value="40,70" city="Chicago"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="F2" tile="-939" orientation="5" value="40,70" city="Chicago"/> + </IfOption> + <Hex name="F4" tile="-10" cost="80"/> + <Hex name="F6" tile="-105" city="Cleveland"/> + <Hex name="F8" tile="0"/> + <Hex name="F10" tile="-1"/> + <Hex name="F12" tile="0"/> + <Hex name="F14" tile="0"/> + <Hex name="F16" tile="-10" cost="120"/> + <Hex name="F18" tile="0"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="F20" tile="-2"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="F20" tile="-10"/> + </IfOption> + <Hex name="F22" tile="-10" cost="80"/> + <Hex name="F24" tile="-3" orientation="2"/> + <Hex name="G3" tile="0"/> + <Hex name="G5" tile="0"/> + <Hex name="G7" tile="-2"/> + <Hex name="G9" tile="0"/> + <Hex name="G11" tile="0"/> + <Hex name="G13" tile="0" cost="120"/> + <Hex name="G15" tile="0" cost="120"/> + <Hex name="G17" tile="-2"/> + <Hex name="G19" tile="-21" orientation="1" cost="80" city="New York"/> + <Hex name="H2" tile="0"/> + <Hex name="H4" tile="-10"/> + <Hex name="H6" tile="0"/> + <Hex name="H8" tile="0"/> + <Hex name="H10" tile="-10"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="H12" tile="-101" city="Altoona"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="H12" tile="-30003" pic="-30002" city="Altoona"/> + </IfOption> + <Hex name="H14" tile="0"/> + <Hex name="H16" tile="-10"/> + <Hex name="H18" tile="-20" label="OO"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="I1" tile="-901" orientation="5" value="30,60" city="Gulf"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="I1" tile="0"/> + </IfOption> + <Hex name="I3" tile="0"/> + <Hex name="I5" tile="0"/> + <Hex name="I7" tile="0"/> + <Hex name="I9" tile="0"/> + <Hex name="I11" tile="0" cost="120"/> + <Hex name="I13" tile="0"/> + <Hex name="I15" tile="-11" label="B" city="Baltimore"/> + <Hex name="I17" tile="0" cost="80"/> + <Hex name="I19" tile="-3" orientation="2"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="J2" tile="-902" orientation="5" value="30,60" city="Gulf"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="J2" tile="0"/> + </IfOption> + <Hex name="J4" tile="0"/> + <Hex name="J6" tile="0"/> + <Hex name="J8" tile="0"/> + <Hex name="J10" tile="0" cost="120"/> + <Hex name="J12" tile="0" cost="120"/> + <Hex name="J14" tile="-10" cost="80" city="Washington"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Hex name="K13" tile="-902" orientation="4" value="30,40" city="Deep South"/> + <Hex name="K15" tile="-104" orientation="3"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Hex name="K1" tile="-908"/> + <Hex name="K3" tile="-10" city="Lexington"/> + <Hex name="K5" tile="0"/> + <Hex name="K7" tile="0"/> + <Hex name="K9" tile="-10" cost="120" city="Christiansburg"/> + <Hex name="K11" tile="0" cost="120"/> + <Hex name="K13" tile="-10" city="Richmond"/> + <Hex name="K15" tile="0" cost="40"/> + <Hex name="L2" tile="-939" orientation="4" value="30,60" city="Gulf"/> + <Hex name="L4" tile="0"/> + <Hex name="L6" tile="0" cost="120"/> + <Hex name="L8" tile="0" cost="120"/> + <Hex name="L10" tile="-30004" value="40,60" city="Coalfields"/> + <Hex name="L12" tile="0"/> + <Hex name="L14" tile="0"/> + <Hex name="L16" tile="-30005" value="30,50" city="Norfolk"/> + <Hex name="M11" tile="0"/> + <Hex name="M13" tile="-903" orientation="3" value="30,40" city="Deep South"/> + </IfOption> + +</Map> \ No newline at end of file Modified: trunk/18xx/data/1830/TileSet.xml =================================================================== --- trunk/18xx/data/1830/TileSet.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/1830/TileSet.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -16,7 +16,12 @@ <Upgrade id="57"/> </Tile> <Tile id="-11"><!-- B yellow --> - <Upgrade id="53"/> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Upgrade id="53"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="2053"/> + </IfOption> </Tile> <Tile id="-20"><!-- 2 OO cities --> <Upgrade id="59" relayBaseTokens="yes"/> @@ -28,15 +33,29 @@ <Tile id="-101"/><!-- Altoona --> <Tile id="-102"/><!-- Rochester --> <Tile id="-103"/><!-- Montreal --> - <Tile id="-104"/><!-- Norwich --> + <Tile id="-104"/><!-- Norfolk --> <Tile id="-105"/><!-- Cleveland --> <Tile id="-901"/> <Tile id="-902"/> <Tile id="-903"/> + <Tile id="-908"/><!-- Coalfields: K1 --> + <Tile id="-939"/><!-- Coalfields: Chicago --> + <Tile id="-30001"/><!-- Coalfields: N of Boston --> + <Tile id="-30003" pic="-30002"/><!-- Coalfields: Altoona --> + <Tile id="-30004"/><!-- Coalfields: Coalfields --> + <Tile id="-30005"/><!-- Coalfields: Norfolk --> <!-- Yellow tiles --> - <Tile id="1" quantity="1" /> - <Tile id="2" quantity="1" /> + <Tile id="1" quantity="1"> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1717" hex="G17" /> + </IfOption> + </Tile> + <Tile id="2" quantity="1"> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1717" hex="G17" /> + </IfOption> + </Tile> <Tile id="3" quantity="2" /> <Tile id="4" quantity="2" /> <Tile id="7" quantity="4"> @@ -48,19 +67,49 @@ <Tile id="9" quantity="7"> <Upgrade id="18,19,20,23,24,26,27" /> </Tile> - <Tile id="55" quantity="1" /> - <Tile id="56" quantity="1" /> - <Tile id="57" quantity="4"> + <Tile id="55" quantity="1"> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1717" hex="G17" /> + </IfOption> + </Tile> + <Tile id="56" quantity="1"> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1717" hex="G17" /> + </IfOption> + </Tile> + <Tile id="57"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes quantity="4"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Attributes quantity="6"/> + </IfOption> <Upgrade id="14,15" /> </Tile> <Tile id="58" quantity="2" /> - <Tile id="69" quantity="1" /> + <Tile id="69" quantity="1"> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1717" hex="G17" /> + </IfOption> + </Tile> <!-- Green tiles --> - <Tile id="14" quantity="3"> + <Tile id="14"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes quantity="3"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Attributes quantity="4"/> + </IfOption> <Upgrade id="63" /> </Tile> <Tile id="15" quantity="2"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes quantity="2"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Attributes quantity="3"/> + </IfOption> <Upgrade id="63" /> </Tile> <Tile id="16" quantity="1"> @@ -96,15 +145,29 @@ <Tile id="29" quantity="1"> <Upgrade id="39,43,45,70" /> </Tile> - <Tile id="53" quantity="2"> - <Upgrade id="61" /> - </Tile> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Tile id="53" quantity="2"> + <Upgrade id="61" /> + </Tile> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Tile id="2053" extId="53" quantity="2"> + <Upgrade id="1061" hex="E23" /> + <Upgrade id="2061" hex="I15" /> + </Tile> + </IfOption> <Tile id="54" quantity="1"> - <Upgrade id="62" /> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Upgrade id="62" /> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Upgrade id="1062" extId="62"/> + </IfOption> </Tile> <Tile id="59" quantity="2"> <Upgrade id="64,65,66,67,68" /> </Tile> + <!-- Brown tiles --> <Tile id="39" quantity="1" /> <Tile id="40" quantity="1" /> @@ -115,13 +178,34 @@ <Tile id="45" quantity="2" /> <Tile id="46" quantity="2" /> <Tile id="47" quantity="1" /> - <Tile id="61" quantity="2" /> - <Tile id="62" quantity="1" /> - <Tile id="63" quantity="3" /> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Tile id="61" quantity="2" /> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Tile id="1061" extId="61" quantity="1" /> + <Tile id="2061" extId="BA" quantity="1" /> + </IfOption> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Tile id="62" quantity="1" /> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Tile id="1062" extId="62" quantity="1" /> + </IfOption> + <Tile id="63"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes quantity="3"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Attributes quantity="4"/> + </IfOption> + </Tile> <Tile id="64" quantity="1" /> <Tile id="65" quantity="1" /> <Tile id="66" quantity="1" /> <Tile id="67" quantity="1" /> <Tile id="68" quantity="1" /> <Tile id="70" quantity="1" /> + <IfOption name="Variant" value="Coalfields"> + <Tile id="1717" extId="G17" quantity="1" /> + </IfOption> </TileManager> Modified: trunk/18xx/data/1830/Tiles.xml =================================================================== --- trunk/18xx/data/1830/Tiles.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/1830/Tiles.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -1,288 +1,425 @@ -<?xml version="1.0" encoding="UTF-8"?><Tiles><Tile colour="white" id="0" name="empty"/><Tile colour="white" id="-1" name="1 village"> - <Station id="city1" position="002" type="Town"/> - </Tile><Tile colour="white" id="-2" name="2 villages"> - <Station id="city1" position="102" type="Town"/> - <Station id="city2" position="302" type="Town"/> - </Tile><Tile colour="fixed" id="-3" name="MF 3"> - <Station id="city1" position="252" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side3"/> - </Tile><Tile colour="fixed" id="-5" name="MF 5"> - <Station id="city1" position="0" slots="1" type="City" value="20"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side1"/> - </Tile><Tile colour="fixed" id="-7" name="MF 7"> - <Track from="side2" gauge="normal" to="side1"/> - </Tile><Tile colour="white" id="-10" name="1 city"> - <Station id="city1" position="302" slots="1" type="City"/> - </Tile><Tile colour="yellow" id="-11" name="B"> - <Station id="city1" position="0" slots="1" type="City" value="30"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - </Tile><Tile colour="yellow" id="-20" name="2 cities"> - <Station id="city1" position="002" slots="1" type="City"/> - <Station id="city2" position="302" slots="1" type="City"/> - </Tile><Tile colour="yellow" id="-21" name="NY"> - <Station id="city1" position="202" slots="1" type="City" value="40"/> - <Station id="city2" position="502" slots="1" type="City" value="40"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city2" gauge="normal" to="side5"/> - </Tile><Tile colour="fixed" id="-58" name="MF 58"> - <Station id="city1" position="301" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side4"/> - </Tile><Tile colour="fixed" id="-101" name="Philadelphia"> - <Station id="city1" position="0" slots="1" type="City" value="10"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="side4" gauge="normal" to="side1"/> - </Tile><Tile colour="fixed" id="-102" name="-102"> - <Station id="city1" position="251" slots="1" type="City" value="20"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - </Tile><Tile colour="fixed" id="-103" name="MF 103"> - <Station id="city1" position="0" slots="1" type="City" value="40"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side3"/> - </Tile><Tile colour="fixed" id="-104" name="MF 104"> - <Station id="city1" position="0" slots="1" type="City" value="20"/> - <Track from="city1" gauge="normal" to="side2"/> - </Tile><Tile colour="fixed" id="-105" name="MF 105"> - <Station id="city1" position="0" slots="1" type="City" value="30"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side3"/> - </Tile><Tile colour="red" id="-901" name="OM 1 way"> - <Station id="city1" position="0" type="OffMapCity" value="-1"/> - <Track from="city1" gauge="normal" to="side2"/> - </Tile><Tile colour="red" id="-902" name="OM 2 way"> - <Station id="city1" position="0" type="OffMapCity" value="-1"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side1"/> - </Tile><Tile colour="red" id="-903" name="OM 3 way"> - <Station id="city1" position="0" type="OffMapCity" value="-1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side1"/> - </Tile><Tile colour="yellow" id="1" name="1"> - <Station id="city1" position="408" type="Town" value="10"/> - <Station id="city2" position="108" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side0"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city2" gauge="normal" to="side1"/> - <Track from="city2" gauge="normal" to="side3"/> - </Tile><Tile colour="yellow" id="2" name="2"> - <Station id="city1" position="302" type="Town" value="10"/> - <Station id="city2" position="109" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side0"/> - <Track from="city2" gauge="normal" to="side1"/> - <Track from="city2" gauge="normal" to="side2"/> - </Tile><Tile colour="yellow" id="3" name="3"> - <Station id="city1" position="352" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - </Tile><Tile colour="yellow" id="4" name="4"> - <Station id="city1" position="0" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="yellow" id="7" name="7"> - <Track from="side3" gauge="normal" to="side4"/> - </Tile><Tile colour="yellow" id="8" name="8"> - <Track from="side3" gauge="normal" to="side5"/> - </Tile><Tile colour="yellow" id="9" name="9"> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="yellow" id="55" name="55"> - <Station id="city1" position="202" type="Town" value="10"/> - <Station id="city2" position="302" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city2" gauge="normal" to="side3"/> - <Track from="city2" gauge="normal" to="side0"/> - </Tile><Tile colour="yellow" id="56" name="56"> - <Station id="city1" position="407" type="Town" value="10"/> - <Station id="city2" position="108" type="Town" value="10"/> - <Track from="city2" gauge="normal" to="side1"/> - <Track from="city2" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city1" gauge="normal" to="side2"/> - </Tile><Tile colour="yellow" id="57" name="57"> - <Station id="city1" position="0" slots="1" type="City" value="20"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="yellow" id="58" name="58"> - <Station id="city1" position="401" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city1" gauge="normal" to="side3"/> - </Tile><Tile colour="yellow" id="69" name="69"> - <Station id="city1" position="407" type="Town" value="10"/> - <Station id="city2" position="002" type="Town" value="10"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city2" gauge="normal" to="side0"/> - <Track from="city2" gauge="normal" to="side3"/> - </Tile><Tile colour="green" id="14" name="14"> - <Station id="city1" position="0" slots="2" type="City" value="30"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="15" name="15"> - <Station id="city1" position="0" slots="2" type="City" value="30"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="16" name="16"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side4" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="18" name="18"> - <Track from="side3" gauge="normal" to="side0"/> - <Track from="side4" gauge="normal" to="side5"/> - </Tile><Tile colour="green" id="19" name="19"> - <Track from="side5" gauge="normal" to="side1"/> - <Track from="side0" gauge="normal" to="side3"/> - </Tile><Tile colour="green" id="20" name="20"> - <Track from="side1" gauge="normal" to="side4"/> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="23" name="23"> - <Track from="side4" gauge="normal" to="side0"/> - <Track from="side0" gauge="normal" to="side3"/> - </Tile><Tile colour="green" id="24" name="24"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="25" name="25"> - <Track from="side1" gauge="normal" to="side3"/> - <Track from="side3" gauge="normal" to="side5"/> - </Tile><Tile colour="green" id="26" name="26"> - <Track from="side5" gauge="normal" to="side0"/> - <Track from="side0" gauge="normal" to="side3"/> - </Tile><Tile colour="green" id="27" name="27"> - <Track from="side3" gauge="normal" to="side4"/> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="28" name="28"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side4" gauge="normal" to="side5"/> - </Tile><Tile colour="green" id="29" name="29"> - <Track from="side3" gauge="normal" to="side4"/> - <Track from="side3" gauge="normal" to="side5"/> - </Tile><Tile colour="green" id="53" name="53"> - <Station id="city1" position="0" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side5"/> - </Tile><Tile colour="green" id="54" name="54"> - <Station id="city1" position="352" slots="1" type="City" value="60"/> - <Station id="city2" position="552" slots="1" type="City" value="60"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city2" gauge="normal" to="side5"/> - <Track from="city2" gauge="normal" to="side0"/> - </Tile><Tile colour="green" id="59" name="59"> - <Station id="city1" position="052" slots="1" type="City" value="40"/> - <Station id="city2" position="352" slots="1" type="City" value="40"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city2" gauge="normal" to="side3"/> - </Tile><Tile colour="brown" id="39" name="39"> - <Track from="side3" gauge="normal" to="side4"/> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side4" gauge="normal" to="side5"/> - </Tile><Tile colour="brown" id="40" name="40"> - <Track from="side1" gauge="normal" to="side3"/> - <Track from="side1" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side5"/> - </Tile><Tile colour="brown" id="41" name="41"> - <Track from="side4" gauge="normal" to="side0"/> - <Track from="side4" gauge="normal" to="side3"/> - <Track from="side0" gauge="normal" to="side3"/> - </Tile><Tile colour="brown" id="42" name="42"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side0"/> - <Track from="side5" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="43" name="43"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side0"/> - <Track from="side4" gauge="normal" to="side5"/> - <Track from="side4" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="44" name="44"> - <Track from="side3" gauge="normal" to="side0"/> - <Track from="side1" gauge="normal" to="side0"/> - <Track from="side3" gauge="normal" to="side4"/> - <Track from="side1" gauge="normal" to="side4"/> - </Tile><Tile colour="brown" id="45" name="45"> - <Track from="side1" gauge="normal" to="side5"/> - <Track from="side1" gauge="normal" to="side3"/> - <Track from="side5" gauge="normal" to="side0"/> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="46" name="46"> - <Track from="side1" gauge="normal" to="side5"/> - <Track from="side1" gauge="normal" to="side0"/> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="47" name="47"> - <Track from="side3" gauge="normal" to="side0"/> - <Track from="side3" gauge="normal" to="side1"/> - <Track from="side4" gauge="normal" to="side0"/> - <Track from="side4" gauge="normal" to="side1"/> - </Tile><Tile colour="brown" id="61" name="61"> - <Station id="city1" position="0" slots="1" type="City" value="60"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="62" name="62"> - <Station id="city1" position="302" slots="2" type="City" value="80"/> - <Station id="city2" position="002" slots="2" type="City" value="80"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city2" gauge="normal" to="side5"/> - <Track from="city2" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="63" name="63"> - <Station id="city1" position="0" slots="2" type="City" value="40"/> - <Track from="city1" gauge="normal" to="side0"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side2"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city1" gauge="normal" to="side5"/> - </Tile><Tile colour="brown" id="64" name="64"> - <Station id="city1" position="401" slots="1" type="City" value="50"/> - <Station id="city2" position="052" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city2" gauge="normal" to="side1"/> - <Track from="city2" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="65" name="65"> - <Station id="city1" position="501" slots="1" type="City" value="50"/> - <Station id="city2" position="252" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side4"/> - <Track from="city1" gauge="normal" to="side0"/> - <Track from="city2" gauge="normal" to="side2"/> - <Track from="city2" gauge="normal" to="side3"/> - </Tile><Tile colour="brown" id="66" name="66"> - <Station id="city1" position="002" slots="1" type="City" value="50"/> - <Station id="city2" position="452" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city1" gauge="normal" to="side0"/> - <Track from="city2" gauge="normal" to="side4"/> - <Track from="city2" gauge="normal" to="side5"/> - </Tile><Tile colour="brown" id="67" name="67"> - <Station id="city1" position="307" slots="1" type="City" value="50"/> - <Station id="city2" position="502" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side1"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city2" gauge="normal" to="side5"/> - <Track from="city2" gauge="normal" to="side2"/> - </Tile><Tile colour="brown" id="68" name="68"> - <Station id="city1" position="302" slots="1" type="City" value="50"/> - <Station id="city2" position="502" slots="1" type="City" value="50"/> - <Track from="city1" gauge="normal" to="side3"/> - <Track from="city2" gauge="normal" to="side2"/> - <Track from="city2" gauge="normal" to="side5"/> - <Track from="city1" gauge="normal" to="side0"/> - </Tile><Tile colour="brown" id="70" name="70"> - <Track from="side3" gauge="normal" to="side5"/> - <Track from="side3" gauge="normal" to="side4"/> - <Track from="side5" gauge="normal" to="side0"/> - <Track from="side4" gauge="normal" to="side0"/> - </Tile></Tiles> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<Tiles> + <Tile colour="white" id="0" name="empty"/> + <Tile colour="white" id="-1" name="1 village"> + <Station id="city1" position="002" type="Town"/> + </Tile> + <Tile colour="white" id="-2" name="2 villages"> + <Station id="city1" position="102" type="Town"/> + <Station id="city2" position="302" type="Town"/> + </Tile> + <Tile colour="fixed" id="-3" name="MF 3"> + <Station id="city1" position="352" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="fixed" id="-5" name="MF 5"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile> + <Tile colour="fixed" id="-7" name="MF 7"> + <Track from="side2" gauge="normal" to="side1"/> + </Tile> + <Tile colour="white" id="-10" name="1 city"> + <Station id="city1" position="302" slots="1" type="City"/> + </Tile> + <Tile colour="yellow" id="-11" name="B"> + <Station id="city1" position="0" slots="1" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="yellow" id="-20" name="2 cities"> + <Station id="city1" position="002" slots="1" type="City"/> + <Station id="city2" position="302" slots="1" type="City"/> + </Tile> + <Tile colour="yellow" id="-21" name="NY"> + <Station id="city1" position="202" slots="1" type="City" value="40"/> + <Station id="city2" position="502" slots="1" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city2" gauge="normal" to="side5"/> + </Tile> + <Tile colour="fixed" id="-58" name="MF 58"> + <Station id="city1" position="301" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="fixed" id="-101" name="Philadelphia"> + <Station id="city1" position="0" slots="1" type="City" value="10"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="side4" gauge="normal" to="side1"/> + </Tile> + <Tile colour="fixed" id="-102" name="-102"> + <Station id="city1" position="351" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="fixed" id="-103" name="MF 103"> + <Station id="city1" position="0" slots="1" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="fixed" id="-104" name="MF 104"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="fixed" id="-105" name="MF 105"> + <Station id="city1" position="0" slots="1" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="red" id="-901" name="OM 1 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="red" id="-902" name="OM 2 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile> + <Tile colour="red" id="-903" name="OM 3 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile> + <Tile colour="red" id="-908" name="OM wide curve"> + <Track from="side0" gauge="normal" to="side2"/> + </Tile> + <Tile colour="red" id="-939" name="Goderich"> + <Track from="side3" gauge="normal" to="side1"/> + <Track from="side3" gauge="normal" to="side2"/> + <Track from="side2" gauge="normal" to="side1"/> + </Tile> + <Tile colour="fixed" id="-30001" name="N of Boston"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side4"/> + </Tile> + <Tile colour="fixed" id="-30003" name="Altoon intern"> + <Station id="city1" position="052" slots="1" type="City" value="10"/> + <Track from="side4" gauge="normal" to="side1"/> + <Track from="side4" gauge="normal" to="side2"/> + <Track from="side1" gauge="normal" to="side2"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="fixed" id="-30004" name="Coalfields"> + <Station id="city1" position="0" type="Town"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="fixed" id="-30005" name="Norfolk"> + <Station id="city1" position="0" slots="1" type="City"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="yellow" id="1" name="1"> + <Station id="city1" position="408" type="Town" value="10"/> + <Station id="city2" position="108" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="yellow" id="2" name="2"> + <Station id="city1" position="302" type="Town" value="10"/> + <Station id="city2" position="109" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side2"/> + </Tile> + <Tile colour="yellow" id="3" name="3"> + <Station id="city1" position="452" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="yellow" id="4" name="4"> + <Station id="city1" position="0" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="yellow" id="7" name="7"> + <Track from="side3" gauge="normal" to="side4"/> + </Tile> + <Tile colour="yellow" id="8" name="8"> + <Track from="side3" gauge="normal" to="side5"/> + </Tile> + <Tile colour="yellow" id="9" name="9"> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="yellow" id="55" name="55"> + <Station id="city1" position="202" type="Town" value="10"/> + <Station id="city2" position="302" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side3"/> + <Track from="city2" gauge="normal" to="side0"/> + </Tile> + <Tile colour="yellow" id="56" name="56"> + <Station id="city1" position="407" type="Town" value="10"/> + <Station id="city2" position="108" type="Town" value="10"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="yellow" id="57" name="57"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="yellow" id="58" name="58"> + <Station id="city1" position="401" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="yellow" id="69" name="69"> + <Station id="city1" position="407" type="Town" value="10"/> + <Station id="city2" position="002" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side0"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="14" name="14"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="15" name="15"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="16" name="16"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="18" name="18"> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="19" name="19"> + <Track from="side5" gauge="normal" to="side1"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="20" name="20"> + <Track from="side1" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="23" name="23"> + <Track from="side4" gauge="normal" to="side0"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="24" name="24"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="25" name="25"> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="26" name="26"> + <Track from="side5" gauge="normal" to="side0"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="27" name="27"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="28" name="28"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="29" name="29"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="53" name="53"> + <Station id="city1" position="0" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="2053" name="B Coalfields"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="54" name="54"> + <Station id="city1" position="452" slots="1" type="City" value="60"/> + <Station id="city2" position="052" slots="1" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="59" name="59"> + <Station id="city1" position="152" slots="1" type="City" value="40"/> + <Station id="city2" position="452" slots="1" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="brown" id="39" name="39"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="40" name="40"> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side1" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="41" name="41"> + <Track from="side4" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile> + <Tile colour="brown" id="42" name="42"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side5" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="43" name="43"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="44" name="44"> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side1" gauge="normal" to="side0"/> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="brown" id="45" name="45"> + <Track from="side1" gauge="normal" to="side5"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side5" gauge="normal" to="side0"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="46" name="46"> + <Track from="side1" gauge="normal" to="side5"/> + <Track from="side1" gauge="normal" to="side0"/> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="47" name="47"> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side3" gauge="normal" to="side1"/> + <Track from="side4" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side1"/> + </Tile> + <Tile colour="brown" id="61" name="61"> + <Station id="city1" position="0" slots="1" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="1061" name="B Coalfields"> + <Station id="city1" position="0" slots="2" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="brown" id="2061" name="BA Coalfields"> + <Station id="city1" position="0" slots="3" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="brown" id="62" name="62"> + <Station id="city1" position="302" slots="2" type="City" value="80"/> + <Station id="city2" position="002" slots="2" type="City" value="80"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="1062" name="NY Coalfields"> + <Station id="city1" position="0" slots="4" type="City" value="80"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="63" name="63"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="64" name="64"> + <Station id="city1" position="401" slots="1" type="City" value="50"/> + <Station id="city2" position="152" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="65" name="65"> + <Station id="city1" position="501" slots="1" type="City" value="50"/> + <Station id="city2" position="352" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city2" gauge="normal" to="side2"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="brown" id="66" name="66"> + <Station id="city1" position="002" slots="1" type="City" value="50"/> + <Station id="city2" position="552" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city2" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="67" name="67"> + <Station id="city1" position="307" slots="1" type="City" value="50"/> + <Station id="city2" position="502" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city2" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side2"/> + </Tile> + <Tile colour="brown" id="68" name="68"> + <Station id="city1" position="302" slots="1" type="City" value="50"/> + <Station id="city2" position="502" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city2" gauge="normal" to="side2"/> + <Track from="city2" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="70" name="70"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side5" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side0"/> + </Tile> + <Tile colour="brown" id="1717" name="G17"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> +</Tiles> \ No newline at end of file Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/data/GamesList.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -10,6 +10,7 @@ Limitations: - The M&H/NYC share swap can only be executed in the SR, in the owning player's turn. - Privates cannot be traded between players. +- The Coalfields variant is currently in development stage. </Description> <!-- GAME OPTIONS must have: - a name, which must also exist as an entry in LocalText.properties, @@ -21,7 +22,7 @@ - optionally, a default value (only affects a toggle; in a dropdown the first item is always the default). --> - <Option name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> + <Option name="Variant" values="Basegame,Pere Marquette,Coalfields" 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" /> Modified: trunk/18xx/rails/game/TileManager.java =================================================================== --- trunk/18xx/rails/game/TileManager.java 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/rails/game/TileManager.java 2011-02-13 18:07:34 UTC (rev 1485) @@ -3,6 +3,8 @@ import java.util.*; +import org.apache.log4j.Logger; + import rails.util.LocalText; import rails.util.Tag; @@ -14,6 +16,9 @@ // private static List<String> directories = new ArrayList<String>(); private List<String> directories = new ArrayList<String>(); + protected static Logger log = + Logger.getLogger(TileManager.class.getPackage().getName()); + /** * No-args constructor. */ @@ -85,8 +90,7 @@ throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { - throw new ConfigurationException(LocalText.getText( - "TileMissingInTileSet", String.valueOf(tileId))); + log.warn ("Tile #"+tileId+" exists in Tiles.xml but not in TileSet.xml (this can be OK if the tile only exists in some variants"); } tileDefMap.put(tileId, tileDefTag); } Modified: trunk/18xx/rails/util/Tag.java =================================================================== --- trunk/18xx/rails/util/Tag.java 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/rails/util/Tag.java 2011-02-13 18:07:34 UTC (rev 1485) @@ -265,6 +265,8 @@ String childTagName; Node attribute; String name, value; + List<String> valueList; + String[] valueArray; StringBuffer textBuffer = new StringBuffer(); for (int i = 0; i < childNodes.getLength(); i++) { @@ -297,6 +299,7 @@ throw new ConfigurationException( "IfOption has no optionValue attribute"); value = valueAttr.getNodeValue(); + valueList = Arrays.asList(value.split(",")); // Check if the option has been chosen; if not, skip the // rest @@ -327,7 +330,8 @@ } - if (optionValue.equalsIgnoreCase(value)) { + //if (optionValue.equalsIgnoreCase(value)) { + if (valueList.contains(optionValue)) { parseSubTags(childElement); } } else { Property changes on: trunk/18xx/tiles ___________________________________________________________________ Modified: svn:ignore - Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini + Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o Modified: trunk/18xx/tiles/TileDictionary.18t =================================================================== (Binary files differ) Modified: trunk/18xx/tiles/TileDictionary.xml =================================================================== --- trunk/18xx/tiles/TileDictionary.xml 2011-02-11 22:53:26 UTC (rev 1484) +++ trunk/18xx/tiles/TileDictionary.xml 2011-02-13 18:07:34 UTC (rev 1485) @@ -20197,7 +20197,7 @@ <ID>119</ID> ... [truncated message content] |
From: <ev...@us...> - 2011-02-15 22:40:23
|
Revision: 1487 http://rails.svn.sourceforge.net/rails/?rev=1487&view=rev Author: evos Date: 2011-02-15 22:40:16 +0000 (Tue, 15 Feb 2011) Log Message: ----------- 1830 Coalfields: configured available trains and train obsolescence Modified Paths: -------------- trunk/18xx/data/1830/Game.xml trunk/18xx/rails/game/TrainManager.java trunk/18xx/rails/game/TrainType.java trunk/18xx/rails/game/TrainTypeI.java Modified: trunk/18xx/data/1830/Game.xml =================================================================== --- trunk/18xx/data/1830/Game.xml 2011-02-13 19:57:47 UTC (rev 1486) +++ trunk/18xx/data/1830/Game.xml 2011-02-15 22:40:16 UTC (rev 1487) @@ -99,13 +99,15 @@ cities="double" if city-revenue is doubled (e.g. 1826 TGV). --> </Defaults> - <Train name="2" majorStops="2" cost="80" amount="6"/> - <Train name="3" majorStops="3" cost="180" amount="5" startPhase="3"/> - <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4" - rustedTrain="2"/> + <Train name="2" majorStops="2" cost="80" amount="6" obsoleting="yes"/> + <Train name="3" majorStops="3" cost="180" amount="5" obsoleting="yes" startPhase="3"/> + <Train name="4" majorStops="4" cost="300" amount="4" obsoleting="yes" startPhase="4" + rustedTrain="2"> + <IfOption name="Variant" value="Coalfields"> + <Attributes amount="5"/> + </IfOption> + </Train> <Train name="5" majorStops="5" cost="450" amount="3" startPhase="5"/> - <!--Train name="6" majorStops="6" cost="630" amount="2" startPhase="6" - rustedTrain="3" releasedTrain="D"/--> <Train name="6" majorStops="6" cost="630" startPhase="6" rustedTrain="3" releasedTrain="D"> <IfOption name="WithOptional6Train" value="yes"> @@ -114,12 +116,22 @@ <IfOption name="WithOptional6Train" value="no"> <Attributes amount="2"/> </IfOption> - <IfOption name="Variant" value="Pere Marquette"> - <Attributes amount="3"/> + <IfOption name="Variant" value="Pere Marquette,Coalfields"> + <Attributes amount="3" releasedTrain="7,D"/> </IfOption> </Train> - <Train name="D" majorStops="99" cost="1100" startPhase="D" - rustedTrain="4"> + <IfOption name="Variant" value="Coalfields"> + <Train name="7" majorStops="7" cost="710" amount="2"/> + </IfOption> + <Train name="D" majorStops="99" startPhase="D" rustedTrain="4"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes cost="1100"/> + <Exchange cost="800"/> + </IfOption> + <IfOption name="Variant" value="Coalfields"> + <Attributes cost="900"/> + <Exchange cost="750"/> + </IfOption> <IfOption name="UnlimitedTopTrains" value="yes"> <Attributes amount="-1"/> </IfOption> Modified: trunk/18xx/rails/game/TrainManager.java =================================================================== --- trunk/18xx/rails/game/TrainManager.java 2011-02-13 19:57:47 UTC (rev 1486) +++ trunk/18xx/rails/game/TrainManager.java 2011-02-15 22:40:16 UTC (rev 1487) @@ -84,8 +84,12 @@ // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { - if (type.getReleasedTrainTypeName() != null) { - type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); + if (type.getReleasedTrainTypeNames() != null) { + List<TrainTypeI> rtts = new ArrayList<TrainTypeI>(2); + for (String ttName : type.getReleasedTrainTypeNames().split(",")) { + rtts.add (mTrainTypes.get(ttName)); + } + type.setReleasedTrainTypes(rtts); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); @@ -173,11 +177,15 @@ trainAvailabilityChanged = true; } - TrainTypeI releasedType = boughtType.getReleasedTrainType(); - if (releasedType != null) { - if (!releasedType.isAvailable()) releasedType.setAvailable(bank); - ReportBuffer.add(LocalText.getText("TrainsAvailable", + List<TrainTypeI> releasedTypes = boughtType.getReleasedTrainTypes(); + if (releasedTypes != null) { + for (TrainTypeI releasedType : releasedTypes) { + if (!releasedType.isAvailable()) { + releasedType.setAvailable(bank); + ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); + } + } trainAvailabilityChanged = true; } } Modified: trunk/18xx/rails/game/TrainType.java =================================================================== --- trunk/18xx/rails/game/TrainType.java 2011-02-13 19:57:47 UTC (rev 1486) +++ trunk/18xx/rails/game/TrainType.java 2011-02-15 22:40:16 UTC (rev 1487) @@ -2,6 +2,7 @@ package rails.game; import java.util.ArrayList; +import java.util.List; import org.apache.log4j.Logger; @@ -60,8 +61,8 @@ private String rustedTrainTypeName = null; protected TrainTypeI rustedTrainType = null; - private String releasedTrainTypeName = null; - protected TrainTypeI releasedTrainType = null; + private String releasedTrainTypeNames = null; + protected List<TrainTypeI> releasedTrainTypes = null; protected ArrayList<TrainI> trains = null; @@ -141,7 +142,7 @@ rustedTrainTypeName = tag.getAttributeAsString("rustedTrain"); // Other train type released for buying - releasedTrainTypeName = tag.getAttributeAsString("releasedTrain"); + releasedTrainTypeNames = tag.getAttributeAsString("releasedTrain"); // Can run as obsolete train obsoleting = tag.getAttributeAsBoolean("obsoleting"); @@ -331,10 +332,10 @@ } /** - * @return Returns the releasedTrainType. + * @return Returns the releasedTrainTypes. */ - public TrainTypeI getReleasedTrainType() { - return releasedTrainType; + public List<TrainTypeI> getReleasedTrainTypes() { + return releasedTrainTypes; } /** @@ -368,8 +369,8 @@ /** * @return Returns the releasedTrainTypeName. */ - public String getReleasedTrainTypeName() { - return releasedTrainTypeName; + public String getReleasedTrainTypeNames() { + return releasedTrainTypeNames; } /** @@ -386,8 +387,8 @@ /** * @param releasedTrainType The releasedTrainType to set. */ - public void setReleasedTrainType(TrainTypeI releasedTrainType) { - this.releasedTrainType = releasedTrainType; + public void setReleasedTrainTypes(List<TrainTypeI> releasedTrainTypes) { + this.releasedTrainTypes = releasedTrainTypes; } /** @@ -483,8 +484,8 @@ if (rustedTrainTypeName != null) { appendInfoText(b, LocalText.getText("RustsTrains", rustedTrainTypeName)); } - if (releasedTrainTypeName != null) { - appendInfoText(b, LocalText.getText("ReleasesTrains", releasedTrainTypeName)); + if (releasedTrainTypeNames != null) { + appendInfoText(b, LocalText.getText("ReleasesTrains", releasedTrainTypeNames)); } if (b.length() == 6) b.append(LocalText.getText("None")); Modified: trunk/18xx/rails/game/TrainTypeI.java =================================================================== --- trunk/18xx/rails/game/TrainTypeI.java 2011-02-13 19:57:47 UTC (rev 1486) +++ trunk/18xx/rails/game/TrainTypeI.java 2011-02-15 22:40:16 UTC (rev 1487) @@ -1,6 +1,8 @@ /* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/game/TrainTypeI.java,v 1.14 2010/03/04 22:08:09 evos Exp $ */ package rails.game; +import java.util.List; + public interface TrainTypeI extends ConfigurableComponentI, Cloneable { @@ -51,7 +53,7 @@ /** * @return Returns the releasedTrainType. */ - public TrainTypeI getReleasedTrainType(); + public List<TrainTypeI> getReleasedTrainTypes(); /** * @return Returns the rustedTrainType. @@ -91,7 +93,7 @@ public boolean hasRusted(); - public String getReleasedTrainTypeName(); + public String getReleasedTrainTypeNames(); public String getRustedTrainTypeName(); @@ -99,7 +101,7 @@ public void setPermanent(boolean permanent); - public void setReleasedTrainType(TrainTypeI releasedTrainType); + public void setReleasedTrainTypes(List<TrainTypeI> releasedTrainTypes); public void setRustedTrainType(TrainTypeI rustedTrainType); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-02-24 21:37:11
|
Revision: 1490 http://rails.svn.sourceforge.net/rails/?rev=1490&view=rev Author: evos Date: 2011-02-24 21:37:04 +0000 (Thu, 24 Feb 2011) Log Message: ----------- Fixed in 1856: CGR could payout from a 4-train. It must withhold. Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/game/specific/_1856/OperatingRound_1856.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-02-20 23:37:32 UTC (rev 1489) +++ trunk/18xx/LocalisedText.properties 2011-02-24 21:37:04 UTC (rev 1490) @@ -380,6 +380,7 @@ MustBuyExtraShareAsPresident={0} must buy an extra {1} {2}% share to obtain the President's certificate MustBuyTrainIfNoRoute=You must buy a train unless you have no route MustRepayLoans={0} must repay {1} loans of {2} for {3} +MustWithholdUntilPermanent={0} must withhold revenue until it owns a permanent train NamesTrain={0} names {1}-train as {2} NegativeAmountNotAllowed=Negative amount {0} not allowed NetworkInfo=Network Info Modified: trunk/18xx/rails/game/specific/_1856/OperatingRound_1856.java =================================================================== --- trunk/18xx/rails/game/specific/_1856/OperatingRound_1856.java 2011-02-20 23:37:32 UTC (rev 1489) +++ trunk/18xx/rails/game/specific/_1856/OperatingRound_1856.java 2011-02-24 21:37:04 UTC (rev 1490) @@ -105,14 +105,14 @@ if (operatingCompany.get().canRunTrains()) { if (operatingCompany.get() instanceof PublicCompany_CGR - && ((PublicCompany_CGR)operatingCompany.get()).runsWithBorrowedTrain()) { - DisplayBuffer.add(LocalText.getText("RunsWithBorrowedTrain", - PublicCompany_CGR.NAME, "D")); - possibleActions.add(new SetDividend( - operatingCompany.get().getLastRevenue(), true, - new int[] {SetDividend.WITHHOLD })); + && !((PublicCompany_CGR)operatingCompany.get()).hadPermanentTrain()) { + DisplayBuffer.add(LocalText.getText("MustWithholdUntilPermanent", + PublicCompany_CGR.NAME)); + possibleActions.add(new SetDividend( + operatingCompany.get().getLastRevenue(), true, + new int[] {SetDividend.WITHHOLD })); } else { - + int[] allowedRevenueActions = operatingCompany.get().isSplitAlways() ? new int[] { SetDividend.SPLIT } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-05 20:10:48
|
Revision: 1492 http://rails.svn.sourceforge.net/rails/?rev=1492&view=rev Author: evos Date: 2011-03-05 20:10:40 +0000 (Sat, 05 Mar 2011) Log Message: ----------- Implemented game "reload" (loading a file with a later stage of the *same* game) Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/game/Game.java trunk/18xx/rails/game/GameManager.java trunk/18xx/rails/game/StartRound_1830.java trunk/18xx/rails/game/action/BidStartItem.java trunk/18xx/rails/game/action/BuyBonusToken.java trunk/18xx/rails/game/action/BuyCertificate.java trunk/18xx/rails/game/action/BuyPrivate.java trunk/18xx/rails/game/action/BuyStartItem.java trunk/18xx/rails/game/action/BuyTrain.java trunk/18xx/rails/game/action/DiscardTrain.java trunk/18xx/rails/game/action/ExchangeTokens.java trunk/18xx/rails/game/action/GameAction.java trunk/18xx/rails/game/action/LayBaseToken.java trunk/18xx/rails/game/action/LayBonusToken.java trunk/18xx/rails/game/action/LayTile.java trunk/18xx/rails/game/action/LayToken.java trunk/18xx/rails/game/action/MergeCompanies.java trunk/18xx/rails/game/action/NullAction.java trunk/18xx/rails/game/action/PossibleAction.java trunk/18xx/rails/game/action/PossibleActions.java trunk/18xx/rails/game/action/ReachDestinations.java trunk/18xx/rails/game/action/RepayLoans.java trunk/18xx/rails/game/action/RequestTurn.java trunk/18xx/rails/game/action/SellShares.java trunk/18xx/rails/game/action/SetDividend.java trunk/18xx/rails/game/action/TakeLoans.java trunk/18xx/rails/game/action/UseSpecialProperty.java trunk/18xx/rails/game/correct/CashCorrectionAction.java trunk/18xx/rails/game/correct/ClosePrivate.java trunk/18xx/rails/game/correct/CorrectionModeAction.java trunk/18xx/rails/game/correct/MapCorrectionAction.java trunk/18xx/rails/game/correct/OperatingCost.java trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java trunk/18xx/rails/ui/swing/GameUIManager.java trunk/18xx/rails/ui/swing/StatusWindow.java Removed Paths: ------------- trunk/18xx/rails/game/action/AssignNamedTrains.java trunk/18xx/rails/game/action/BuyOrBidStartItem.java trunk/18xx/rails/game/action/SetSharePrice.java Property Changed: ---------------- trunk/18xx/tiles/ Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/LocalisedText.properties 2011-03-05 20:10:40 UTC (rev 1492) @@ -498,6 +498,7 @@ REDO=Redo ReleasedFromEscrow={0} receives {1} released from bank escrow ReleasesTrains=Makes {0}-trains available for purchasing +Reload=Reload RemainingTiles=Remaining tiles RepayLoans=Repay loan(s) RepayLoan=Repay {0} loan(s) of {1} for {2} Modified: trunk/18xx/rails/game/Game.java =================================================================== --- trunk/18xx/rails/game/Game.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/Game.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -212,6 +212,7 @@ log.debug("Loading game from file " + filepath); String filename = filepath.replaceAll(".*[/\\\\]", ""); + /*--- Remember to keep GameManager.reload() in sync with this code! ---*/ try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream( @@ -320,6 +321,7 @@ } ois.close(); + ois = null; gameManager.setReloading(false); gameManager.finishLoading(); Modified: trunk/18xx/rails/game/GameManager.java =================================================================== --- trunk/18xx/rails/game/GameManager.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/GameManager.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -920,6 +920,9 @@ case GameAction.SAVE: result = save(gameAction); break; + case GameAction.RELOAD: + result = reload(gameAction); + break; case GameAction.UNDO: moveStack.undoMoveSet(false); result = true; @@ -1111,6 +1114,128 @@ return result; } + @SuppressWarnings("unchecked") + protected boolean reload(GameAction reloadAction) { + + String filepath = reloadAction.getFilepath(); + log.info("Reloading game from file " + filepath); + String filename = filepath.replaceAll(".*[/\\\\]", ""); + + try { + ObjectInputStream ois = + new ObjectInputStream(new FileInputStream( + new File(filepath))); + + // See Game.load(). Here we don't do as much checking. */ + Object object = ois.readObject(); + if (object instanceof String) { + log.info("Reading Rails "+(String)object+" saved file "+filename); + object = ois.readObject(); + } else { + log.info("Reading Rails (pre-1.0.7) saved file "+filename); + } + if (object instanceof String) { + log.info("File was saved at "+(String)object); + object = ois.readObject(); + } + String name = (String) ois.readObject(); + log.debug("Saved game="+name); + Map<String, String> selectedGameOptions = + (Map<String, String>) ois.readObject(); + List<String> playerNames = (List<String>) ois.readObject(); + + log.debug("Starting to compare loaded actions"); + + List<PossibleAction> savedActions; + int numberOfActions = 0; + setReloading(true); + + Object actionObject = ois.readObject(); + if (actionObject instanceof List) { + // Old-style: one List of PossibleActions + savedActions = (List<PossibleAction>) actionObject; + numberOfActions = savedActions.size(); + } else { + // New style: separate PossibleActionsObjects, since Rails 1.3.1 + savedActions = new ArrayList<PossibleAction>(); + while (actionObject instanceof PossibleAction) { + savedActions.add((PossibleAction) actionObject); + numberOfActions++; + try { + actionObject = ois.readObject(); + } catch (EOFException e) { + break; + } + } + } + + // Check size + if (numberOfActions < executedActions.size()) { + DisplayBuffer.add(LocalText.getText("LoadFailed", + "loaded file has less actions than current game")); + return true; + } + + // Check action identity + int index = 0; + PossibleAction executedAction; + for (PossibleAction savedAction : savedActions) { + if (index < executedActions.size()) { + executedAction = executedActions.get(index); + if (!savedAction.equalsAsAction(executedAction)) { + DisplayBuffer.add(LocalText.getText("LoadFailed", + "loaded action \""+savedAction.toString() + +"\"<br> is not same as game action \""+executedAction.toString() + +"\"")); + return true; + } + } else { + if (index == executedActions.size()) { + log.info("Finished comparing old actions, starting to process new actions"); + } + // Found a new action: execute it + if (!processOnReload(savedAction)) { + log.error ("Reload interrupted"); + DisplayBuffer.add(LocalText.getText("LoadFailed", + " loaded action \""+savedAction.toString()+"\" is invalid")); + break; + } + } + index++; + } + + if (actionObject instanceof SortedMap) { + ReportBuffer.setCommentItems((SortedMap<Integer, String>) actionObject); + log.debug("Found sorted map"); + } else { + try { + object = ois.readObject(); + if (object instanceof SortedMap) { + ReportBuffer.setCommentItems((SortedMap<Integer, String>) object); + } + } catch (IOException e) { + // continue without comments, if any IOException occurs + // sometimes not only the EOF Exception is raised + // but also the java.io.StreamCorruptedException: invalid type code + } + } + + ois.close(); + ois = null; + + setReloading(false); + finishLoading(); + log.info("Reloading finished"); + + } catch (Exception e) { + log.error("Reload failed", e); + DisplayBuffer.add(LocalText.getText("LoadFailed", e.getMessage())); + return true; + } + + return true; + } + protected boolean export(GameAction exportAction) { String filename = exportAction.getFilepath(); Modified: trunk/18xx/rails/game/StartRound_1830.java =================================================================== --- trunk/18xx/rails/game/StartRound_1830.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/StartRound_1830.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -193,7 +193,7 @@ // Check item boolean validItem = false; for (StartItemAction activeItem : possibleActions.getType(StartItemAction.class)) { - if (bidItem.equals(activeItem)) { + if (bidItem.equalsAsOption(activeItem)) { validItem = true; break; } Deleted: trunk/18xx/rails/game/action/AssignNamedTrains.java =================================================================== --- trunk/18xx/rails/game/action/AssignNamedTrains.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/AssignNamedTrains.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -1,52 +0,0 @@ -package rails.game.action; - -import java.io.IOException; -import java.io.ObjectInputStream; - -import rails.game.special.SpecialProperty; -import rails.game.specific._18AL.NameTrains; -import rails.game.specific._18AL.NamedTrainToken; - -public class AssignNamedTrains extends PossibleAction { - - transient private NameTrains namedTrainsSpecialProperty; - private int namedTrainsSpecialPropertyId; - - private static final long serialVersionUID = 1L; - - public AssignNamedTrains(NameTrains namedTrainsSpecialProperty) { - this.namedTrainsSpecialProperty = namedTrainsSpecialProperty; - this.namedTrainsSpecialPropertyId = - namedTrainsSpecialProperty.getUniqueId(); - } - - @Override - public String toString() { - StringBuffer b = new StringBuffer("AssignNamedTrains "); - for (NamedTrainToken token : namedTrainsSpecialProperty.getTokens()) { - b.append(token.toString()).append(","); - } - b.deleteCharAt(b.length() - 1); - return b.toString(); - } - - /** Deserialize */ - private void readObject(ObjectInputStream in) throws IOException, - ClassNotFoundException { - - in.defaultReadObject(); - - if (namedTrainsSpecialPropertyId > 0) { - namedTrainsSpecialProperty = - (NameTrains) SpecialProperty.getByUniqueId(namedTrainsSpecialPropertyId); - } - } - - @Override - public boolean equals(PossibleAction pa) { - - return pa instanceof AssignNamedTrains - && ((AssignNamedTrains) pa).namedTrainsSpecialPropertyId == namedTrainsSpecialPropertyId; - } - -} Modified: trunk/18xx/rails/game/action/BidStartItem.java =================================================================== --- trunk/18xx/rails/game/action/BidStartItem.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BidStartItem.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -68,14 +68,21 @@ this.actualBid = actualBid; } - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BidStartItem)) return false; BidStartItem a = (BidStartItem) action; return a.startItem == startItem && a.itemIndex == itemIndex && a.minimumBid == minimumBid; } - public String toString() { + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof BidStartItem)) return false; + BidStartItem a = (BidStartItem) action; + return a.equalsAsOption(this) + && a.actualBid == actualBid; + } + + public String toString() { StringBuffer b = new StringBuffer(); b.append("BidStartItem ").append(startItemName).append(" minbid=").append( minimumBid).append(" selected=").append(selected).append( Modified: trunk/18xx/rails/game/action/BuyBonusToken.java =================================================================== --- trunk/18xx/rails/game/action/BuyBonusToken.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyBonusToken.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -90,7 +90,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BuyBonusToken)) return false; BuyBonusToken a = (BuyBonusToken) action; return a.privateCompany == privateCompany @@ -100,6 +100,10 @@ && a.locationString.equals(locationString); } + public boolean equalsAsAction(PossibleAction action) { + return action.equalsAsOption (this); + } + @Override public String toString() { return "BuyBonusToken " + privateCompanyName Modified: trunk/18xx/rails/game/action/BuyCertificate.java =================================================================== --- trunk/18xx/rails/game/action/BuyCertificate.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyCertificate.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -106,7 +106,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BuyCertificate)) return false; BuyCertificate a = (BuyCertificate) action; return a.certificate == certificate && a.from == from @@ -114,6 +114,14 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof BuyCertificate)) return false; + BuyCertificate a = (BuyCertificate) action; + return a.certificate == certificate && a.from == from + && a.price == price && a.numberBought == numberBought; + } + + @Override public String toString() { StringBuffer text = new StringBuffer(); text.append("BuyCertificate: "); Deleted: trunk/18xx/rails/game/action/BuyOrBidStartItem.java =================================================================== --- trunk/18xx/rails/game/action/BuyOrBidStartItem.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyOrBidStartItem.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -1,153 +0,0 @@ -/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/game/action/BuyOrBidStartItem.java,v 1.11 2009/01/08 19:59:39 evos Exp $ - * - * Created on 17-Sep-2006 - * Change Log: - */ -package rails.game.action; - -import java.io.IOException; -import java.io.ObjectInputStream; - -import rails.game.PublicCompanyI; -import rails.game.StartItem; - -/** - * @author Erik Vos - */ -public class BuyOrBidStartItem extends PossibleAction { - - /* Server-provided fields */ - transient private StartItem startItem; - private String startItemName; - private boolean sharePriceToSet = false; - private String companyNeedingSharePrice = null; - /** Unused but retained to keep old saved files loadable */ - private int type; - - /* - * Status of the start item (buyable? biddable?) for the <i>current</i> - * player, taking into account the amount of cash of this player that is - * blocked by bids on other items. - */ - private int priceOrMinimumBid; - private int bidIncrement; - private int itemIndex; - - /* Client-provided fields */ - private int actualBid = 0; - private int sharePrice = 0; - - // Constants - public static final int BUY_IMMEDIATE = 1; - public static final int SELECT_AND_BUY = 2; - public static final int BID_IMMEDIATE = 3; - public static final int SELECT_AND_BID = 4; - public static final int SELECT_AND_BID_OR_PASS = 5; - public static final int SET_SHARE_PRICE = 6; - - public static final long serialVersionUID = 2L; - - /** - * - */ - public BuyOrBidStartItem(StartItem startItem, int priceOrMinimumBid, - int type) { - - super(); - this.startItem = startItem; - this.startItemName = startItem.getName(); - this.itemIndex = startItem.getIndex(); - this.priceOrMinimumBid = priceOrMinimumBid; - - PublicCompanyI company; - if ((company = startItem.needsPriceSetting()) != null) { - sharePriceToSet = true; - companyNeedingSharePrice = company.getName(); - } - } - - /** - * @return Returns the startItem. - */ - public StartItem getStartItem() { - return startItem; - } - - public int getItemIndex() { - return itemIndex; - } - - public int getBidIncrement() { - return bidIncrement; - } - - public void setBidIncrement(int bidIncrement) { - this.bidIncrement = bidIncrement; - } - - public int getActualBid() { - return actualBid; - } - - public void setActualBid(int actualBid) { - this.actualBid = actualBid; - } - - public int getSharePrice() { - return sharePrice; - } - - public void setSharePrice(int sharePrice) { - this.sharePrice = sharePrice; - } - - public boolean hasSharePriceToSet() { - return sharePriceToSet; - } - - public String getCompanyToSetPriceFor() { - return companyNeedingSharePrice; - } - - public int getPriceOrMinimumBid() { - return priceOrMinimumBid; - } - - @Override - public boolean equals(PossibleAction action) { - if (!(action instanceof BuyOrBidStartItem)) return false; - BuyOrBidStartItem a = (BuyOrBidStartItem) action; - return a.startItem == startItem && a.itemIndex == itemIndex - && a.type == type; - } - - @Override - public String toString() { - StringBuffer b = new StringBuffer(); - b.append("BuyOrBidStartItem ").append(startItemName).append(" status="); - b.append(startItem.getStatusName()); - - switch (startItem.getStatus()) { - case StartItem.BIDDABLE: - b.append(" minbid=").append(priceOrMinimumBid).append(" bid=").append( - actualBid); - break; - case StartItem.BUYABLE: - b.append(" price=").append(priceOrMinimumBid); - break; - case StartItem.NEEDS_SHARE_PRICE: - b.append(" startprice=").append(sharePrice); - break; - } - return b.toString(); - } - - private void readObject(ObjectInputStream in) throws IOException, - ClassNotFoundException { - - in.defaultReadObject(); - - startItem = StartItem.getByName(startItemName); - - } -} Modified: trunk/18xx/rails/game/action/BuyPrivate.java =================================================================== --- trunk/18xx/rails/game/action/BuyPrivate.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyPrivate.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -68,7 +68,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BuyPrivate)) return false; BuyPrivate a = (BuyPrivate) action; return a.privateCompany == privateCompany @@ -77,6 +77,14 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof BuyPrivate)) return false; + BuyPrivate a = (BuyPrivate) action; + return a.privateCompany == privateCompany + && a.price == price; + } + + @Override public String toString() { return "BuyPrivate " + privateCompany.getName() + " holder=" + privateCompany.getPortfolio().getName(); Modified: trunk/18xx/rails/game/action/BuyStartItem.java =================================================================== --- trunk/18xx/rails/game/action/BuyStartItem.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyStartItem.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -76,14 +76,21 @@ return companyNeedingSharePrice; } - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BuyStartItem)) return false; BuyStartItem a = (BuyStartItem) action; return a.startItem == startItem && a.itemIndex == itemIndex && a.price == price; } - public String toString() { + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof BuyStartItem)) return false; + BuyStartItem a = (BuyStartItem) action; + return a.equalsAsOption(this) + && a.associatedSharePrice == associatedSharePrice; + } + + public String toString() { StringBuffer b = new StringBuffer(); b.append("BuyStartItem ").append(startItemName).append(" price=").append( price).append(" selected=").append(selected); Modified: trunk/18xx/rails/game/action/BuyTrain.java =================================================================== --- trunk/18xx/rails/game/action/BuyTrain.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/BuyTrain.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -242,13 +242,21 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof BuyTrain)) return false; BuyTrain a = (BuyTrain) action; return a.getTrain() == getTrain() && a.from == from && a.fixedCost == fixedCost && a.trainsForExchange == trainsForExchange; } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof BuyTrain)) return false; + BuyTrain a = (BuyTrain) action; + return a.getTrain() == getTrain() && a.from == from && a.pricePaid == pricePaid + && a.addedCash == addedCash && a.exchangedTrainUniqueId.equals(exchangedTrainUniqueId); + } + /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { Modified: trunk/18xx/rails/game/action/DiscardTrain.java =================================================================== --- trunk/18xx/rails/game/action/DiscardTrain.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/DiscardTrain.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -84,12 +84,19 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof DiscardTrain)) return false; DiscardTrain a = (DiscardTrain) action; return a.ownedTrains == ownedTrains && a.company == company; } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof DiscardTrain)) return false; + DiscardTrain a = (DiscardTrain) action; + return a.discardedTrain == discardedTrain && a.company == company; + } + /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { Modified: trunk/18xx/rails/game/action/ExchangeTokens.java =================================================================== --- trunk/18xx/rails/game/action/ExchangeTokens.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/ExchangeTokens.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -71,12 +71,22 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof ExchangeTokens)) return false; ExchangeTokens a = (ExchangeTokens) action; return a.tokensToExchange == tokensToExchange && a.company == company; } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!action.equalsAsOption(this)) return false; + ExchangeTokens a = (ExchangeTokens) action; + for (int i=0; i<tokensToExchange.size(); i++) { + if (a.tokensToExchange.get(i).isSelected() != tokensToExchange.get(i).isSelected()) return false; + } + return true; + } + /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { Modified: trunk/18xx/rails/game/action/GameAction.java =================================================================== --- trunk/18xx/rails/game/action/GameAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/GameAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -10,16 +10,17 @@ public static final int FORCED_UNDO = 3; public static final int REDO = 4; public static final int EXPORT = 5; - public static final int MAX_MODE = 5; + public static final int RELOAD = 6; + public static final int MAX_MODE = 6; private String[] name = - new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export" }; + new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload" }; // Server-side settings protected int mode = -1; // Client-side settings - protected String filepath; // Only applies to SAVE and LOAD + protected String filepath = null; // Only applies to SAVE, LOAD and RELOAD protected int moveStackIndex = -1; // target moveStackIndex, only for FORCED_UNDO and REDO public static final long serialVersionUID = 1L; @@ -50,12 +51,19 @@ return mode; } - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof GameAction)) return false; GameAction a = (GameAction) action; return a.mode == mode; } + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof GameAction)) return false; + GameAction a = (GameAction) action; + return a.mode == mode && ( + (a.filepath == null && filepath == null) || a.filepath.equals(filepath)); + } + public String toString() { return name[mode]; } Modified: trunk/18xx/rails/game/action/LayBaseToken.java =================================================================== --- trunk/18xx/rails/game/action/LayBaseToken.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/LayBaseToken.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -71,7 +71,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof LayBaseToken)) return false; LayBaseToken a = (LayBaseToken) action; return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames)) @@ -81,6 +81,17 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof LayBaseToken)) return false; + LayBaseToken a = (LayBaseToken) action; + return a.chosenHex == chosenHex + && a.chosenStation == chosenStation + && a.type == type + && a.company == company + && a.specialProperty == specialProperty; + } + + @Override public String toString() { StringBuffer b = new StringBuffer("LayBaseToken "); if (chosenHex == null) { Modified: trunk/18xx/rails/game/action/LayBonusToken.java =================================================================== --- trunk/18xx/rails/game/action/LayBonusToken.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/LayBonusToken.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -44,7 +44,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof LayBonusToken)) return false; LayBonusToken a = (LayBonusToken) action; return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames)) @@ -52,6 +52,14 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof LayBonusToken)) return false; + LayBonusToken a = (LayBonusToken) action; + return a.chosenHex == chosenHex + && a.company == company && a.specialProperty == specialProperty; + } + + @Override public String toString() { StringBuffer b = new StringBuffer("LayBonusToken "); if (chosenHex == null) { Modified: trunk/18xx/rails/game/action/LayTile.java =================================================================== --- trunk/18xx/rails/game/action/LayTile.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/LayTile.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -233,16 +233,27 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof LayTile)) return false; LayTile a = (LayTile) action; return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames)) && a.type == type && a.tileColours == tileColours - && a.tiles == tiles && a.specialProperty == specialProperty; + && a.tiles == tiles + && a.specialProperty == specialProperty; } @Override + public boolean equalsAsAction (PossibleAction action) { + if (!(action instanceof LayTile)) return false; + LayTile a = (LayTile) action; + return (a.laidTileId == laidTileId + && a.chosenHexName.equals(chosenHexName) + && a.orientation == orientation + && a.relaidBaseTokensString.equals(relaidBaseTokensString)); + } + + @Override public String toString() { StringBuffer b = new StringBuffer("LayTile"); if (laidTile == null) { Modified: trunk/18xx/rails/game/action/LayToken.java =================================================================== --- trunk/18xx/rails/game/action/LayToken.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/LayToken.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -92,19 +92,6 @@ // TODO this.specialPropertyUniqueId = specialProperty.getUniqueId(); } - /** - * @deprecated - * @return Returns the location. - */ - @Deprecated - public MapHex getLocation() { - if (locations != null) { - return locations.get(0); - } else { - return null; - } - } - public List<MapHex> getLocations() { return locations; } Modified: trunk/18xx/rails/game/action/MergeCompanies.java =================================================================== --- trunk/18xx/rails/game/action/MergeCompanies.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/MergeCompanies.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -100,7 +100,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof MergeCompanies)) return false; MergeCompanies a = (MergeCompanies) action; return a.mergingCompanyName.equals(mergingCompanyName) @@ -108,6 +108,15 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof MergeCompanies)) return false; + MergeCompanies a = (MergeCompanies) action; + return a.mergingCompanyName.equals(mergingCompanyName) + && a.selectedTargetCompanyName.equals(selectedTargetCompanyName) + && a.replaceToken == replaceToken; + } + + @Override public String toString() { StringBuffer text = new StringBuffer(); text.append("MergeCompanies: ").append(mergingCompanyName).append( Modified: trunk/18xx/rails/game/action/NullAction.java =================================================================== --- trunk/18xx/rails/game/action/NullAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/NullAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -37,13 +37,18 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof NullAction)) return false; NullAction a = (NullAction) action; return a.mode == mode; } @Override + public boolean equalsAsAction(PossibleAction action) { + return equalsAsOption(action); + } + + @Override public String toString() { if (optionalLabel != null) return optionalLabel; return name[mode]; Modified: trunk/18xx/rails/game/action/PossibleAction.java =================================================================== --- trunk/18xx/rails/game/action/PossibleAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/PossibleAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -72,8 +72,34 @@ this.acted = true; } - public abstract boolean equals(PossibleAction pa); + /** + * Compare the choice options of two action objects, without regard to whatever choice has been made, if any. + * In other words: only the server-set (prior) attributes must be compared. + * <p>This method is used by the server (engine) to validate + * the incoming action that has actually been chosen in the client (GUI), + * but only for the purpose to check if the chosen option was really on offer, + * not to check if the chosen action is actually valid. + * These perspectives could give different results in cases where + * the PossibleAction does not fully restrict choices to valid values only + * (such as the blanket LayTile that does no restrict the hex to lay a tile on, + * or the SetDividend that will accept any revenue value). + * @param pa Another PossibleAction to compare with. + * @return True if the compared PossibleAction object has equal choice options. + */ + public abstract boolean equalsAsOption (PossibleAction pa); + /** + * Compare the chosen actions of two action objects. + * In other words: the client-set (posterior) attributes must be compared, + * in addition to those server-set (prior) attributes that sufficiently identify the action. + * <p>This method is used by the server (engine) to check if two action + * objects represent the same actual action, as is done when reloading a saved file + * (i.e. loading a later stage of the same game). + * @param pa Another PossibleAction to compare with. + * @return True if the compared PossibleAction object has equal selected action values. + */ + public abstract boolean equalsAsAction (PossibleAction pa); + protected GameManagerI getGameManager() { return GameManager.getInstance(); } Modified: trunk/18xx/rails/game/action/PossibleActions.java =================================================================== --- trunk/18xx/rails/game/action/PossibleActions.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/PossibleActions.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -96,16 +96,17 @@ /** Check if a given action exists in the current list of possible actions */ public boolean validate(PossibleAction checkedAction) { - // Save is always allowed + // Some actions are always allowed if (checkedAction instanceof GameAction && (((GameAction)checkedAction).getMode() == GameAction.SAVE - || ((GameAction)checkedAction).getMode() == GameAction.EXPORT)) { + || ((GameAction)checkedAction).getMode() == GameAction.RELOAD + || ((GameAction)checkedAction).getMode() == GameAction.EXPORT)) { return true; } // Check if action accurs in the list of possible actions for (PossibleAction action : possibleActions) { - if (action.equals(checkedAction)) { + if (action.equalsAsOption(checkedAction)) { return true; } } Modified: trunk/18xx/rails/game/action/ReachDestinations.java =================================================================== --- trunk/18xx/rails/game/action/ReachDestinations.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/ReachDestinations.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -61,16 +61,22 @@ return reachedCompanies; } - - @Override - public boolean equals(PossibleAction pa) { + public boolean equalsAsOption(PossibleAction pa) { if (!(pa instanceof ReachDestinations)) return false; ReachDestinations rd = (ReachDestinations) pa; return possibleCompanyNames.equals(rd.getPossibleCompanyNames()); } - @Override + @Override + public boolean equalsAsAction(PossibleAction pa) { + if (!(pa instanceof ReachDestinations)) return false; + ReachDestinations rd = (ReachDestinations) pa; + return possibleCompanyNames.equals(rd.possibleCompanyNames) + && reachedCompanyNames.equals(rd.reachedCompanyNames); + } + + @Override public String toString() { StringBuffer text = new StringBuffer(); text.append("ReachDestinations: ").append(possibleCompanyNames); Modified: trunk/18xx/rails/game/action/RepayLoans.java =================================================================== --- trunk/18xx/rails/game/action/RepayLoans.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/RepayLoans.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -78,7 +78,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof RepayLoans)) return false; RepayLoans a = (RepayLoans) action; return a.company == company @@ -88,6 +88,15 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof RepayLoans)) return false; + RepayLoans a = (RepayLoans) action; + return a.company == company + && a.numberRepaid == numberRepaid + && a.price == price; + } + + @Override public String toString() { StringBuffer b = new StringBuffer(); b.append ("RepayLoans ").append(company.getName()) Modified: trunk/18xx/rails/game/action/RequestTurn.java =================================================================== --- trunk/18xx/rails/game/action/RequestTurn.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/RequestTurn.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -24,12 +24,16 @@ } @Override - public boolean equals(PossibleAction pa) { + public boolean equalsAsOption(PossibleAction pa) { return pa != null && pa instanceof RequestTurn && requestingPlayerName.equals(((RequestTurn)pa).requestingPlayerName); } + public boolean equalsAsAction(PossibleAction pa) { + return equalsAsOption (pa); + } + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { Modified: trunk/18xx/rails/game/action/SellShares.java =================================================================== --- trunk/18xx/rails/game/action/SellShares.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/SellShares.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -91,7 +91,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof SellShares)) return false; SellShares a = (SellShares) action; return a.getCompanyName().equals(companyName) @@ -101,6 +101,16 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof SellShares)) return false; + SellShares a = (SellShares) action; + return a.companyName.equals(companyName) + && a.shareUnits == shareUnits + && a.numberSold == numberSold + && a.price == price; + } + + @Override public String toString() { return "SellShares: " + (numberSold > 0 ? numberSold : "max " + maximumNumber) Modified: trunk/18xx/rails/game/action/SetDividend.java =================================================================== --- trunk/18xx/rails/game/action/SetDividend.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/SetDividend.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -148,7 +148,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof SetDividend)) return false; SetDividend a = (SetDividend) action; return a.company == company @@ -160,6 +160,15 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof SetDividend)) return false; + SetDividend a = (SetDividend) action; + return a.company == company + && a.actualRevenue == actualRevenue + && a.revenueAllocation == revenueAllocation; + } + + @Override public String toString() { StringBuffer b = new StringBuffer(); b.append(getClass().getSimpleName()).append(": ").append(company.getName()); Deleted: trunk/18xx/rails/game/action/SetSharePrice.java =================================================================== --- trunk/18xx/rails/game/action/SetSharePrice.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/SetSharePrice.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -1,75 +0,0 @@ -/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/game/action/SetSharePrice.java,v 1.2 2008/06/04 19:00:29 evos Exp $ - * - * Created on 17-Sep-2006 - * Change Log: - */ -package rails.game.action; - -import rails.game.PublicCompanyI; -import rails.game.StartItem; - -/** - * @author Erik Vos - */ -public class SetSharePrice extends StartItemAction { - - /* Server-provided fields */ - private boolean sharePriceToSet = false; - private String companyNeedingSharePrice = null; - - // Client-provided fields - private int associatedSharePrice; - - public static final long serialVersionUID = 1L; - - /** - * - */ - public SetSharePrice(StartItem startItem) { - - super(startItem); - - PublicCompanyI company; - if ((company = startItem.needsPriceSetting()) != null) { - sharePriceToSet = true; - companyNeedingSharePrice = company.getName(); - } - } - - public int getAssociatedSharePrice() { - return associatedSharePrice; - } - - public void setAssociatedSharePrice(int sharePrice) { - this.associatedSharePrice = sharePrice; - } - - public boolean hasSharePriceToSet() { - return sharePriceToSet; - } - - public String getCompanyToSetPriceFor() { - return companyNeedingSharePrice; - } - - /** @deprecated */ - public int getStatus() { - // if (startItem == null) return 0;//BAD - return startItem.getStatus(); - } - - public boolean equals(PossibleAction action) { - if (!(action instanceof SetSharePrice)) return false; - SetSharePrice a = (SetSharePrice) action; - return a.startItem == startItem && a.itemIndex == itemIndex; - } - - public String toString() { - StringBuffer b = new StringBuffer(); - b.append("SetSharePrice ").append(startItemName).append(" shareprice=").append( - associatedSharePrice).append( - " for company " + companyNeedingSharePrice); - return b.toString(); - } - -} Modified: trunk/18xx/rails/game/action/TakeLoans.java =================================================================== --- trunk/18xx/rails/game/action/TakeLoans.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/TakeLoans.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -66,7 +66,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof TakeLoans)) return false; TakeLoans a = (TakeLoans) action; return a.company == company @@ -75,6 +75,15 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof TakeLoans)) return false; + TakeLoans a = (TakeLoans) action; + return a.company == company + && a.numberTaken == numberTaken + && a.price == price; + } + + @Override public String toString() { StringBuffer b = new StringBuffer(); b.append ("TakeLoans ").append(company.getName()) Modified: trunk/18xx/rails/game/action/UseSpecialProperty.java =================================================================== --- trunk/18xx/rails/game/action/UseSpecialProperty.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/action/UseSpecialProperty.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -42,12 +42,16 @@ return specialProperty; } - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof UseSpecialProperty)) return false; UseSpecialProperty a = (UseSpecialProperty) action; return a.specialProperty == specialProperty; } + public boolean equalsAsAction(PossibleAction action) { + return action.equalsAsOption(this); + } + public String toString() { StringBuffer b = new StringBuffer("UseSpecialProperty: "); if (specialProperty != null) b.append(specialProperty); Modified: trunk/18xx/rails/game/correct/CashCorrectionAction.java =================================================================== --- trunk/18xx/rails/game/correct/CashCorrectionAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/correct/CashCorrectionAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -81,14 +81,24 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof CashCorrectionAction)) return false; CashCorrectionAction a = (CashCorrectionAction) action; return (a.correctCashHolder == this.correctCashHolder && a.maximumNegative == this.maximumNegative ); } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof CashCorrectionAction)) return false; + CashCorrectionAction a = (CashCorrectionAction) action; + return (a.correctCashHolder == this.correctCashHolder && + a.correctAmount == this.correctAmount + ); + } + + @Override public String toString() { StringBuffer b = new StringBuffer("CashCorrectionAction "); if (acted) { Modified: trunk/18xx/rails/game/correct/ClosePrivate.java =================================================================== --- trunk/18xx/rails/game/correct/ClosePrivate.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/correct/ClosePrivate.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -42,13 +42,18 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof ClosePrivate)) return false; ClosePrivate a = (ClosePrivate) action; return (a.privateCompany == this.privateCompany); } @Override + public boolean equalsAsAction(PossibleAction action) { + return action.equalsAsOption(this); + } + + @Override public String toString() { StringBuffer b = new StringBuffer("ClosePrivate"); if (!acted) { Modified: trunk/18xx/rails/game/correct/CorrectionModeAction.java =================================================================== --- trunk/18xx/rails/game/correct/CorrectionModeAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/correct/CorrectionModeAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -40,7 +40,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof CorrectionModeAction)) return false; CorrectionModeAction a = (CorrectionModeAction) action; return (a.correctionType.equals(this.correctionType) && @@ -48,6 +48,11 @@ } @Override + public boolean equalsAsAction(PossibleAction action) { + return action.equalsAsOption(this); + } + + @Override public String toString() { StringBuffer b = new StringBuffer("CorrectionModeAction"); if (!acted) { Modified: trunk/18xx/rails/game/correct/MapCorrectionAction.java =================================================================== --- trunk/18xx/rails/game/correct/MapCorrectionAction.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/correct/MapCorrectionAction.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -2,8 +2,7 @@ import java.io.IOException; import java.io.ObjectInputStream; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import rails.game.correct.MapCorrectionManager.*; import rails.game.BaseToken; @@ -177,13 +176,23 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof MapCorrectionAction)) return false; MapCorrectionAction a = (MapCorrectionAction) action; return (a.step == this.step); } @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof MapCorrectionAction)) return false; + MapCorrectionAction a = (MapCorrectionAction) action; + return (a.step == this.step + && a.location == location + && a.tiles.get(0) == tiles.get(0)) + && a.orientation == orientation; + } + + @Override public String toString(){ StringBuffer b = new StringBuffer("MapCorrectionAction"); if (acted) { Modified: trunk/18xx/rails/game/correct/OperatingCost.java =================================================================== --- trunk/18xx/rails/game/correct/OperatingCost.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/correct/OperatingCost.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -74,7 +74,7 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof OperatingCost)) return false; OperatingCost a = (OperatingCost) action; return (a.company == this.company && @@ -83,7 +83,18 @@ a.maximumCost == this.maximumCost ); } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof OperatingCost)) return false; + OperatingCost a = (OperatingCost) action; + return (a.company == this.company && + a.operatingCostType == this.operatingCostType && + a.operatingCost == this.operatingCost + ); + } + + @Override public String toString() { StringBuffer b = new StringBuffer("OperatingCost"); if (!acted) { Modified: trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java =================================================================== --- trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -70,12 +70,18 @@ } @Override - public boolean equals(PossibleAction action) { + public boolean equalsAsOption(PossibleAction action) { if (!(action instanceof FoldIntoPrussian)) return false; FoldIntoPrussian a = (FoldIntoPrussian) action; return a.foldableCompanyNames.equals(foldableCompanyNames); } + @Override + public boolean equalsAsAction(PossibleAction action) { + if (!(action instanceof FoldIntoPrussian)) return false; + FoldIntoPrussian a = (FoldIntoPrussian) action; + return a.equalsAsOption(this) && a.foldedCompanyNames.equals(foldedCompanyNames); + } /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, Modified: trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java =================================================================== --- trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -2,11 +2,10 @@ import java.io.IOException; import java.io.ObjectInputStream; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import rails.game.*; -import rails.game.action.UseSpecialProperty; +import rails.game.action.*; public class AssignNamedTrains extends UseSpecialProperty { @@ -61,6 +60,12 @@ } } } + + public boolean equalsAsAction (PossibleAction action) { + if (!(action instanceof AssignNamedTrains)) return false; + AssignNamedTrains a = (AssignNamedTrains) action; + return Arrays.equals(a.postTrainIds, postTrainIds); + } @Override public String toMenu() { Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -775,7 +775,23 @@ } - public void setSaveDirectory(String saveDirectory) { + public void reloadGame(GameAction reloadAction) { + + JFileChooser jfc = new JFileChooser(); + jfc.setCurrentDirectory(new File(saveDirectory)); + + if (jfc.showOpenDialog(statusWindow) == JFileChooser.APPROVE_OPTION) { + File selectedFile = jfc.getSelectedFile(); + saveDirectory = selectedFile.getParent(); + reloadAction.setFilepath(selectedFile.getPath()); + processOnServer(reloadAction); + } else { // cancel pressed + return; + } + + } + + public void setSaveDirectory(String saveDirectory) { this.saveDirectory = saveDirectory; } Modified: trunk/18xx/rails/ui/swing/StatusWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/StatusWindow.java 2011-02-28 21:12:48 UTC (rev 1491) +++ trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-05 20:10:40 UTC (rev 1492) @@ -30,6 +30,8 @@ protected static final String SAVE_CMD = "Save"; + protected static final String RELOAD_CMD = "Reload"; + protected static final String EXPORT_CMD = "Export"; protected static final String UNDO_CMD = "Undo"; @@ -79,7 +81,7 @@ private JMenuItem menuItem; private ActionMenuItem saveItem; -// private ActionMenuItem exportItem; + private ActionMenuItem reloadItem; private ActionMenuItem undoItem, forcedUndoItem, redoItem, redoItem2; @@ -117,6 +119,16 @@ saveItem.setPossibleAction(new GameAction(GameAction.SAVE)); fileMenu.add(saveItem); + reloadItem = new ActionMenuItem(LocalText.getText("Reload")); + reloadItem.setActionCommand(RELOAD_CMD); + reloadItem.setMnemonic(KeyEvent.VK_R); + reloadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, + ActionEvent.ALT_MASK)); + reloadItem.addActionListener(this); + reloadItem.setEnabled(true); + reloadItem.setPossibleAction(new GameAction(GameAction.RELOAD)); + fileMenu.add(reloadItem); + // export menu item // exportItem = new ActionMenuItem(LocalText.getText("EXPORT")); // exportItem.setActionCommand(EXPORT_CMD); @@ -630,6 +642,9 @@ case GameAction.SAVE: gameUIManager.saveGame((GameAction) executedAction); break; + case GameAction.RELOAD: + gameUIManager.reloadGame((GameAction) executedAction); + break; case GameAction.EXPORT: gameUIManager.exportGame((GameAction) executedAction); break; Property changes on: trunk/18xx/tiles ___________________________________________________________________ Modified: svn:ignore - Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o + Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-14 21:19:02
|
Revision: 1498 http://rails.svn.sourceforge.net/rails/?rev=1498&view=rev Author: evos Date: 2011-03-14 21:18:55 +0000 (Mon, 14 Mar 2011) Log Message: ----------- 18VA nap fixed Modified Paths: -------------- trunk/18xx/data/18VA/Game.xml trunk/18xx/data/18VA/Map.xml trunk/18xx/rails/game/MapManager.java trunk/18xx/rails/ui/swing/hexmap/GUIHex.java Modified: trunk/18xx/data/18VA/Game.xml =================================================================== --- trunk/18xx/data/18VA/Game.xml 2011-03-14 15:52:15 UTC (rev 1497) +++ trunk/18xx/data/18VA/Game.xml 2011-03-14 21:18:55 UTC (rev 1498) @@ -1,7 +1,7 @@ <?xml version="1.0"?> <ComponentManager> <Component name="GameManager" class="rails.game.GameManager"> - <Game name="1830"/> + <Game name="18VA"/> <!-- GAME OPTIONS must have: - a name, which must also exist as an entry in LocalText.properties, - optionally 'type="toggle"', which has the effect that the @@ -15,7 +15,6 @@ <!-- The options in Game.xml are not currently used. See GamesList.xml for the real ones. --> - <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" /> <GameParameters> <PlayerShareLimit percentage="60"> <!-- Option "NumberOfPlayers" is automatically set Modified: trunk/18xx/data/18VA/Map.xml =================================================================== --- trunk/18xx/data/18VA/Map.xml 2011-03-14 15:52:15 UTC (rev 1497) +++ trunk/18xx/data/18VA/Map.xml 2011-03-14 21:18:55 UTC (rev 1498) @@ -4,7 +4,7 @@ <Hex name="B5" tile="-10" city="Hagerstown"/> <Hex name="B7" tile="0"/> <Hex name="C4" tile="0"/> - <Hex name="C6" tile="-10" city="Harper's Ferry" impassable="D7"/> + <Hex name="C6" tile="-10" city="Harper's Ferry" impassable="D5,E6"/> <Hex name="C8" tile="-10" city="Baltimore" label="P"/> <Hex name="D3" tile="-10" city="Cumberland"/> <Hex name="D5" tile="0"/> @@ -36,11 +36,11 @@ <Hex name="L1" tile="-1922" city="Roanoke"/> <Hex name="L3" tile="-10" city="Lynchburg"/> <Hex name="L5" tile="0"/> - <Hex name="L7" tile="0" impassable="M6"/> + <Hex name="L7" tile="0" impassable="M6,N7"/> <Hex name="M2" tile="-1"/> <Hex name="M4" tile="0"/> <Hex name="M6" tile="-10" city="Petersburg" label="P"/> - <Hex name="M8" tile="57" city="Newport News" impassable="N7"/> + <Hex name="M8" tile="57" orientation="2" city="Newport News" impassable="N7,O8"/> <Hex name="N3" tile="0"/> <Hex name="N5" tile="0"/> <Hex name="N7" tile="0"/> Modified: trunk/18xx/rails/game/MapManager.java =================================================================== --- trunk/18xx/rails/game/MapManager.java 2011-03-14 15:52:15 UTC (rev 1497) +++ trunk/18xx/rails/game/MapManager.java 2011-03-14 21:18:55 UTC (rev 1498) @@ -135,7 +135,7 @@ if (ii >= minX && ii <= maxX && jj >= minY && jj <= maxY && (nb = hexes[ii][jj]) != null) { if (hex.isNeighbour(nb, k) - && nb.isNeighbour(hex, k + 3)) { + && nb.isNeighbour(hex, k + 3)) { hex.setNeighbor(k, nb); nb.setNeighbor(k + 3, hex); } Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java =================================================================== --- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-14 15:52:15 UTC (rev 1497) +++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-14 21:18:55 UTC (rev 1498) @@ -114,7 +114,15 @@ tokenDiameter = (int)Math.round(NORMAL_TOKEN_SIZE * zoomFactor); if (hexMap.getMapManager().getTileOrientation() == MapHex.EW) { -// len = scale; + /* The numbering is unusual: + * 0 + * / \ + * 5 1 + * | | + * 4 2 + * \ / + * 3 + */ xVertex[0] = cx + SQRT3 * scale; yVertex[0] = cy + scale; xVertex[1] = cx + 2 * SQRT3 * scale; @@ -130,7 +138,13 @@ baseRotation = 30; // degrees } else { -// len = scale / 3.0; + /* The numbering is unusual: + * 4--3 + * / \ + * 5 2 + * \ / + * 0--1 + */ xVertex[0] = cx; yVertex[0] = cy; xVertex[1] = cx + 2 * scale; @@ -230,10 +244,14 @@ } public void addBar (int orientation) { + // NOTE: orientation here is its normal value in Rails + 3 (mod 6). orientation %= 6; if (barStartPoints == null) barStartPoints = new ArrayList<Integer>(2); - int offset = hexMap.getMapManager().getTileOrientation() == MapHex.EW ? 0 : 4; - barStartPoints.add((offset+5-orientation)%6); + if (hexMap.getMapManager().getTileOrientation() == MapHex.EW) { + barStartPoints.add((5-orientation)%6); + } else { + barStartPoints.add((3+orientation)%6); + } } public Rectangle getBounds() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-15 22:27:13
|
Revision: 1499 http://rails.svn.sourceforge.net/rails/?rev=1499&view=rev Author: evos Date: 2011-03-15 22:27:07 +0000 (Tue, 15 Mar 2011) Log Message: ----------- Added "sell train to foreigners" feature of 1844 and 1824 Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/game/GameDef.java trunk/18xx/rails/game/GameManager.java trunk/18xx/rails/game/OperatingRound.java trunk/18xx/rails/game/TileManager.java trunk/18xx/rails/game/TrainManager.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/LocalisedText.properties 2011-03-15 22:27:07 UTC (rev 1499) @@ -500,6 +500,7 @@ ReleasesTrains=Makes {0}-trains available for purchasing Reload=Reload RemainingTiles=Remaining tiles +RemoveTrain=An unsold {0}-train is removed from the game RepayLoans=Repay loan(s) RepayLoan=Repay {0} loan(s) of {1} for {2} REPORT=Report Window Modified: trunk/18xx/rails/game/GameDef.java =================================================================== --- trunk/18xx/rails/game/GameDef.java 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/rails/game/GameDef.java 2011-03-15 22:27:07 UTC (rev 1499) @@ -18,7 +18,8 @@ TREASURY_SHARE_LIMIT(50), FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS(false), SKIP_FIRST_STOCK_ROUND(false), - NO_SALE_OF_JUST_BOUGHT_CERT(false); + NO_SALE_OF_JUST_BOUGHT_CERT(false), + REMOVE_TRAIN_BEFORE_SR(false); private Object defaultValue; Modified: trunk/18xx/rails/game/GameManager.java =================================================================== --- trunk/18xx/rails/game/GameManager.java 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/rails/game/GameManager.java 2011-03-15 22:27:07 UTC (rev 1499) @@ -642,6 +642,7 @@ if (bank.isBroken() && gameEndsAfterSetOfORs) { finishGame(); } else { + ((OperatingRound)round).checkForeignSales(); startStockRound(); } } Modified: trunk/18xx/rails/game/OperatingRound.java =================================================================== --- trunk/18xx/rails/game/OperatingRound.java 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/rails/game/OperatingRound.java 2011-03-15 22:27:07 UTC (rev 1499) @@ -7,8 +7,7 @@ import rails.game.action.*; import rails.game.correct.ClosePrivate; import rails.game.correct.OperatingCost; -import rails.game.move.CashMove; -import rails.game.move.MapChange; +import rails.game.move.*; import rails.game.special.*; import rails.game.state.*; import rails.util.LocalText; @@ -1822,6 +1821,7 @@ operatingCompany.get().buyTrain(train, price); if (oldHolder == ipo) { train.getType().addToBoughtFromIPO(); + trainManager.setAnyTrainBought(true); // Clone the train if infinitely available if (train.getType().hasInfiniteAmount()) { ipo.addTrain(train.getType().cloneTrain()); @@ -2834,7 +2834,7 @@ public void payLoanInterest () { int amount = operatingCompany.get().getCurrentLoanValue() - * operatingCompany.get().getLoanInterestPct() / 100; + * operatingCompany.get().getLoanInterestPct() / 100; new CashMove (operatingCompany.get(), bank, amount); DisplayBuffer.add(LocalText.getText("CompanyPaysLoanInterest", operatingCompany.get().getName(), @@ -2844,6 +2844,15 @@ Bank.format(operatingCompany.get().getValuePerLoan()))); } + public void checkForeignSales() { + if (getGameParameterAsBoolean(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR) + && trainManager.isAnyTrainBought()) { + TrainI train = trainManager.getAvailableNewTrains().get(0); + if (train.getType().hasInfiniteAmount()) return; + new ObjectMove (train, ipo, scrapHeap); + ReportBuffer.add(LocalText.getText("RemoveTrain", train.getName())); + } + } /* TODO This is just a start of a possible approach to a Help system */ @Override Modified: trunk/18xx/rails/game/TileManager.java =================================================================== --- trunk/18xx/rails/game/TileManager.java 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/rails/game/TileManager.java 2011-03-15 22:27:07 UTC (rev 1499) @@ -38,7 +38,6 @@ 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"); Modified: trunk/18xx/rails/game/TrainManager.java =================================================================== --- trunk/18xx/rails/game/TrainManager.java 2011-03-14 21:18:55 UTC (rev 1498) +++ trunk/18xx/rails/game/TrainManager.java 2011-03-15 22:27:07 UTC (rev 1499) @@ -3,6 +3,7 @@ import java.util.*; +import rails.game.state.BooleanState; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; @@ -16,8 +17,10 @@ protected Map<String, TrainI> trainMap = new HashMap<String, TrainI>(); + + private boolean removeTrain = false; + - // Dynamic attributes protected Portfolio unavailable = null; @@ -32,6 +35,9 @@ protected GameManagerI gameManager = null; protected Bank bank = null; + + /** Required for the sell-train-to-foreigners feature of some games */ + protected BooleanState anyTrainBought = new BooleanState ("AnyTrainBought", false); // Non-game attributes protected Portfolio ipo = null; @@ -78,7 +84,7 @@ Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special - GameManager.getInstance().setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, + gameManager.setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, rulesTag.getChild("FaceValueIfDifferentPresidents") != null); } @@ -96,6 +102,14 @@ mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } + + // Are trains sold to foreigners? + Tag removeTrainTag = tag.getChild("RemoveTrainBeforeSR"); + if (removeTrainTag != null) { + // Trains "bought by foreigners" (1844, 1824) + removeTrain = true; // completed in finishConfiguration() + } + } public void finishConfiguration (GameManagerI gameManager) @@ -112,8 +126,13 @@ // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); - } + // Trains "bought by foreigners" (1844, 1824) + if (removeTrain) { + gameManager.setGameParameter(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR, true); + } +} + public void addTrain (String uniqueID, TrainI train) { trainMap.put(uniqueID, train); } @@ -218,7 +237,7 @@ } return b.toString(); } - + public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } @@ -239,4 +258,13 @@ return phaseHasChanged; } + public boolean isAnyTrainBought () { + return anyTrainBought.booleanValue(); + } + + public void setAnyTrainBought (boolean newValue) { + if (isAnyTrainBought() != newValue) { + anyTrainBought.set(newValue); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-17 21:16:50
|
Revision: 1500 http://rails.svn.sourceforge.net/rails/?rev=1500&view=rev Author: evos Date: 2011-03-17 21:16:44 +0000 (Thu, 17 Mar 2011) Log Message: ----------- Fix for bug 3207870: added new class ShareSellingRound_1856 with code (copied from StockRound_1856) to prevent that a 5% CGR sale during emergency selling lowers the CGR price. Modified Paths: -------------- trunk/18xx/data/1856/Game.xml trunk/18xx/rails/game/GameManager.java Added Paths: ----------- trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java Modified: trunk/18xx/data/1856/Game.xml =================================================================== --- trunk/18xx/data/1856/Game.xml 2011-03-15 22:27:07 UTC (rev 1499) +++ trunk/18xx/data/1856/Game.xml 2011-03-17 21:16:44 UTC (rev 1500) @@ -17,6 +17,7 @@ <NoSaleOfJustBoughtShare/> </StockRound> <OperatingRound class="rails.game.specific._1856.OperatingRound_1856"/> + <ShareSellingRound class="rails.game.specific._1856.ShareSellingRound_1856"/> <PlayerShareLimit percentage="60"/> <BankPoolLimit percentage="50"/> </GameParameters> Modified: trunk/18xx/rails/game/GameManager.java =================================================================== --- trunk/18xx/rails/game/GameManager.java 2011-03-15 22:27:07 UTC (rev 1499) +++ trunk/18xx/rails/game/GameManager.java 2011-03-17 21:16:44 UTC (rev 1500) @@ -37,6 +37,8 @@ protected Class<? extends StockRound> stockRoundClass = StockRound.class; protected Class<? extends OperatingRound> operatingRoundClass = OperatingRound.class; + protected Class<? extends ShareSellingRound> shareSellingRoundClass + = ShareSellingRound.class; // Variable UI Class names protected String gameUIManagerClassName = GuiDef.getDefaultClassName(GuiDef.ClassName.GAME_UI_MANAGER); @@ -176,7 +178,7 @@ protected List<String> nextPlayerMessages = new ArrayList<String>(); /** - * The ReportBuffer collectes messages to be shown in the Game Report. + * The ReportBuffer collects messages to be shown in the Game Report. */ protected ReportBuffer reportBuffer; @@ -356,6 +358,20 @@ } } + // ShareSellingRound class + Tag ssrTag = gameParmTag.getChild("ShareSellingRound"); + if (ssrTag != null) { + String ssrClassName = + ssrTag.getAttributeAsString("class", "rails.game.ShareSellingRound"); + try { + shareSellingRoundClass = + Class.forName(ssrClassName).asSubclass(ShareSellingRound.class); + } catch (ClassNotFoundException e) { + throw new ConfigurationException("Cannot find class " + + ssrClassName, e); + } + } + /* Max. % of shares of one company that a player may hold */ Tag shareLimitTag = gameParmTag.getChild("PlayerShareLimit"); if (shareLimitTag != null) { @@ -756,7 +772,7 @@ interruptedRound = getCurrentRound(); // check if other companies can be dumped - createRound (ShareSellingRound.class, interruptedRound) + createRound (shareSellingRoundClass, interruptedRound) .start(player, cashToRaise, cashNeedingCompany, !problemDumpOtherCompanies || forcedSellingCompanyDump); // the last parameter indicates if the dump of other companies is allowed, either this is explicit or Added: trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java =================================================================== --- trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java (rev 0) +++ trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java 2011-03-17 21:16:44 UTC (rev 1500) @@ -0,0 +1,43 @@ +package rails.game.specific._1856; + +import rails.game.*; +import rails.game.action.BuyCertificate; +import rails.game.state.IntegerState; +import rails.util.LocalText; + +/** Needed to copy behaviour on share selling from StockRound_1856. */ +public class ShareSellingRound_1856 extends ShareSellingRound { + + /* Cope with multiple 5% share sales in one turn */ + private IntegerState sharesSoldSoFar; + private IntegerState squaresDownSoFar; + + public ShareSellingRound_1856 (GameManagerI aGameManager, + RoundI parentRound) { + super (aGameManager, parentRound); + + sharesSoldSoFar = new IntegerState("CGR_SharesSoldSoFar", 0); + squaresDownSoFar = new IntegerState("CGR_SquaresDownSoFar", 0); + } + + @Override + protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { + + if (!company.canSharePriceVary()) return; + + int numberOfSpaces = numberSold; + if (company instanceof PublicCompany_CGR) { + if (company.getShareUnit() == 5) { + // Take care for selling 5% shares in multiple blocks per turn + numberOfSpaces + = (sharesSoldSoFar.intValue() + numberSold)/2 + - squaresDownSoFar.intValue(); + sharesSoldSoFar.add(numberSold); + squaresDownSoFar.add(numberOfSpaces); + } + } + + super.adjustSharePrice (company, numberOfSpaces, soldBefore); + } + +} Property changes on: trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-26 20:42:59
|
Revision: 1501 http://rails.svn.sourceforge.net/rails/?rev=1501&view=rev Author: evos Date: 2011-03-26 20:42:51 +0000 (Sat, 26 Mar 2011) Log Message: ----------- Phase 1 of autosave/load Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/game/action/GameAction.java trunk/18xx/rails/game/action/PossibleAction.java trunk/18xx/rails/ui/swing/ActionPerformer.java trunk/18xx/rails/ui/swing/GameUIManager.java trunk/18xx/rails/ui/swing/ORUIManager.java trunk/18xx/rails/ui/swing/ORWindow.java trunk/18xx/rails/ui/swing/StartRoundWindow.java trunk/18xx/rails/ui/swing/StatusWindow.java trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java Added Paths: ----------- trunk/18xx/rails/ui/swing/AutoLoadPoller.java trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/LocalisedText.properties 2011-03-26 20:42:51 UTC (rev 1501) @@ -19,6 +19,8 @@ AutodiscardTrain=discard {0}-train Autopass=Autopass Autopasses={0} autopasses +AutoSaveLoad=Autosave/load +AutoSaveLoadOptions=Autosave/load options BANK=Bank BANK_SHARES=Bank shares BASE_PRICE=<html>Base<br>Price</html> @@ -439,6 +441,8 @@ OCLayBaseToken=Lay base token -- {0} OCLayBaseTokenExecuted={0} lays base token for {1} OK=OK +On=On +Off=Off OPTIONS=Options OR=or ORWORTHINCR=OR +/- @@ -600,6 +604,7 @@ StockSpaceIsConfiguredTwice=Stock space {0} is configured twice. StockSpaceTypeConfiguredTwice=Stock space type {0} is configured twice StockSpaceTypeUndefined=Stock space type {0} is undefined. +Suspended=Suspended SwapsPrivateForCertificate={0} swaps {1} for a {2}% share of {3}. SwapPrivateForCertificate=Swap {0} for a {1}% share of {2} SwapPrivateForCertificates=Swap {0} for {1} {2}% shares of {3} Modified: trunk/18xx/rails/game/action/GameAction.java =================================================================== --- trunk/18xx/rails/game/action/GameAction.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/game/action/GameAction.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -13,8 +13,8 @@ public static final int RELOAD = 6; public static final int MAX_MODE = 6; - private String[] name = - new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload" }; + private static String[] names = + new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload"}; // Server-side settings protected int mode = -1; @@ -65,6 +65,9 @@ } public String toString() { - return name[mode]; + StringBuilder b = new StringBuilder(names[mode]); + if (filepath != null) b.append(" path="+filepath); + if (moveStackIndex > -1) b.append (" index="+moveStackIndex); + return b.toString(); } } Modified: trunk/18xx/rails/game/action/PossibleAction.java =================================================================== --- trunk/18xx/rails/game/action/PossibleAction.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/game/action/PossibleAction.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -38,6 +38,7 @@ public PossibleAction() { gameManager = GameManager.getInstance(); + if (gameManager == null) return; // TODO If created in client ?!?! Player player = gameManager.getCurrentPlayer(); if (player != null) { playerName = player.getName(); Modified: trunk/18xx/rails/ui/swing/ActionPerformer.java =================================================================== --- trunk/18xx/rails/ui/swing/ActionPerformer.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/ActionPerformer.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -5,7 +5,7 @@ public interface ActionPerformer { - public void updateStatus(); + public void updateStatus(boolean myTurn); public boolean process(PossibleAction action); Added: trunk/18xx/rails/ui/swing/AutoLoadPoller.java =================================================================== --- trunk/18xx/rails/ui/swing/AutoLoadPoller.java (rev 0) +++ trunk/18xx/rails/ui/swing/AutoLoadPoller.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -0,0 +1,157 @@ +package rails.ui.swing; + +import java.io.*; +import java.util.Calendar; + +import javax.swing.SwingUtilities; + +import org.apache.log4j.Logger; + +import rails.game.action.GameAction; + +public class AutoLoadPoller extends Thread { + + private GameUIManager guiMgr; + private String saveDirectory; + private String savePrefix; + private String ownPostfix; + private int pollingInterval; + private int pollingStatus; + + private boolean pollingActive = false; + + private String lastSavedFilenameFilepath; + private String lastSavedFilename = ""; + + public static final int OFF = 0; + public static final int ON = 1; + public static final int SUSPENDED = 2; + + protected static Logger log = + Logger.getLogger(AutoLoadPoller.class.getPackage().getName()); + + public AutoLoadPoller (GameUIManager guiMgr, String saveDirectory, String savePrefix, String ownPostfix, + int status, int pollingInterval) { + + this.guiMgr = guiMgr; + this.saveDirectory = saveDirectory; + this.savePrefix = savePrefix; + this.ownPostfix = ownPostfix; + this.pollingStatus = status; + this.pollingInterval = pollingInterval; + + lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails"; + + } + + @Override + public void run () { + + log.info ("AutoLoadPoller started"); + + int secs, sleepTime; + String currentFilename; + + for (;;) { + + log.debug ("Polling cycle"); + // Process + if (pollingActive && pollingStatus == ON) { + log.debug("Polling..."); + try { + BufferedReader in = new BufferedReader (new FileReader (lastSavedFilenameFilepath)); + currentFilename = in.readLine(); + in.close(); + log.debug("Read filename "+currentFilename+"; last saved filename "+lastSavedFilename); + + if (!lastSavedFilename.equals(currentFilename)) { + final GameAction reload = new GameAction (GameAction.RELOAD); + reload.setFilepath(saveDirectory+"/"+currentFilename); + lastSavedFilename = currentFilename; + + // The GUI must be accessed on the event dispatch thread only. + SwingUtilities.invokeLater (new Runnable() { + public void run() { + guiMgr.processOnServer(reload); + } + }); + + } + + } catch (IOException e) { + + } + } + + + + secs = Calendar.getInstance().get(Calendar.SECOND); + try { + sleepTime = 1000 * (pollingInterval - secs%pollingInterval); + sleep (sleepTime); + } catch (InterruptedException e) { + continue; + } + } + // This thread never exits + } + + public String getSaveDirectory() { + return saveDirectory; + } + + public void setSaveDirectory(String saveDirectory) { + this.saveDirectory = saveDirectory; + } + + public String getSavePrefix() { + return savePrefix; + } + + public void setSavePrefix(String savePrefix) { + this.savePrefix = savePrefix; + } + + public String getOwnPostfix() { + return ownPostfix; + } + + public void setOwnPostfix(String ownPostfix) { + this.ownPostfix = ownPostfix; + } + + public int getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(int pollingInterval) { + this.pollingInterval = pollingInterval; + } + + public int getStatus() { + return pollingStatus; + } + + public void setStatus(int status) { + this.pollingStatus = status; + } + + public boolean isActive() { + return pollingActive; + } + + public void setActive(boolean pollingActive) { + this.pollingActive = pollingActive; + log.debug("AutoLoad polling set to "+pollingActive); + } + + public String getLastSavedFilename() { + return lastSavedFilename; + } + + public void setLastSavedFilename(String lastSavedFilename) { + this.lastSavedFilename = lastSavedFilename; + } + + +} Property changes on: trunk/18xx/rails/ui/swing/AutoLoadPoller.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java =================================================================== --- trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java (rev 0) +++ trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -0,0 +1,146 @@ +/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/ui/swing/elements/AutoSaveLoadDialog.java,v 1.8 2010/01/31 22:22:34 macfreek Exp $*/ +package rails.ui.swing; + +import java.awt.*; +import java.awt.event.*; + +import javax.swing.*; + +import org.apache.log4j.Logger; + +import rails.ui.swing.elements.DialogOwner; +import rails.ui.swing.elements.Spinner; +import rails.util.LocalText; + +/** + * A generic dialog for presenting choices by radio buttons. + */ +public class AutoSaveLoadDialog extends JDialog implements ActionListener { + + private static final long serialVersionUID = 1L; + GridBagConstraints gc; + JPanel optionsPane, buttonPane; + JButton okButton, cancelButton; + JRadioButton[] choiceButtons; + Spinner intervalSpinner; + Dimension size, optSize; + ButtonGroup group; + DialogOwner owner; + + int status; + int interval; + + private static final int NUM_OPTIONS = 3; + + protected static Logger log = + Logger.getLogger(AutoSaveLoadDialog.class.getPackage().getName()); + + public AutoSaveLoadDialog(DialogOwner owner, int oldStatus, int oldInterval) { + super((Frame) null, "AutoSaveLoad settings", false); // Non-modal + this.owner = owner; + this.status = oldStatus; + this.interval = oldInterval; + + initialize(); + pack(); + + int x = 400; + int y = 400; + setLocation(x, y); + + setVisible(true); + setAlwaysOnTop(true); + } + + private void initialize() { + gc = new GridBagConstraints(); + + optionsPane = new JPanel(); + buttonPane = new JPanel(); + + okButton = new JButton(LocalText.getText("OK")); + okButton.setMnemonic(KeyEvent.VK_O); + okButton.addActionListener(this); + buttonPane.add(okButton); + + cancelButton = new JButton(LocalText.getText("Cancel")); + cancelButton.setMnemonic(KeyEvent.VK_C); + cancelButton.addActionListener(this); + buttonPane.add(cancelButton); + + choiceButtons = new JRadioButton[3]; + intervalSpinner = new Spinner (interval, 10, 0, 10); + + getContentPane().setLayout(new GridBagLayout()); + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + optionsPane.setLayout(new GridBagLayout()); + // optionsPane.setBorder(BorderFactory.createLoweredBevelBorder()); + optionsPane.add(new JLabel(LocalText.getText("AutoSaveLoadOptions")), + constraints(0, 0, 10, 10, 10, 10)); + + choiceButtons = new JRadioButton[NUM_OPTIONS]; + group = new ButtonGroup(); + String[] options = new String[] { + LocalText.getText("Off"), + LocalText.getText("On"), + LocalText.getText("Suspended") + }; + + for (int i = 0; i < NUM_OPTIONS; i++) { + choiceButtons[i] = + new JRadioButton(options[i], i == status); + optionsPane.add(choiceButtons[i], constraints(0, 1 + i, 0, 0, 0, 0)); + choiceButtons[i].setPreferredSize(size); + group.add(choiceButtons[i]); + } + + optionsPane.add (new JLabel("Polling interval:"), constraints (0,5,0,0,0,0)); + intervalSpinner.setVisible(true); + optionsPane.add (intervalSpinner, constraints (1, 5, 0,0,0,0)); + optionsPane.add (new JLabel("sec."), constraints (2,5,0,0,0,0)); + + getContentPane().add(optionsPane, constraints(0, 0, 0, 0, 0, 0)); + getContentPane().add(buttonPane, constraints(0, 1, 0, 0, 0, 0)); + } + + private GridBagConstraints constraints(int gridx, int gridy, int leftinset, + int topinset, int rightinset, int bottominset) { + if (gridx >= 0) gc.gridx = gridx; + if (gridy >= 0) gc.gridy = gridy; + gc.fill = GridBagConstraints.BOTH; + gc.weightx = 0.5; + gc.weighty = 0.5; + if (leftinset >= 0) gc.insets.left = leftinset; + if (topinset >= 0) gc.insets.top = topinset; + if (rightinset >= 0) gc.insets.right = rightinset; + if (bottominset >= 0) gc.insets.bottom = bottominset; + + return gc; + } + + public void actionPerformed(ActionEvent arg0) { + if (arg0.getSource().equals(okButton)) { + for (int i = 0; i < NUM_OPTIONS; i++) { + if (choiceButtons[i].isSelected()) { + status = i; + break; + } + } + interval = ((Integer) intervalSpinner.getValue()).intValue(); + } else if (arg0.getSource().equals(cancelButton)) { + status = -1; + } + this.setVisible(false); + this.dispose(); + owner.dialogActionPerformed(); + } + + public synchronized int getStatus() { + return status; + } + + public synchronized int getInterval() { + return interval; + } +} Property changes on: trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -4,7 +4,7 @@ import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; -import java.io.File; +import java.io.*; import java.text.SimpleDateFormat; import java.util.*; @@ -60,11 +60,20 @@ protected String saveDirectory; protected String savePattern; protected String saveExtension; + protected String savePrefix; protected String saveSuffixSpec = ""; protected String saveSuffix = ""; protected String providedName = null; protected SimpleDateFormat saveDateTimeFormat; protected File lastFile, lastDirectory; + + protected boolean autoSaveLoadInitialized = false; + protected int autoSaveLoadStatus = 0; + protected int autoSaveLoadPollingInterval = 30; + protected AutoLoadPoller autoLoadPoller = null; + protected boolean myTurn = true; + protected String lastSavedFilenameFilepath; + protected String lastSavedFilename = ""; protected WindowSettings windowSettings; @@ -88,6 +97,7 @@ instance = this; this.gameManager = gameManager; uiHints = gameManager.getUIHints(); + savePrefix = gameManager.getGameName(); initWindowSettings(); initSaveSettings(); @@ -133,7 +143,9 @@ } saveSuffixSpec = Config.get("save.filename.suffix"); if (Util.hasValue(saveSuffixSpec) && !saveSuffixSpec.equals(NEXT_PLAYER_SUFFIX)) { - saveSuffix = "_" + saveSuffixSpec; + saveSuffix = saveSuffixSpec; + } else { + saveSuffix = getPlayerNames().get(0); } } @@ -241,30 +253,26 @@ // Follow-up the result log.debug("==Result from server: " + result); reportWindow.updateLog(); - /* - if (DisplayBuffer.getAutoDisplay()) { - if (displayServerMessage()) { - // Interrupt processing. - // Will be continued via dialogActionPerformed(). - return true; + + // Process any autosaving and turn relinquishing, resp. autoloading and turn pickup + if (autoSaveLoadInitialized && autoSaveLoadStatus != AutoLoadPoller.OFF) { + Player newPlayer = getCurrentPlayer(); + boolean wasMyTurn = myTurn; + myTurn = newPlayer.getName().equals(saveSuffix); + if (newPlayer != player) { + if (wasMyTurn && !myTurn) { + log.info ("Relinquishing turn to "+newPlayer.getName()); + autoSave (newPlayer.getName()); + autoLoadPoller.setLastSavedFilename(lastSavedFilename); + autoLoadPoller.setActive(true); + } else if (!wasMyTurn && myTurn) { + log.info ("Resuming turn as "+saveSuffix); + autoLoadPoller.setActive(false); + } } - }*/ + } } - // End of game checks -// if (gameManager.isGameOver()) { -// -// statusWindow.reportGameOver(); -// -// return true; -// -// } -// else if (gameManager.getBank().isJustBroken()) { -// -// statusWindow.reportBankBroken(); -// -// } - // Check in which round we are now, // and make sure that the right window is active. updateUI(); @@ -450,19 +458,19 @@ if (StartRoundWindow.class.isAssignableFrom(activeWindow.getClass())) { log.debug("Updating Start round window"); - startRoundWindow.updateStatus(); + startRoundWindow.updateStatus(myTurn); startRoundWindow.setSRPlayerTurn(startRound.getCurrentPlayerIndex()); } else if (StatusWindow.class.isAssignableFrom(activeWindow.getClass())) { // } else { log.debug("Updating Stock (status) round window"); - statusWindow.updateStatus(); + statusWindow.updateStatus(myTurn); } else if (ORWindow.class.isAssignableFrom(activeWindow.getClass())) { log.debug("Updating Operating round window"); - orUIManager.updateStatus(); + orUIManager.updateStatus(myTurn); } updateStatus(activeWindow); @@ -648,16 +656,48 @@ RepayLoans action = (RepayLoans) currentDialogAction; int selected = dialog.getSelectedOption(); action.setNumberTaken(action.getMinNumber() + selected); + } else if (currentDialog instanceof MessageDialog) { // Nothing to do currentDialogAction = null; // Should already be null + + } else if (currentDialog instanceof AutoSaveLoadDialog) { + + autoSaveLoadGame2 ((AutoSaveLoadDialog)currentDialog); + } else { return; } } - processOnServer(currentDialogAction); + if (currentDialogAction != null) processOnServer(currentDialogAction); + } + + protected void autoSave (String newPlayer) { + lastSavedFilename = savePrefix + "_" + + saveDateTimeFormat.format(new Date()) + "_" + + newPlayer + "." + + saveExtension; + GameAction saveAction = new GameAction(GameAction.SAVE); + saveAction.setFilepath(saveDirectory + "/" + lastSavedFilename); + log.debug("Autosaving to "+lastSavedFilename); + processOnServer (saveAction); + + try { + File f = new File (lastSavedFilenameFilepath); + PrintWriter out = new PrintWriter (new FileWriter (f)); + out.println (lastSavedFilename); + out.close(); + } catch (IOException e) { + log.error ("Exception whilst autosaving file '"+lastSavedFilenameFilepath+"'", e); + } + + } + + protected boolean pollingIsOn () { + return autoLoadPoller != null && autoLoadPoller.getStatus() == AutoLoadPoller.ON; + } /** Stub, can be overridden by subclasses */ protected boolean checkGameSpecificDialogAction() { @@ -713,8 +753,8 @@ if (providedName != null) { filename = providedName; } else { - filename = saveDirectory + "/" + gameManager.getGameName() + "_" - + saveDateTimeFormat.format(new Date()) + filename = saveDirectory + "/" + savePrefix + "_" + + saveDateTimeFormat.format(new Date())+ "_" + saveSuffix + ".txt"; } @@ -747,11 +787,11 @@ filename = providedName; } else { if (NEXT_PLAYER_SUFFIX.equals(saveSuffixSpec)) { - saveSuffix = "_" + gameManager.getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_"); + saveSuffix = gameManager.getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_"); } filename = - saveDirectory + "/" + gameManager.getGameName() + "_" - + saveDateTimeFormat.format(new Date()) + saveDirectory + "/" + savePrefix + "_" + + saveDateTimeFormat.format(new Date()) + "_" + saveSuffix + "." + saveExtension; } @@ -767,7 +807,17 @@ String filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); if (!selectedFile.getName().equalsIgnoreCase(proposedFile.getName())) { - providedName = filepath; + // User has not accepted the default name but entered a different one. + // Check the new name. If only the prefix has changed, only remember that part. + String[] proposedParts = proposedFile.getName().split("_", 2); + String[] selectedParts = selectedFile.getName().split("_", 2); + if (!proposedParts[0].equals(selectedParts[0]) + && proposedParts[1].equals(selectedParts[1])) { + savePrefix = selectedParts[0]; + } else { + // Otherwise, remember and keep using the whole filename. + providedName = filepath; + } } saveAction.setFilepath(filepath); processOnServer(saveAction); @@ -791,7 +841,81 @@ } - public void setSaveDirectory(String saveDirectory) { + public void autoSaveLoadGame () { + + AutoSaveLoadDialog dialog = new AutoSaveLoadDialog (this, + autoSaveLoadStatus, + autoSaveLoadPollingInterval); + setCurrentDialog(dialog, null); + } + + public void autoSaveLoadGame2 (AutoSaveLoadDialog dialog) { + + autoSaveLoadStatus = dialog.getStatus(); + autoSaveLoadPollingInterval = dialog.getInterval(); + + if (autoLoadPoller == null && autoSaveLoadStatus > 0) { + autoLoadPoller = new AutoLoadPoller (this, saveDirectory, savePrefix, + saveSuffix, autoSaveLoadStatus, autoSaveLoadPollingInterval); + autoLoadPoller.start(); + } else if (autoLoadPoller != null) { + autoLoadPoller.setStatus(autoSaveLoadStatus); + autoLoadPoller.setPollingInterval(autoSaveLoadPollingInterval); + } + log.debug("AutoSaveLoad parameters: status="+autoSaveLoadStatus + +" interval="+autoSaveLoadPollingInterval); + + if (autoLoadPoller != null && autoSaveLoadStatus != AutoLoadPoller.OFF + && !autoSaveLoadInitialized) { + + /* The first time (only) we use the normal save process, + * so the player can select a directory, and change + * the prefix if so desired. + */ + GameAction saveAction = new GameAction(GameAction.SAVE); + saveGame (saveAction); + File lastSavedFile = new File (saveAction.getFilepath()); + saveDirectory = lastSavedFile.getParentFile().getPath(); + + /* Now also save the "last saved file" file */ + String lastSavedFilename = lastSavedFile.getName(); + lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails"; + try { + File f = new File (lastSavedFilenameFilepath); + PrintWriter out = new PrintWriter (new FileWriter (f)); + out.println (lastSavedFilename); + out.close(); + autoSaveLoadInitialized = true; + } catch (IOException e) { + log.error ("Exception whilst creating .last_rails file '" + + lastSavedFilenameFilepath + "'", e); + } + } + + myTurn = getCurrentPlayer().getName().equals(saveSuffix); + + if (!myTurn) { + // Start autoload polling + autoLoadPoller.setActive(autoSaveLoadStatus == AutoLoadPoller.ON && !myTurn); + log.debug("MyTurn="+myTurn+" poller status="+autoLoadPoller.getStatus() + +" active="+autoLoadPoller.isActive()); + + } else { + myTurn = true; + log.debug("MyTurn="+myTurn); + } + + } + + public boolean isMyTurn() { + return myTurn; + } + + public void setMyTurn(boolean myTurn) { + this.myTurn = myTurn; + } + + public void setSaveDirectory(String saveDirectory) { this.saveDirectory = saveDirectory; } Modified: trunk/18xx/rails/ui/swing/ORUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -498,7 +498,7 @@ } else { log.debug("Allocation is unknown, asking for it"); setLocalStep(SELECT_PAYOUT); - updateStatus(action); + updateStatus(action, true); // Locally update revenue if we don't inform the server yet. orPanel.setRevenue(orCompIndex, amount); @@ -1443,13 +1443,13 @@ } - public void updateStatus() { + public void updateStatus(boolean myTurn) { - updateStatus(null); + updateStatus(null, myTurn); } - public void updateStatus(PossibleAction actionToComplete) { + public void updateStatus(PossibleAction actionToComplete, boolean myTurn) { mapRelatedActions.clear(); @@ -1457,6 +1457,8 @@ messagePanel.setMessage(null); + if (!myTurn) return; + if (actionToComplete != null) { log.debug("ExecutedAction: " + actionToComplete); } Modified: trunk/18xx/rails/ui/swing/ORWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -192,12 +192,12 @@ requestFocus(); } - public void updateStatus() { + public void updateStatus(boolean myTurn) { // Safety check. Do nothing if this method is called outside Operating Rounds, // for instance when a token is exchanged during a Stock Round. if (!(gameUIManager.getCurrentRound() instanceof OperatingRound)) return; - orUIManager.updateStatus(); + orUIManager.updateStatus(myTurn); requestFocus(); } Modified: trunk/18xx/rails/ui/swing/StartRoundWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -374,7 +374,7 @@ } - public void updateStatus() { + public void updateStatus(boolean myTurn) { StartItem item; int i, j; @@ -384,6 +384,8 @@ } // Unselect the selected private dummyButton.setSelected(true); + + if (!myTurn) return; // For debugging for (PossibleAction action : possibleActions.getList()) { Modified: trunk/18xx/rails/ui/swing/StatusWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -31,6 +31,8 @@ protected static final String SAVE_CMD = "Save"; protected static final String RELOAD_CMD = "Reload"; + + protected static final String AUTOSAVELOAD_CMD = "AutoSaveLoad"; protected static final String EXPORT_CMD = "Export"; @@ -80,8 +82,7 @@ private JMenuItem menuItem; - private ActionMenuItem saveItem; - private ActionMenuItem reloadItem; + private ActionMenuItem actionMenuItem; private ActionMenuItem undoItem, forcedUndoItem, redoItem, redoItem2; @@ -109,27 +110,36 @@ moderatorMenu.setMnemonic(KeyEvent.VK_M); specialMenu.setMnemonic(KeyEvent.VK_S); - saveItem = new ActionMenuItem(LocalText.getText("SAVE")); - saveItem.setActionCommand(SAVE_CMD); - saveItem.setMnemonic(KeyEvent.VK_S); - saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, + actionMenuItem = new ActionMenuItem(LocalText.getText("SAVE")); + actionMenuItem.setActionCommand(SAVE_CMD); + actionMenuItem.setMnemonic(KeyEvent.VK_S); + actionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK)); - saveItem.addActionListener(this); - saveItem.setEnabled(true); - saveItem.setPossibleAction(new GameAction(GameAction.SAVE)); - fileMenu.add(saveItem); + actionMenuItem.addActionListener(this); + actionMenuItem.setEnabled(true); + actionMenuItem.setPossibleAction(new GameAction(GameAction.SAVE)); + fileMenu.add(actionMenuItem); - reloadItem = new ActionMenuItem(LocalText.getText("Reload")); - reloadItem.setActionCommand(RELOAD_CMD); - reloadItem.setMnemonic(KeyEvent.VK_R); - reloadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, + actionMenuItem = new ActionMenuItem(LocalText.getText("Reload")); + actionMenuItem.setActionCommand(RELOAD_CMD); + actionMenuItem.setMnemonic(KeyEvent.VK_R); + actionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK)); - reloadItem.addActionListener(this); - reloadItem.setEnabled(true); - reloadItem.setPossibleAction(new GameAction(GameAction.RELOAD)); - fileMenu.add(reloadItem); + actionMenuItem.addActionListener(this); + actionMenuItem.setEnabled(true); + actionMenuItem.setPossibleAction(new GameAction(GameAction.RELOAD)); + fileMenu.add(actionMenuItem); - // export menu item + menuItem = new JMenuItem(LocalText.getText("AutoSaveLoad")); + menuItem.setActionCommand(AUTOSAVELOAD_CMD); + menuItem.setMnemonic(KeyEvent.VK_A); + menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, + ActionEvent.ALT_MASK)); + menuItem.addActionListener(this); + menuItem.setEnabled(true); + fileMenu.add(menuItem); + + // export menu item // exportItem = new ActionMenuItem(LocalText.getText("EXPORT")); // exportItem.setActionCommand(EXPORT_CMD); // exportItem.addActionListener(this); @@ -182,7 +192,7 @@ menuItem.addActionListener(this); optMenu.add(menuItem); - // new config menu only for non legacy configgfiles + // new config menu only for non legacy configfiles if (!Config.isLegacyConfigFile()) { menuItem = new JCheckBoxMenuItem(LocalText.getText("CONFIG")); menuItem.setName(CONFIG_CMD); @@ -289,9 +299,6 @@ setSize(800, 300); -// Rectangle bounds = graphicsConfiguration.getBounds(); -// setLocation(bounds.x+ 25, bounds.y + 450); - buttonPanel.setBorder(BorderFactory.createEtchedBorder()); buttonPanel.setOpaque(false); @@ -350,17 +357,13 @@ forcedUndoItem.setEnabled(false); redoItem.setEnabled(false); redoItem2.setEnabled(false); - // SAVE is always enabled - + // SAVE, RELOAD, AUTOSAVELOAD are always enabled + List<GameAction> gameActions = possibleActions.getType(GameAction.class); if (gameActions != null) { for (GameAction na : gameActions) { switch (na.getMode()) { - // SAVE is now enabled by default - //case GameAction.SAVE: - // saveItem.setPossibleAction(na); - // break; case GameAction.UNDO: undoItem.setEnabled(true); undoItem.setPossibleAction(na); @@ -425,11 +428,13 @@ } - public void updateStatus() { + public void updateStatus(boolean myTurn) { if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound)) return; + if (!myTurn) return; + // Moved here from StatusWindow_1856. It's getting generic... if (possibleActions.contains(DiscardTrain.class)) { immediateAction = possibleActions.getType(DiscardTrain.class).get(0); @@ -635,6 +640,8 @@ gameUIManager.orWindow.setVisible(((JMenuItem) actor.getSource()).isSelected()); } else if (command.equals(CONFIG_CMD)) { gameUIManager.configWindow.setVisible(((JMenuItem) actor.getSource()).isSelected()); + } else if (command.equals(AUTOSAVELOAD_CMD)) { + gameUIManager.autoSaveLoadGame(); } else if (executedAction == null) { ; } else if (executedAction instanceof GameAction) { Modified: trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java =================================================================== --- trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -31,10 +31,10 @@ } @Override - public void updateStatus() { + public void updateStatus(boolean myTurn) { RoundI currentRound = gameUIManager.getCurrentRound(); if (!(currentRound instanceof PrussianFormationRound)) { - super.updateStatus(); + super.updateStatus(myTurn); } else if (possibleActions.contains(FoldIntoPrussian.class)) { immediateAction = possibleActions.getType(FoldIntoPrussian.class).get(0); } else if (possibleActions.contains(DiscardTrain.class)) { Modified: trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java =================================================================== --- trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-03-17 21:16:44 UTC (rev 1500) +++ trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-03-26 20:42:51 UTC (rev 1501) @@ -20,10 +20,10 @@ } @Override - public void updateStatus() { + public void updateStatus(boolean myTurn) { RoundI currentRound = gameUIManager.getCurrentRound(); if (!(currentRound instanceof CGRFormationRound)) { - super.updateStatus(); + super.updateStatus(myTurn); } else if (possibleActions.contains(RepayLoans.class)) { //RepayLoans action = possibleActions.getType(RepayLoans.class).get(0); //repayLoans (action); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-26 20:56:20
|
Revision: 1502 http://rails.svn.sourceforge.net/rails/?rev=1502&view=rev Author: evos Date: 2011-03-26 20:56:14 +0000 (Sat, 26 Mar 2011) Log Message: ----------- Autosave/load, added popup Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/rails/ui/swing/GameUIManager.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-03-26 20:42:51 UTC (rev 1501) +++ trunk/18xx/LocalisedText.properties 2011-03-26 20:56:14 UTC (rev 1502) @@ -696,4 +696,5 @@ YouMustRaiseCash=You must raise {0} cash by selling shares YouMustRaiseCashButCannot=You must still raise {0}, but you can''t sell any more shares. YouMustSelect1=You must select {0} item(s) -YouMustSelect2=You must select between {0} and {1} items \ No newline at end of file +YouMustSelect2=You must select between {0} and {1} items +YourTurn={0}, it''s your turn again \ No newline at end of file Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:42:51 UTC (rev 1501) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:56:14 UTC (rev 1502) @@ -268,7 +268,11 @@ } else if (!wasMyTurn && myTurn) { log.info ("Resuming turn as "+saveSuffix); autoLoadPoller.setActive(false); - } + setCurrentDialog(new MessageDialog(this, + LocalText.getText("Message"), + LocalText.getText("YourTurn", saveSuffix)), + null); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-03-29 13:14:06
|
Revision: 1503 http://rails.svn.sourceforge.net/rails/?rev=1503&view=rev Author: evos Date: 2011-03-29 13:13:57 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Contribution by Bill Rosgen: Private purchasing rules are now all defined as PrivateCompany attributes with the new <Tradeable> tag. This includes the price factor limits, which were formerly defined with the (buying) major Company type. The 1830 B&O private is now correctly excluded. Modified Paths: -------------- trunk/18xx/data/1830/CompanyManager.xml trunk/18xx/data/1856/CompanyManager.xml trunk/18xx/data/1870/CompanyManager.xml trunk/18xx/data/1889/CompanyManager.xml trunk/18xx/data/18AL/CompanyManager.xml trunk/18xx/data/18Kaas/CompanyManager.xml trunk/18xx/data/18VA/CompanyManager.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/game/OperatingRound.java trunk/18xx/rails/game/PrivateCompany.java trunk/18xx/rails/game/PrivateCompanyI.java trunk/18xx/rails/game/PublicCompany.java trunk/18xx/rails/game/PublicCompanyI.java trunk/18xx/rails/util/Tag.java Added Paths: ----------- trunk/18xx/data/18GA/ trunk/18xx/data/18GA/CompanyManager.xml trunk/18xx/data/18GA/Game.xml trunk/18xx/data/18GA/Map.xml trunk/18xx/data/18GA/StockMarket.xml trunk/18xx/data/18GA/TileSet.xml trunk/18xx/data/18GA/Tiles.xml trunk/18xx/data/18JR/ trunk/18xx/data/18JR/CompanyManager.xml trunk/18xx/data/18JR/Game.xml trunk/18xx/data/18JR/Map.xml trunk/18xx/data/18JR/StockMarket.xml trunk/18xx/data/18JR/TileSet.xml trunk/18xx/data/18JR/Tiles.xml Modified: trunk/18xx/data/1830/CompanyManager.xml =================================================================== --- trunk/18xx/data/1830/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502) +++ trunk/18xx/data/1830/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -4,9 +4,11 @@ <ClosingConditions> <Phase>5</Phase> </ClosingConditions> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <Tradeable toPlayer="yes"/> </CompanyType> <CompanyType name="Public" class="rails.game.PublicCompany"> - <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <CanBuyPrivates/> <PoolPaysOut/> <Float percentage="60"/> <ShareUnit percentage="10"/> @@ -64,6 +66,7 @@ longname="Baltimore & Ohio"> <Info key="ComesWithPresidency" parm="B&O,20"/> <Blocking hex="I13,I15"/> + <Tradeable toCompany="no"/> </Company> <!-- Note two supported colour specification formats: Modified: trunk/18xx/data/1856/CompanyManager.xml =================================================================== --- trunk/18xx/data/1856/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502) +++ trunk/18xx/data/1856/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -1,9 +1,10 @@ <?xml version="1.0"?> <CompanyManager> <CompanyType name="Private" class="rails.game.PrivateCompany"> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/> </CompanyType> <CompanyType name="Public" class="rails.game.specific._1856.PublicCompany_1856"> - <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <CanBuyPrivates/> <PoolPaysOut/> <ShareUnit percentage="10"/> <Certificate type="President" shares="2"/> Modified: trunk/18xx/data/1870/CompanyManager.xml =================================================================== --- trunk/18xx/data/1870/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502) +++ trunk/18xx/data/1870/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -3,10 +3,11 @@ <CompanyManager> <CompanyType name="Private" class="rails.game.PrivateCompany"> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/> </CompanyType> <CompanyType name="Public" class="rails.game.PublicCompany"> - <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <CanBuyPrivates/> <IPOPaysOut/> <Float percentage="60"/> <CanSplitDividend/> Modified: trunk/18xx/data/1889/CompanyManager.xml =================================================================== --- trunk/18xx/data/1889/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502) +++ trunk/18xx/data/1889/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -2,10 +2,11 @@ <CompanyManager> <!-- Specific PrivateCompany to avoid closing of Uno-Takamatsu Ferry --> <CompanyType name="Private" class="rails.game.PrivateCompany"> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/> </CompanyType> <CompanyType name="Public" class="rails.game.PublicCompany"> <IfOption name="BeginnerGame" value="no"> - <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <CanBuyPrivates/> </IfOption> <PoolPaysOut/> <Float percentage="50"/> Modified: trunk/18xx/data/18AL/CompanyManager.xml =================================================================== --- trunk/18xx/data/18AL/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502) +++ trunk/18xx/data/18AL/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -1,9 +1,10 @@ <?xml version="1.0"?> <CompanyManager> <CompanyType name="Private" class="rails.game.PrivateCompany"> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="1.5"/> </CompanyType> <CompanyType name="Public" class="rails.game.PublicCompany"> - <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="1.5"/> + <CanBuyPrivates/> <PoolPaysOut/> <Float percentage="60"/> <ShareUnit percentage="10"/> Added: trunk/18xx/data/18GA/CompanyManager.xml =================================================================== --- trunk/18xx/data/18GA/CompanyManager.xml (rev 0) +++ trunk/18xx/data/18GA/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,49 @@ +<?xml version="1.0"?> +<CompanyManager> + <CompanyType name="Private" class="rails.game.PrivateCompany"> + </CompanyType> + <CompanyType name="Public" class="rails.game.PublicCompany"> + <PoolPaysOut/> + <Float percentage="60"/> + <ShareUnit percentage="10"/> + <Certificate type="President" shares="2"/> + <Certificate shares="1" number="8"/> + <BaseTokens> + <LayCost method="sequence" cost="0,40,100"/> + </BaseTokens> + <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> + </CompanyType> + <Company name="LTRR" type="Private" basePrice="20" revenue="5" longname="Lexington Terminal RR"/> + <Company name="MRC" type="Private" basePrice="40" revenue="10" longname="Midland Railroad Co."/> + <Company name="WSRR" type="Private" basePrice="70" revenue="15" longname="Waycross & Southern RR"/> + <Company name="OSRR" type="Private" basePrice="100" revenue="20" longname="Ocilla Southern RR"/> + <Company name="MBRR" type="Private" basePrice="150" revenue="25" longname="Macon & Birmingham RR"/> + + <Company name="ACL" type="Public" tokens="4" fgColour="FFFFFF" bgColour="1F1A17" longname="Atlantic Coast Line"> + <Home hex="J12" /> + </Company> + <Company name="CoG" type="Public" tokens="4" fgColour="FFFFFF" bgColour="CC3366" longname="Central of Georgia"> + <Home hex="F6" /> + </Company> + <Company name="GR" type="Public" tokens="4" fgColour="FFFFFF" bgColour="219C29" longname="Georgia Railroad"> + <Home hex="D10" /> + </Company> + <Company name="G&F" type="Public" tokens="2" fgColour="000000" bgColour="75C4F0" longname="Georgia & Florida RR"> + <Home hex="H4" /> + </Company> + <Company name="SAL" type="Public" tokens="3" fgColour="000000" bgColour="F7C400" longname="Seaboard Air Line"> + <Home hex="G13" /> + </Company> + <Company name="W&AR" type="Public" tokens="2" fgColour="FFFFFF" bgColour="994778" longname="Western & Atlantic Railroad"> + <Home hex="D4" /> + </Company> + <StartPacket roundClass="rails.game.StartRound_1830"> + <Bidding initial="5" minimum="5" increment="1" /> + <Item name="LTRR" type="Private" basePrice="20" /> + <Item name="MRC" type="Private" basePrice="40" /> + <Item name="WSRR" type="Private" basePrice="70" /> + <Item name="OSRR" type="Private" basePrice="100" /> + <Item name="MBRR" type="Private" basePrice="150" /> + </StartPacket> +</CompanyManager> \ No newline at end of file Property changes on: trunk/18xx/data/18GA/CompanyManager.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18GA/Game.xml =================================================================== --- trunk/18xx/data/18GA/Game.xml (rev 0) +++ trunk/18xx/data/18GA/Game.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<ComponentManager> + <Component name="GameManager" class="rails.game.GameManager"> + <Game name="18GA"/> + <GameParameters> + <PlayerShareLimit percentage="60"/> + <BankPoolLimit percentage="50"/> + <StockRound> + <NoSaleInFirstSR/> + </StockRound> + </GameParameters> + <GuiClasses> + </GuiClasses> + <EndOfGame> + <Bankruptcy/> + <BankBreaks limit="0" finish="currentOR"/> + <!-- "Runs out"; when "broken", -1 is the limit --> + <!-- Also when the share value reaches $300; this is configured in teh stock market XML --> + </EndOfGame> + </Component> + <Component name="PlayerManager" class="rails.game.PlayerManager"> + <Players number="3" cash="600" certLimit="15"/> + <Players number="4" cash="450" certLimit="12"/> + <Players number="5" cash="360" certLimit="10"/> + </Component> + <Component name="Bank" class="rails.game.Bank"> + <Bank amount="8000"/> + </Component> + <Component name="TileManager" class="rails.game.TileManager" + file="TileSet.xml"/> + <Component name="Map" class="rails.game.MapManager" file="Map.xml"/> + <Component name="CompanyManager" class="rails.game.CompanyManager" + file="CompanyManager.xml"/> + <Component name="StockMarket" class="rails.game.StockMarket" + file="StockMarket.xml"/> + <Component name="TrainManager" class="rails.game.TrainManager"> + <Train name="2" majorStops="2" cost="100" amount="5"/> + <Train name="3" majorStops="3" cost="180" amount="4" startPhase="3"/> + <Train name="4" majorStops="4" cost="300" amount="3" startPhase="4" + rustedTrain="2" > + <IfOption name="Obsolete4Trains" value="yes"> + <Attributes obsoleting="yes"/> + </IfOption> + <IfOption name="Obsolete4Trains" value="no"> + <Attributes obsoleting="no"/> + </IfOption> + </Train>/> + <Train name="5" majorStops="5" cost="450" amount="2" startPhase="5"/> + <Train name="6" majorStops="6" cost="630" amount="2" startPhase="6" + rustedTrain="3"/> + <Train name="8" majorStops="8" cost="800" amount="5" startPhase="8" + rustedTrain="4"/> + </Component> + <Component name="PhaseManager" class="rails.game.PhaseManager"> + <Phase name="2" > + <Tiles colour="yellow"/> + <OperatingRounds number="1"/> + <Trains onePerTurn="yes" tradingAllowed="yes"/> + </Phase> + <Phase name="3"> + <Tiles colour="yellow,green"/> + <Privates sellingAllowed="yes"/> + <OperatingRounds number="2"/> + </Phase> + <Phase name="4"> + <Tiles colour="yellow,green"/> + <Trains onePerTurn="no"/> + </Phase> + <Phase name="5"> + <Tiles colour="yellow,green,brown"/> + <OperatingRounds number="3"/> + <Privates close="yes"/> + <OffBoardRevenue step="2"/> + </Phase> + <Phase name="6"> + <Tiles colour="yellow,green,brown"/> + </Phase> + <Phase name="8"> + <Tiles colour="yellow,green,brown,grey"/> + </Phase> + </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + </Component> +</ComponentManager> \ No newline at end of file Property changes on: trunk/18xx/data/18GA/Game.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18GA/Map.xml =================================================================== --- trunk/18xx/data/18GA/Map.xml (rev 0) +++ trunk/18xx/data/18GA/Map.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,117 @@ +<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="vertical" even="B"> + <Hex name="A3" tile="-902" orientation="1" value="30,60" city="Chattanooga" /> + + <Hex name="B2" tile="0" cost="60"> + <Symbols> + <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" /> + </Symbols> + </Hex> + <Hex name="B4" tile="0" /> + <Hex name="B6" tile="0" cost="60"> + <Symbols> + <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" /> + </Symbols> + </Hex> + <Hex name="B8" tile="0" cost="60"> + <Symbols> + <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" /> + </Symbols> + </Hex> + <Hex name="B10" tile="-902" orientation="2" value="30,40" city="Greeneville" /> + + <Hex name="C1" tile="0" cost="60"> + <Symbols> + <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" /> + </Symbols> + </Hex> + <Hex name="C3" tile="-3008" city="Rome" /> + <Hex name="C5" tile="0" cost="20"> + <River from="center" to="D4" /> + </Hex> + <Hex name="C7" tile="0" /> + <Hex name="C9" tile="0" /> + + <Hex name="D2" tile="0" /> + <Hex name="D4" tile="-3008" city="Atlanta" /> + <Hex name="D6" tile="0" /> + <Hex name="D8" tile="0" /> + <Hex name="D10" tile="-3008" city="Augusta" /> + + <Hex name="E1" tile="-1143" orientation="1" value="30,40" city="Montgomery" /> + <Hex name="E3" tile="0" cost="40"> + <River from="D4" to="F2" /> + </Hex> + <Hex name="E5" tile="0" /> + <Hex name="E7" tile="-1" cost="20" city="Milledgeville"> + <River from="center" to="F8" /> + </Hex> + <Hex name="E9" tile="0" /> + <Hex name="E11" tile="0" /> + + <Hex name="F2" tile="0" cost="40"> + <River from="E3" to="G3" /> + </Hex> + <Hex name="F4" tile="0"> + <Private name="MBRR" /> + </Hex> + <Hex name="F6" tile="-3008" city="Macon" /> + <Hex name="F8" tile="0" cost="20"> + <River from="E7" to="G9" /> + </Hex> + <Hex name="F10" tile="0" /> + <Hex name="F12" tile="0" cost="40"> + <Symbols> + <Symbol name="swamp" where="tpCenter" anchorX="center" anchorY="bottom" fromPhase="0" toPhase="0" /> + </Symbols> + <Private name="MRC" /> + </Hex> + + <Hex name="G1" tile="0"> + <River from="G3" to="H2" /> + </Hex> + <Hex name="G3" tile="-3008" cost="40" city="Columbus"> + <River from="F2" to="G1" /> + </Hex> + <Hex name="G5" tile="0" /> + <Hex name="G7" tile="0"> + <Private name="OSR" /> + </Hex> + <Hex name="G9" tile="0" cost="20"> + <River from="F8" to="H10" /> + </Hex> + <Hex name="G11" tile="-1" city="Statesboro" /> + <Hex name="G13" tile="-3008" city="Savannah" /> + + <Hex name="H2" tile="0" cost="40"> + <River from="G1" to="I3" /> + </Hex> + <Hex name="H4" tile="-3008" city="Albany" /> + <Hex name="H6" tile="0" /> + <Hex name="H8" tile="0" /> + <Hex name="H10" tile="0" cost="20"> + <River from="G9" to="H12" /> + </Hex> + <Hex name="H12" tile="0" cost="20"> + <River from="H10" to="H14" /> + </Hex> + + <Hex name="I3" tile="0" cost="40"> + <River from="H2" to="J4" /> + </Hex> + <Hex name="I5" tile="0" /> + <Hex name="I7" tile="-1" city="Valdosta" /> + <Hex name="I9" tile="-3008" city="Waycross"> + <Private name="WSRR" /> + </Hex> + <Hex name="I11" tile="-3008" city="Brunswick" /> + + <Hex name="J4" tile="-1143" value="20,50" city="Tallahassee" /> + <Hex name="J6" tile="0" /> + <Hex name="J8" tile="0" /> + <Hex name="J10" tile="0"> + <Symbols> + <Symbol name="swamp" where="tpCenter" anchorX="center" anchorY="bottom" fromPhase="0" toPhase="0" /> + </Symbols> + </Hex> + <Hex name="J12" tile="-912" orientation="3" value="30,60" city="Jacksonville" /> +</Map> \ No newline at end of file Property changes on: trunk/18xx/data/18GA/Map.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18GA/StockMarket.xml =================================================================== --- trunk/18xx/data/18GA/StockMarket.xml (rev 0) +++ trunk/18xx/data/18GA/StockMarket.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,104 @@ +<StockMarket type="rectangular"> + <StockSpaceType name="yellow" colour="FFFF00"> + <NoCertLimit /> + </StockSpaceType> + + <StockSpace name="A1" price="60" /> + <StockSpace name="A2" price="55" /> + <StockSpace name="A3" price="50" type="yellow" /> + <StockSpace name="A4" price="45" type="yellow" /> + <StockSpace name="A5" price="40" type="yellow" /> + <StockSpace name="A6" price="35" type="yellow" /> + <StockSpace name="A7" price="30" type="yellow" /> + + <StockSpace name="B1" price="70" /> + <StockSpace name="B2" price="60" /> + <StockSpace name="B3" price="55" /> + <StockSpace name="B4" price="50" type="yellow" /> + <StockSpace name="B5" price="45" type="yellow" /> + <StockSpace name="B6" price="40" type="yellow" /> + <StockSpace name="B7" price="35" type="yellow" /> + + <StockSpace name="C1" price="80" /> + <StockSpace name="C2" price="70" /> + <StockSpace name="C3" price="60" /> + <StockSpace name="C4" price="55"> + <StartSpace /> + </StockSpace> + <StockSpace name="C5" price="50" type="yellow" /> + <StockSpace name="C6" price="45" type="yellow" /> + <StockSpace name="C7" price="40" type="yellow" /> + + <StockSpace name="D1" price="90" /> + <StockSpace name="D2" price="80" /> + <StockSpace name="D3" price="70"> + <StartSpace /> + </StockSpace> + <StockSpace name="D4" price="60" /> + <StockSpace name="D5" price="55" /> + <StockSpace name="D6" price="50" type="yellow" /> + <StockSpace name="D7" price="45" type="yellow" /> + + <StockSpace name="E1" price="100" /> + <StockSpace name="E2" price="90"> + <StartSpace /> + </StockSpace> + <StockSpace name="E3" price="80" /> + <StockSpace name="E4" price="70" /> + <StockSpace name="E5" price="60" /> + <StockSpace name="E6" price="55" type="yellow" /> + <StockSpace name="E7" price="50" type="yellow" /> + + <StockSpace name="F1" price="110"> + <StartSpace /> + </StockSpace> + <StockSpace name="F2" price="100" /> + <StockSpace name="F3" price="90" /> + <StockSpace name="F4" price="80" /> + <StockSpace name="F5" price="70" /> + + <StockSpace name="G1" price="120" /> + <StockSpace name="G2" price="110" /> + <StockSpace name="G3" price="100" /> + <StockSpace name="G4" price="90" /> + <StockSpace name="G5" price="80" /> + + <StockSpace name="H1" price="135" /> + <StockSpace name="H2" price="120" /> + <StockSpace name="H3" price="110" /> + <StockSpace name="H4" price="100" /> + <StockSpace name="H5" price="90" /> + + <StockSpace name="I1" price="150" /> + <StockSpace name="I2" price="135" /> + <StockSpace name="I3" price="120" /> + <StockSpace name="I4" price="110" /> + + <StockSpace name="J1" price="170" /> + <StockSpace name="J2" price="150" /> + <StockSpace name="J3" price="135" /> + <StockSpace name="J4" price="120" /> + + <StockSpace name="K1" price="190" /> + <StockSpace name="K2" price="170" /> + <StockSpace name="K3" price="150" /> + <StockSpace name="K4" price="135" /> + + <StockSpace name="L1" price="210" /> + <StockSpace name="L2" price="190" /> + <StockSpace name="L3" price="170" /> + + <StockSpace name="M1" price="230" /> + <StockSpace name="M2" price="210" /> + <StockSpace name="M3" price="100" /> + + <StockSpace name="N1" price="250" /> + <StockSpace name="N2" price="230" /> + + <StockSpace name="O1" price="275" /> + <StockSpace name="O2" price="250" /> + + <StockSpace name="P1" price="300"> + <GameOver /> + </StockSpace> +</StockMarket> Property changes on: trunk/18xx/data/18GA/StockMarket.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18GA/TileSet.xml =================================================================== --- trunk/18xx/data/18GA/TileSet.xml (rev 0) +++ trunk/18xx/data/18GA/TileSet.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,236 @@ +<TileManager tiles="Tiles.xml"> + <!-- Preprinted Tiles--> + + <!-- Empty space --> + <Tile id="0"> + <Upgrade id="7,8,9" /> + </Tile> + + <!-- Dit --> + <Tile id="-1"> + <Upgrade id="3,4,58" /> + </Tile> + + <!-- City --> + <Tile id="-3008"> + <Upgrade id="5,6,57" /> + </Tile> + + <!-- Chattanooga (A3), Greeneville (B10) --> + <Tile id="-902" /> + + <!-- Montgomery (E1), Tallahassee (J4) --> + <Tile id="-1143" /> + + <!-- Jacksonville (J12) --> + <Tile id="-912" /> + + <!-- Atlanta (D4) --> + <Tile id="-4010"> + <Upgrade id="4451" /> + </Tile> + + <!-- Yellow Tiles --> + + <!-- Sharp-curve dit (10) --> + <Tile id="3" quantity="3" > + <Upgrade id="141,142,143" /> + </Tile> + + <!-- Straight dit (10) --> + <Tile id="4" quantity="3"> + <Upgrade id="141,142" /> + </Tile> + + <!-- Sharp-curve city (20) --> + <Tile id="5" quantity="2"> + <Upgrade id="14,15" hex="-D10,-G13" /> + <Upgrade id="4453" hex="D10" /> + <Upgrade id="4454" hex="G13" /> + </Tile> + + <!-- Gentle-curve city (20) --> + <Tile id="6" quantity="2"> + <Upgrade id="14,15" hex="-D10,-G13" /> + <Upgrade id="4453" hex="D10" /> + <Upgrade id="4454" hex="G13" /> + </Tile> + + <!-- Sharp curve --> + <Tile id="7" quantity="5"> + <Upgrade id="26,27,28,29" /> + </Tile> + + <!-- Gentle curve --> + <Tile id="8" quantity="11"> + <Upgrade id="16,17,19,23,24,25,28,29" /> + </Tile> + + <!-- Straight track --> + <Tile id="9" quantity="10"> + <Upgrade id="19,20,23,24,26,27" /> + </Tile> + + <!-- Straight city (20) --> + <Tile id="57" quantity="4"> + <Upgrade id="14,15" hex="-D10,-G13" /> + <Upgrade id="4453" hex="D10" /> + <Upgrade id="4454" hex="G13" /> + </Tile> + + <!-- Gentle-curve dit (10) --> + <Tile id="58" quantity="3"> + <Upgrade id="141,142,143" /> + </Tile> + + <!-- Three dead-end cities (30), exits NW,NE,S, "Atlanta" --> + <Tile id="4451" quantity="1"> + <Upgrade id="4452" /> + </Tile> + + <!-- Green Tiles --> + + <!-- X-shape city (30) --> + <Tile id="14" quantity="4"> + <Upgrade id="63" hex="-F6,-I11" /> + <Upgrade id="4457" hex="I11" /> + <Upgrade id="4458" hex="F6" /> + </Tile> + + <!-- K-shape city (30) --> + <Tile id="15" quantity="4"> + <Upgrade id="63" hex="-F6,-I11" /> + <Upgrade id="4457" hex="I11" /> + <Upgrade id="4458" hex="F6" /> + </Tile> + + <!-- Two tracks crossing, K shape --> + <Tile id="16" quantity="1"> + <Upgrade id="43,70" /> + </Tile> + + <!-- Two tracks non-crossing, )( shape --> + <Tile id="17" quantity="1"> + <Upgrade id="47" /> + </Tile> + + <!-- Two tracks crossing, crossbow shape --> + <Tile id="19" quantity="1"> + <Upgrade id="45,46" /> + </Tile> + + <!-- Two tracks crossing, X shape --> + <Tile id="20" quantity="1"> + <Upgrade id="44,47" /> + </Tile> + + <!-- Switch, straight and gentle-curve right --> + <Tile id="23" quantity="4"> + <Upgrade id="41,43,45,47" /> + </Tile> + + <!-- Switch, straight and gentle-curve left --> + <Tile id="24" quantity="4"> + <Upgrade id="42,43,46,47" /> + </Tile> + + <!-- Switch, two gentle curves --> + <Tile id="25" quantity="1"> + <Upgrade id="40,45,46" /> + </Tile> + + <!-- Switch, straight and sharp-curve right --> + <Tile id="26" quantity="1"> + <Upgrade id="42,44,45" /> + </Tile> + + <!-- Switch, straight and sharp-curve left --> + <Tile id="27" quantity="1"> + <Upgrade id="41,44,46" /> + </Tile> + + <!-- Switch, sharp and gentle curves right --> + <Tile id="28" quantity="2"> + <Upgrade id="39,43,70" /> + </Tile> + + <!-- Switch, sharp and gentle curves left --> + <Tile id="29" quantity="2"> + <Upgrade id="39,43,70" /> + </Tile> + + <!-- Dit (10), exits N,NE,S --> + <Tile id="141" quantity="2" /> + + <!-- Dit (10), exits N,NW,S --> + <Tile id="142" quantity="2" /> + + <!-- Dit (10), exits N,NW,NE --> + <Tile id="143" quantity="2" /> + + <!-- Three straight cities (20), crossing, "Atlanta" --> + <Tile id="4452" quantity="1"> + <Upgrade id="4455" /> + </Tile> + + <!-- K-shape city (30), "Augusta" --> + <Tile id="4453" quantity="1"> + <Upgrade id="4456" /> + </Tile> + + <!-- City (30), exits N,NW,SW, "Savannah" --> + <Tile id="4454" quantity="1"> + <Upgrade id="4459" /> + </Tile> + + <!-- Brown Tiles --> + + <!-- "Delta" interchange, exits N,NE,SE --> + <Tile id="39" quantity="2" /> + + <!-- "Delta" interchange, exits NW,NE,S --> + <Tile id="40" quantity="1" /> + + <!-- "Delta" interchange, exits N,NE,S --> + <Tile id="41" quantity="3" /> + + <!-- "Delta" interchange, exits N,NW,S --> + <Tile id="42" quantity="3" /> + + <!-- Interchange, tracks N-S, NE-SE, N-SE, S-NE --> + <Tile id="43" quantity="2" /> + + <!-- Interchange, tracks N-S, NW-SE, N-NW, S-SE --> + <Tile id="44" quantity="1" /> + + <!-- Interchange, tracks N-S, NW-NE, N-NW, S-NE --> + <Tile id="45" quantity="2" /> + + <!-- Interchange, tracks N-S, NW-NE, N-NE, S-NW --> + <Tile id="46" quantity="2" /> + + <!-- Interchange, tracks N-S, NW-SE, N-SE, S-NW --> + <Tile id="47" quantity="2" /> + + <!-- 6-way city (40) --> + <Tile id="63" quantity="4" /> + + <!-- Interchange, tracks N-SE, S-NE, N-NE, S-SE --> + <Tile id="70" quantity="1" /> + + <!-- Three straight cities (70), crossing, "Atlanta" --> + <Tile id="4455" quantity="1" /> + + <!-- K-shape city (50), "Augusta" --> + <Tile id="4456" quantity="1" /> + + <!-- 5-way city (40), "Brunswick" --> + <Tile id="4457" quantity="1" /> + + <!-- 5-way city (50), "Macon" --> + <Tile id="4458" quantity="1" /> + + <!-- City (60), exits N,NW,SW, "Savannah" --> + <Tile id="4459" quantity="1" /> + +</TileManager> Property changes on: trunk/18xx/data/18GA/TileSet.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18GA/Tiles.xml =================================================================== --- trunk/18xx/data/18GA/Tiles.xml (rev 0) +++ trunk/18xx/data/18GA/Tiles.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,284 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Tiles> + <Tile colour="white" id="0" name="empty" /> + <Tile colour="white" id="-1" name="1 village"> + <Station id="city1" position="002" type="Town" /> + </Tile> + <Tile colour="white" id="-10" name="1 city"> + <Station id="city1" position="302" slots="1" type="City" /> + </Tile> + <Tile colour="fixed" id="-111" name="Meridian"> + <Station id="city1" position="0" slots="2" type="City" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="fixed" id="-112" name="Tupelo"> + <Station id="city1" position="0" slots="1" type="City" value="30" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="fixed" id="-113" name="Oxmoor"> + <Station id="city1" position="0" slots="1" type="City" value="30" /> + <Track from="city1" gauge="normal" to="side5" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="fixed" id="-3" name="MF 3"> + <Station id="city1" position="252" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="red" id="-901" name="OM 1 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1" /> + <Track from="city1" gauge="normal" to="side2" /> + </Tile> + <Tile colour="red" id="-902" name="OM 2 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side1" /> + </Tile> + <Tile colour="red" id="-912" name="OMCity-2"> + <Station id="city1" position="0" slots="1" type="OffMapCity" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + </Tile> + <Tile colour="red" id="-913" name="OMCity-3"> + <Station id="city1" position="0" slots="1" type="OffMapCity" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="yellow" id="3" name="3"> + <Station id="city1" position="352" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + </Tile> + <Tile colour="yellow" id="4" name="4"> + <Station id="city1" position="0" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side0" /> + </Tile> + <Tile colour="yellow" id="5" name="5"> + <Station id="city1" position="0" slots="1" type="City" value="20" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + </Tile> + <Tile colour="yellow" id="6" name="6"> + <Station id="city1" position="0" slots="1" type="City" value="20" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side2" /> + </Tile> + <Tile colour="yellow" id="7" name="7"> + <Track from="side3" gauge="normal" to="side4" /> + </Tile> + <Tile colour="yellow" id="8" name="8"> + <Track from="side3" gauge="normal" to="side5" /> + </Tile> + <Tile colour="yellow" id="9" name="9"> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="yellow" id="57" name="57"> + <Station id="city1" position="0" slots="1" type="City" value="20" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side0" /> + </Tile> + <Tile colour="yellow" id="58" name="58"> + <Station id="city1" position="401" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side5" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="yellow" id="1441" name="441"> + <Station id="city1" position="0" slots="1" type="City" value="10" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="yellow" id="445" name="445"> + <Station id="city1" position="0" type="Town" value="20" /> + <Track from="city1" gauge="normal" to="side5" /> + <Track from="city1" gauge="normal" to="side3" /> + </Tile> + <Tile colour="green" id="14" name="14"> + <Station id="city1" position="0" slots="2" type="City" value="30" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="15" name="15"> + <Station id="city1" position="0" slots="2" type="City" value="30" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + <Track from="city1" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="16" name="16"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side4" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="17" name="17"> + <Track from="side0" gauge="normal" to="side2" /> + <Track from="side3" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="19" name="19"> + <Track from="side5" gauge="normal" to="side1" /> + <Track from="side0" gauge="normal" to="side3" /> + </Tile> + <Tile colour="green" id="20" name="20"> + <Track from="side1" gauge="normal" to="side4" /> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="23" name="23"> + <Track from="side4" gauge="normal" to="side0" /> + <Track from="side0" gauge="normal" to="side3" /> + </Tile> + <Tile colour="green" id="24" name="24"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="25" name="25"> + <Track from="side1" gauge="normal" to="side3" /> + <Track from="side3" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="26" name="26"> + <Track from="side5" gauge="normal" to="side0" /> + <Track from="side0" gauge="normal" to="side3" /> + </Tile> + <Tile colour="green" id="27" name="27"> + <Track from="side3" gauge="normal" to="side4" /> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="green" id="28" name="28"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side4" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="29" name="29"> + <Track from="side3" gauge="normal" to="side4" /> + <Track from="side3" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="141" name="141"> + <Station id="city1" position="0" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="142" name="142"> + <Station id="city1" position="0" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="143" name="143"> + <Station id="city1" position="0" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + </Tile> + <Tile colour="green" id="144" name="144"> + <Station id="city1" position="0" type="Town" value="10" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side4" /> + </Tile> + <Tile colour="green" id="1442" name="442"> + <Station id="city1" position="0" slots="2" type="City" value="30" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="1443" name="443"> + <Station id="city1" position="0" slots="2" type="City" value="40" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="green" id="-3008" name="-3008"> + </Tile> + <Tile colour="green" id="-1143" name="-1143"> + </Tile> + <Tile colour="brown" id="39" name="39"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="40" name="40"> + <Track from="side1" gauge="normal" to="side3" /> + <Track from="side1" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side5" /> + </Tile> + <Tile colour="brown" id="41" name="41"> + <Track from="side4" gauge="normal" to="side0" /> + <Track from="side4" gauge="normal" to="side3" /> + <Track from="side0" gauge="normal" to="side3" /> + </Tile> + <Tile colour="brown" id="42" name="42"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side0" /> + <Track from="side5" gauge="normal" to="side0" /> + </Tile> + <Tile colour="brown" id="43" name="43"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side0" /> + <Track from="side4" gauge="normal" to="side5" /> + <Track from="side4" gauge="normal" to="side0" /> + </Tile> + <Tile colour="brown" id="44" name="44"> + <Track from="side3" gauge="normal" to="side0" /> + <Track from="side1" gauge="normal" to="side0" /> + <Track from="side3" gauge="normal" to="side4" /> + <Track from="side1" gauge="normal" to="side4" /> + </Tile> + <Tile colour="brown" id="45" name="45"> + <Track from="side1" gauge="normal" to="side5" /> + <Track from="side1" gauge="normal" to="side3" /> + <Track from="side5" gauge="normal" to="side0" /> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="brown" id="46" name="46"> + <Track from="side1" gauge="normal" to="side5" /> + <Track from="side1" gauge="normal" to="side0" /> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side0" /> + </Tile> + <Tile colour="brown" id="47" name="47"> + <Track from="side3" gauge="normal" to="side0" /> + <Track from="side3" gauge="normal" to="side1" /> + <Track from="side4" gauge="normal" to="side0" /> + <Track from="side4" gauge="normal" to="side1" /> + </Tile> + <Tile colour="brown" id="63" name="63"> + <Station id="city1" position="0" slots="2" type="City" value="40" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="brown" id="70" name="70"> + <Track from="side3" gauge="normal" to="side5" /> + <Track from="side3" gauge="normal" to="side4" /> + <Track from="side5" gauge="normal" to="side0" /> + <Track from="side4" gauge="normal" to="side0" /> + </Tile> + <Tile colour="brown" id="1444" name="444"> + <Station id="city1" position="0" slots="2" type="City" value="50" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> + <Tile colour="gray" id="446" name="446"> + <Station id="city1" position="0" slots="3" type="City" value="70" /> + <Track from="city1" gauge="normal" to="side0" /> + <Track from="city1" gauge="normal" to="side1" /> + <Track from="city1" gauge="normal" to="side2" /> + <Track from="city1" gauge="normal" to="side3" /> + <Track from="city1" gauge="normal" to="side4" /> + <Track from="city1" gauge="normal" to="side5" /> + </Tile> +</Tiles> Property changes on: trunk/18xx/data/18GA/Tiles.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18JR/CompanyManager.xml =================================================================== --- trunk/18xx/data/18JR/CompanyManager.xml (rev 0) +++ trunk/18xx/data/18JR/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,101 @@ +<?xml version="1.0"?> +<CompanyManager> + <CompanyType name="Private" class="rails.game.PrivateCompany"> + <ClosingConditions> + <Phase>5</Phase> + </ClosingConditions> + </CompanyType> + <CompanyType name="Public" class="rails.game.PublicCompany"> + <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> + <PoolPaysOut/> + <Float percentage="60"/> + <ShareUnit percentage="10"/> + <BaseTokens> + <!-- HomeBase lay options: "whenStarted", "whenFloated", "firstOR" (default) --> + <HomeBase lay="firstOR"/> + <!-- LayCost methods: only "sequence" (1830 style) implemented so far (default) --> + <LayCost method="sequence" cost="0,40,100"/> + </BaseTokens> + <Certificate type="President" shares="2"/> + <Certificate shares="1" number="8"/> + <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> + </CompanyType> + <Company name="SVNRR" type="Private" basePrice="20" revenue="5" + longname="Schuylkill Valley Navigation & Railroad Company"> + </Company> + <Company name="C&StL" type="Private" basePrice="40" revenue="10" + longname="Champlain & St.Lawrence"> + </Company> + <Company name="D&H" type="Private" basePrice="70" revenue="15" + longname="Delaware & Hudson"> + </Company> + <Company name="M&H" type="Private" basePrice="110" revenue="20" + longname="Mohawk & Hudson"> + <SpecialProperties> + <SpecialProperty condition="ifOwnedByPlayer" when="anyTurn" class="rails.game.special.ExchangeForShare"> + <ExchangeForShare company="NYC" share="10"/> + </SpecialProperty> + </SpecialProperties> + </Company> + <Company name="C&A" type="Private" basePrice="160" revenue="25" + longname="Camden & Amboy"> + <Info key="ComesWithCertificate" parm="PRR,10"/> + </Company> + <Company name="B&O" type="Private" basePrice="220" revenue="30" + longname="Baltimore & Ohio"> + <Info key="ComesWithPresidency" parm="B&O,20"/> + </Company> + + <!-- Note two supported colour specification formats: + RGB decimal with commas and RGB hexadecimal without commas --> + <Company name="B&O" type="Public" tokens="2" fgColour="FFFFFF" bgColour="0,0,255" + longname="Baltimore and Ohio"> + <Home hex="H6"/> + </Company> + <Company name="C&A" type="Public" tokens="2" fgColour="000000" bgColour="FF8000" + longname="Camden and Amboy"> + <Home hex="E11"/> + </Company> + <Company name="C&O" type="Public" tokens="2" fgColour="000000" bgColour="A0E0FF" + longname="Chesapeake and Ohio Railway"> + <Home hex="M7"/> + </Company> + <Company name="N&W" type="Public" tokens="2" fgColour="FFFFFF" bgColour="B03B00" + longname="Norfolk and Western"> + <Home hex="M3"/> + </Company> + <Company name="PLE" type="Public" tokens="2" fgColour="FFFFFF" bgColour="000000" + longname="Pittsburgh and Lake Erie Railroad"> + <Home hex="C1"/> + </Company> + <Company name="PRR" type="Public" tokens="2" fgColour="FFFFFF" bgColour="008000" + longname="Pennsylvania Railroad"> + <Home hex="D10"/> + </Company> + <Company name="SQ" type="Public" tokens="2" fgColour="000000" bgColour="FFFF00" + longname="New York, Susquehanna and Western Railway"> + <Home hex="B6"/> + </Company> <Company name="SRC" type="Public" tokens="2" fgColour="FFFF00" bgColour="FF0000" + longname="Strasburg Rail Road"> + <FirstTrainCloses type="Private" name="B&O"/> + <Home hex="D8"/> + </Company> + <IfOption name="Variant" value="Pere Marquette"> + <Company name="PM" type="Public" tokens="2" fgColour="FFFF00" bgColour="000080" + longname="Pere Marquette"> + <Home hex="C7"/> + </Company> + </IfOption> + <StartPacket roundClass="rails.game.StartRound_1830"> + <Bidding initial="5" minimum="5" increment="1"/> + <Item name="SVNRR" type="Private" basePrice="20"/> + <Item name="C&StL" type="Private" basePrice="40"/> + <Item name="D&H" type="Private" basePrice="70"/> + <Item name="M&H" type="Private" basePrice="110"/> + <Item name="C&A" type="Private" basePrice="160"/> + <Item name="B&O" type="Private" basePrice="220"> + <SubItem name="B&O" type="Public" president="yes"/> + </Item> + </StartPacket> +</CompanyManager> Property changes on: trunk/18xx/data/18JR/CompanyManager.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18JR/Game.xml =================================================================== --- trunk/18xx/data/18JR/Game.xml (rev 0) +++ trunk/18xx/data/18JR/Game.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,155 @@ +<?xml version="1.0"?> +<ComponentManager> + <Component name="GameManager" class="rails.game.GameManager"> + <Game name="18JR"/> + <!-- GAME OPTIONS must have: + - a name, which must also exist as an entry in LocalText.properties, + - optionally 'type="toggle"', which has the effect that the + selection uses a checkbox instead of a dropdown list. + In this case, 'values' must be absent + (the allowed values are fixed to "yes,no"). + - optionally, 'values="a,b,c"' i,e, a list of allowed values. + - optionally, a default value (only affects a toggle; + in a dropdown the first item is always the default). + --> + <!-- The options in Game.xml are not currently used. + See GamesList.xml for the real ones. + --> + <GameOption name="Variant" values="Basegame,Cotton Port" 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"/> + <GameOption name="UnlimitedTiles" type="toggle" default="no"/> + <GameOption name="LeaveAuctionOnPass" type="toggle" default="no"/> + <GameOption name="TwoPlayersCertLimit70Percent" type="toggle" default="yes"/> + <GameOption name="SeparateSalesAtSamePrice" type="toggle" default="yes"/> + <GameParameters> + <PlayerShareLimit percentage="60"> + <!-- Option "NumberOfPlayers" is automatically set + by the game engine --> + <IfOption name="NumberOfPlayers" value="2"> + <IfOption name="TwoPlayersCertLimit70Percent" value="yes"> + <Attributes percentage="70"/> + </IfOption> + </IfOption> + </PlayerShareLimit> + <BankPoolLimit percentage="50"/> + <StockRound> + <NoSaleInFirstSR/> + </StockRound> + </GameParameters> + <EndOfGame> + <Bankruptcy/> + <BankBreaks limit="0" finish="setOfORs"/> + <!-- "Runs out"; when "broken", -1 is the limit --> + </EndOfGame> + </Component> + <Component name="PlayerManager" class="rails.game.PlayerManager"> + <IfOption name="Variant" value="Basegame"> + <Players number="2" cash="1200" certLimit="28"/> + <Players number="3" cash="800" certLimit="20"/> + <Players number="4" cash="600" certLimit="16"/> + <Players number="5" cash="480" certLimit="13"/> + <Players number="6" cash="400" certLimit="11"/> + </IfOption> + <IfOption name="Variant" value="Pere Marquette"> + <Players number="2" cash="1200" certLimit="32"/> + <Players number="3" cash="800" certLimit="22"/> + <Players number="4" cash="600" certLimit="17"/> + <Players number="5" cash="480" certLimit="14"/> + <Players number="6" cash="400" certLimit="12"/> + <Players number="7" cash="360" certLimit="11"/> + </IfOption> + </Component> + <Component name="Bank" class="rails.game.Bank"> + <Bank amount="12000"/> + <Money format="$@"/> + </Component> + <Component name="TileManager" class="rails.game.TileManager" + file="TileSet.xml"/> + <Component name="Map" class="rails.game.MapManager" file="Map.xml"/> + <Component name="CompanyManager" class="rails.game.CompanyManager" + file="CompanyManager.xml"/> + <Component name="StockMarket" class="rails.game.StockMarket" + file="StockMarket.xml"/> + <Component name="TrainManager" class="rails.game.TrainManager"> + <Defaults> + <Reach base="stops" countTowns="yes"/> + <!-- Alternative values: + base="hexes" for H-trains as in 1826, 1849 etc. + countTowns="no" for all trains in 1841, 18EU, etc., + where towns score but do not count against the train length. + Otherwise, towns are counted as minor or major stops, + depending on the presence or absence of a "minorStops" value. + --> + <Score towns="yes"/> + <!-- Alternative values: + towns="no" for trains that ignore towns (e.g. 1826 TGV). + cities="double" if city-revenue is doubled (e.g. 1826 TGV). + --> + </Defaults> + <Train name="2" majorStops="2" cost="80" amount="6"/> + <Train name="3" majorStops="3" cost="180" amount="5" startPhase="3"/> + <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4" + rustedTrain="2"/> + <Train name="5" majorStops="5" cost="450" amount="3" startPhase="5"/> + <!--Train name="6" majorStops="6" cost="630" amount="2" startPhase="6" + rustedTrain="3" releasedTrain="D"/--> + <Train name="6" majorStops="6" cost="630" startPhase="6" + rustedTrain="3" releasedTrain="D"> + <IfOption name="WithOptional6Train" value="yes"> + <Attributes amount="3"/> + </IfOption> + <IfOption name="WithOptional6Train" value="no"> + <Attributes amount="2"/> + </IfOption> + <IfOption name="Variant" value="Pere Marquette"> + <Attributes amount="3"/> + </IfOption> + </Train> + <Train name="D" majorStops="99" cost="1100" startPhase="D" + rustedTrain="4"> + <IfOption name="UnlimitedTopTrains" value="yes"> + <Attributes amount="-1"/> + </IfOption> + <IfOption name="UnlimitedTopTrains" value="no"> + <Attributes amount="6"/> + </IfOption> + <Exchange cost="800"/> + </Train> + </Component> + <Component name="PhaseManager" class="rails.game.PhaseManager"> + <!-- Note: released and rusted trains are now specified per Train + but could as well be moved here. To be sorted out when we do 18US. --> + <!-- Each Phase's defaults are the previous one's values --> + <Phase name="2" > + <Tiles colour="yellow"/> + <Privates sellingAllowed="no"/> + <OperatingRounds number="1"/> + <Trains tradingAllowed="yes"/> + </Phase> + <Phase name="3"> + <Tiles colour="yellow,green"/> + <Privates sellingAllowed="yes"/> + <OperatingRounds number="2"/> + </Phase> + <Phase name="4"> + <Tiles colour="yellow,green"/> + </Phase> + <Phase name="5"> + <Tiles colour="yellow,green,brown"/> + <!--Privates close="yes"/--> + <OperatingRounds number="3"/> + <OffBoardRevenue step="2"/> + </Phase> + <Phase name="6"> + <Tiles colour="yellow,green,brown"/> + </Phase> + <Phase name="D"> + <Tiles colour="yellow,green,brown"/> + </Phase> + </Component> +</ComponentManager> \ No newline at end of file Property changes on: trunk/18xx/data/18JR/Game.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18JR/Map.xml =================================================================== --- trunk/18xx/data/18JR/Map.xml (rev 0) +++ trunk/18xx/data/18JR/Map.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,65 @@ +<Map mapClass="rails.ui.swing.hexmap.NSHexMap" tileOrientation="NS" letterOrientation="vertical" even="B"> + + <Hex name="A5" tile="-7" orientation="1"/> + <Hex name="A7" tile="-7" orientation="2"/> + <Hex name="B2" tile="-902" orientation="1" value="40,50"/> + <Hex name="B4" tile="0" cost="120"/> + <Hex name="B6" tile="-10"/> + <Hex name="B8" tile="0"/> + <Hex name="B10" tile="0"/> + <Hex name="B12" tile="-902" orientation="2" value="40,50"/> + <Hex name="C1" tile="-104"/> + <Hex name="C3" tile="-10"/> + <Hex name="C5" tile="-10" cost="120"/> + <Hex name="C7" tile="-1" cost="40"/> + <Hex name="C9" tile="-1"/> + <Hex name="C11" tile="-2"/> + <Hex name="D2" tile="-2"/> + <Hex name="D4" tile="0" cost="120"/> + <Hex name="D6" tile="0"/> + <Hex name="D8" tile="-10" cost="40"/> + <Hex name="D10" tile="-10" cost="40"/> + <Hex name="D12" tile="0"/> + <Hex name="E3" tile="0"/> + <Hex name="E5" tile="0" cost="120"/> + <Hex name="E7" tile="0"/> + <Hex name="E9" tile="0" cost="40"/> + <Hex name="E11" tile="-10"/> + <Hex name="F2" tile="0"/> + <Hex name="F4" tile="0" cost="120"/> + <Hex name="F6" tile="0"/> + <Hex name="F8" tile="-10" cost="40"/> + <Hex name="F10" tile="0" cost="40"/> + <Hex name="G1" tile="-902" value="40,50"/> + <Hex name="G3" tile="-10"/> + <Hex name="G5" tile="0" cost="120"/> + <Hex name="G7" tile="0"/> + <Hex name="G9" tile="-10"/> + <Hex name="H2" tile="0"/> + <Hex name="H4" tile="0" cost="120"/> + <Hex name="H6" tile="-10"/> + <Hex name="H10" tile="0"/> + <Hex name="I3" tile="0"/> + <Hex name="I5" tile="-1"/> + <Hex name="I7" tile="0" cost="40"/> + <Hex name="I9" tile="0"/> + <Hex name="I11" tile="-901" orientation="3" value="40,50"/> + <Hex name="J2" tile="0"/> + <Hex name="J4" tile="0" cost="120"/> + <Hex name="J6" tile="0" cost="40"/> + <Hex name="J10" tile="0"/> + <Hex name="K3" tile="0"/> + <Hex name="K5" tile="-1"/> + <Hex name="K7" tile="0" cost="40"/> + <Hex name="K11" tile="-901" orientation="3" value="40,50"/> + <Hex name="L2" tile="0"/> + <Hex name="L4" tile="-10"/> + <Hex name="L6" tile="0"/> + <Hex name="L8" tile="0" cost="40"/> + <Hex name="M1" tile="-901" orientation="5" value="40,50"/> + <Hex name="M3" tile="-10" cost="120"/> + <Hex name="M5" tile="0"/> + <Hex name="M7" tile="-10"/> + <Hex name="N2" tile="-902" orientation="5" value="40,50"/> + <Hex name="N8" tile="-901" orientation="3" value="40,50"/> +</Map> Property changes on: trunk/18xx/data/18JR/Map.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18JR/StockMarket.xml =================================================================== --- trunk/18xx/data/18JR/StockMarket.xml (rev 0) +++ trunk/18xx/data/18JR/StockMarket.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,111 @@ +<StockMarket type="rectangular"> + <!-- Note two supported colour specification formats: + RGB decimal with commas and RGB hexadecimal without commas --> + <StockSpaceType name="yellow" colour="255,255,0"> + <NoCertLimit/> + </StockSpaceType> + + <StockSpace name="A1" price="70" /> + <StockSpace name="A2" price="65" type="yellow"/> + <StockSpace name="A3" price="55" type="yellow"/> + <StockSpace name="A4" price="50" type="yellow"/> + <StockSpace name="A5" price="45" type="yellow"/> + <StockSpace name="A6" price="40" type="yellow"/> + <StockSpace name="A7" price="30" type="yellow"/> + <StockSpace name="A8" price="20" type="yellow"/> + <StockSpace name="B1" price="75" /> + <StockSpace name="B2" price="70" /> + <StockSpace name="B3" price="65" type="yellow"/> + <StockSpace name="B4" price="60" type="yellow"/> + <StockSpace name="B5" price="55" type="yellow"/> + <StockSpace name="B6" price="50" type="yellow"/> + <StockSpace name="B7" price="40" type="yellow"/> + <StockSpace name="B8" price="30" type="yellow"/> + <StockSpace name="C1" price="80" /> + <StockSpace name="C2" price="75" /> + <StockSpace name="C3" price="70" /> + <StockSpace name="C4" price="65" type="yellow"/> + <StockSpace name="C5" price="60" type="yellow"/> + <StockSpace name="C6" price="55" type="yellow"/> + <StockSpace name="C7" price="50" type="yellow"/> + <StockSpace name="C8" price="40" type="yellow"/> + <StockSpace name="D1" price="85" /> + <StockSpace name="D2" price="80" /> + <StockSpace name="D3" price="75" /> + <StockSpace name="D4" price="70" /> + <StockSpace name="D5" price="65" /> + <StockSpace name="D6" price="60" type="yellow"/> + <StockSpace name="D7" price="55" type="yellow"/> + <StockSpace name="D8" price="45" type="yellow"/> + <StockSpace name="E1" price="90" /> + <StockSpace name="E2" price="85" /> + <StockSpace name="E3" price="80" /> + <StockSpace name="E4" price="75" /> + <StockSpace name="E5" price="70" /> + <StockSpace name="E6" price="65" /> + <StockSpace name="E7" price="60" /> + <StockSpace name="E8" price="50" type="yellow"/> + <StockSpace name="F1" price="100" > + <StartSpace/> + </StockSpace> + <StockSpace name="F2" price="90" > + <StartSpace/> + </StockSpace> + <StockSpace name="F3" price="85" > + <StartSpace/> + </StockSpace> + <StockSpace name="F4" price="80" > + <StartSpace/> + </StockSpace> + <StockSpace name="F5" price="75" > + <StartSpace/> + </StockSpace> + <StockSpace name="F6" price="70" > + <StartSpace/> + </StockSpace> + <StockSpace name="F7" price="65" /> + <StockSpace name="F8" price="60" /> + <StockSpace name="G1" price="110" /> + <StockSpace name="G2" price="100" /> + <StockSpace name="G3" price="95" /> + <StockSpace name="G4" price="85" /> + <StockSpace name="G5" price="80" /> + <StockSpace name="G6" price="75" /> + <StockSpace name="G7" price="70" /> + <StockSpace name="G8" price="65" /> + <StockSpace name="H1" price="125" /> + <StockSpace name="H2" price="110" /> + <StockSpace name="H3" price="105" /> + <StockSpace name="H4" price="95" /> + <StockSpace name="H5" price="85" /> + <StockSpace name="H6" price="80" /> + <StockSpace name="H7" price="75" /> + <StockSpace name="I1" price="140" /> + <StockSpace name="I2" price="125" /> + <StockSpace name="I3" price="115" /> + <StockSpace name="I4" price="105" /> + <StockSpace name="I5" price="95" /> + <StockSpace name="I6" price="85" /> + <StockSpace name="J1" price="160" /> + <StockSpace name="J2" price="140" /> + <StockSpace name="J3" price="130" /> + <StockSpace name="J4" price="115" /> + <StockSpace name="J5" price="105" /> + <StockSpace name="K1" price="180" /> + <StockSpace name="K2" price="160" /> + <StockSpace name="K3" price="145" /> + <StockSpace name="K4" price="130" /> + <StockSpace name="L1" price="205" /> + <StockSpace name="L2" price="180" /> + <StockSpace name="L3" price="160" /> + <StockSpace name="L4" price="145" /> + <StockSpace name="M1" price="235" /> + <StockSpace name="M2" price="205" /> + <StockSpace name="M3" price="180" /> + <StockSpace name="N1" price="265" /> + <StockSpace name="N2" price="235" /> + <StockSpace name="N3" price="205" /> + <StockSpace name="O1" price="300" /> + <StockSpace name="O2" price="265" /> + <StockSpace name="O3" price="235" /> +</StockMarket> Property changes on: trunk/18xx/data/18JR/StockMarket.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18JR/TileSet.xml =================================================================== --- trunk/18xx/data/18JR/TileSet.xml (rev 0) +++ trunk/18xx/data/18JR/TileSet.xml 2011-03-29 13:13:57 UTC (rev 1503) @@ -0,0 +1,128 @@ +<TileManager tiles="Tiles.xml"> + <!-- Preprinted tiles --> + <Tile id="0"><!-- Empty space --> + <Upgrade id="7,8,9"/> + </Tile> + <Tile id="-1"><!-- 1 town --> + <Upgrade id="3,4,58"/> + </Tile> + <Tile id="-2"><!-- 2 towns --> + <Upgrade id="1,2,55,56,69"/> + </Tile> + <Tile id="-3"/> + <Tile id="-5"/> + <Tile id="-7"/> + <Tile id="-10"><!-- 1 city --> + <Upgrade id="57,1441"/> + </Tile> + <Tile id="-11"><!-- B yellow --> + <Upgrade id="53"/> + </Tile> + <Tile id="-20"><!-- 2 OO cities --> + <Upgrade id="59" relayBaseTokens="yes"/> + </Tile> + <Tile id="-21"><!-- New York --> + <Upgrade id="54"/> + </Tile> + <Tile id="-58"/> + <Tile id="-101"/><!-- Altoona --> + <Tile id="-102"/><!-- Rochester --> + <Tile id="-103"/><!-- Montreal --> + <Tile id="-104"/><!-- Norwich --> + <Tile id="-105"/><!-- Cleveland --> + <Tile id="-901"/> + <Tile id="-902"/> + <Tile id="-903"/> + + <!-- Yellow tiles --> + <Tile id="1" quantity="1" /> + <Tile id="2" quantity="1" /> + <Tile id="3" quantity="2" /> + <Tile id="4" quantity="2" /> + <Tile id="7" quantity="4"> + <Upgrade id="18,26,27,28,29" /> + </Tile> + <Tile id="8" quantity="8"> + <Upgrade id="16,19,23,24,25,28,29" /> + </Tile> + <Tile id="9" quantity="7"> + <Upgrade id="18,19,20,23,24,26,27" /> + </Tile> + <Tile id="55" quantity="1" /> + <Tile id="56" quantity="1" /> + <Tile id="57" quantity="4"> + <Upgrade id="14,15" /> + </Tile> + <Tile id="58" quantity="2" /> + <Tile id="69" quantity="1" /> + + <!-- Green tiles --> + <Tile id="14" quantity="3"> + <Upgrade id="63" /> + </Tile> + <Tile id="15" quantity="2"> + <Upgrade id="63" /> + </Tile> + <Tile id="16" quantity="1"> + <Upgrade id="43,70" /> + </Tile> + <Tile id="18" quantity="1"> + <Upgrade id="43" /> + </Tile> + <Tile id="19" quantity="1"> + <Upgrade id="45,46" /> + </Tile> + <Tile id="20" quantity="1"> + <Upgrade id="44,47" /> + </Tile> + <Tile id="23" quantity="3"> + <Upgrade id="41,43,45,47" /> + </Tile> + <Tile id="24" quantity="3"> + <Upgrade id="42,43,46,47" /> + </Tile> + <Tile id="25" quantity="1"> + <Upgrade id="40,45,46" /> + </Tile> + <Tile id="26" quantity="1"> + <Upgrade id="42,44,45" /> + </Tile> + <Tile id="27" quantity="1"> + <Upgrade id="41,44,46" /> + </Tile> + <Tile id="28" quantity="1"> + <Upgrade id="39,43,46,70" /> + </Tile> + <Tile id="29" quantity="1"> + <Upgrade id="39,43,45,70" /> + </Tile> + <Tile id="53" quantity="2"> + <Upgrade id="61" /> + </Tile> + <Tile id="54" quantity="1"> + <Upgrade id="62" /> + </Tile> + <Tile id="59" quantity="2"> + <Upgrade id="64,65,66,67,68" /> + </Tile> + <!-- Brown tiles --> + <Tile id="39" quantity="1" /> + <Tile id="40" quantity="1" /> + <Tile id="41" quantity="2" /> + <Tile id="42" quantity="2" /> + <Tile id="43" quantity="2" /> + <Tile id="44" quantity="1" /> + <Tile id="45" quantity="2" /> + <Tile id="46" quantity="2" /> + <Tile id="47" quantity="1" /> + <Tile id="61" quantity="2" /> + <Tile id="62" quantity="1" /> + <Tile id="63" quantity="3" /> + <Tile id="64" quantity="1" /> + <Tile id="65" quantity="1" /> + <Tile id="66" quantity="1" /> + <Tile id="67" quantity="1" /> + <Tile id="68" quantit... [truncated message content] |
From: <ev...@us...> - 2011-04-03 19:34:12
|
Revision: 1510 http://rails.svn.sourceforge.net/rails/?rev=1510&view=rev Author: evos Date: 2011-04-03 19:34:06 +0000 (Sun, 03 Apr 2011) Log Message: ----------- 18TN Initial commit. Modified Paths: -------------- trunk/18xx/data/18TN/Map.xml trunk/18xx/data/18TN/TileSet.xml trunk/18xx/tiles/CombineTiles.pl trunk/18xx/tiles/TileDictionary.18t trunk/18xx/tiles/TileDictionary.xml trunk/18xx/tiles/Tiles.xml Added Paths: ----------- trunk/18xx/tiles/svg/tile-10001.svg Modified: trunk/18xx/data/18TN/Map.xml =================================================================== --- trunk/18xx/data/18TN/Map.xml 2011-04-03 11:57:06 UTC (rev 1509) +++ trunk/18xx/data/18TN/Map.xml 2011-04-03 19:34:06 UTC (rev 1510) @@ -2,7 +2,7 @@ letterOrientation="vertical" even="A"> <Hex name="A16" tile="-902" city="Cincinnati" orientation="1" value="50,80"/> -<Hex name="B13" tile="-10" city="Louisville"/> +<Hex name="B13" tile="-10001" city="Louisville"/> <Hex name="B15" tile="0" cost="60" /> <Hex name="B17" tile="-10" city="Lexington"/> <Hex name="C4" tile="-902" city="Saint Louis" value="40,60"/> @@ -68,7 +68,7 @@ <Hex name="I14" tile="0" cost="60" /> <Hex name="I16" tile="0" cost="60" /> <Hex name="J5" tile="-902" city="Gulf Coast" orientation="4" value="30,50"/> -<Hex name="J11" tile="-143" city="Birmingham" orientation="5" value="30,40"/> +<Hex name="J11" tile="-1143" city="Birmingham" value="30,40"/> <Hex name="J13" tile="0" cost="60" /> <Hex name="J15" tile="0" /> <Hex name="J17" tile="-902" city="Atlanta" orientation="3" value="40,60"/> Modified: trunk/18xx/data/18TN/TileSet.xml =================================================================== --- trunk/18xx/data/18TN/TileSet.xml 2011-04-03 11:57:06 UTC (rev 1509) +++ trunk/18xx/data/18TN/TileSet.xml 2011-04-03 19:34:06 UTC (rev 1510) @@ -9,8 +9,9 @@ <Tile id="-10"> <Upgrade id="5,6,57" /> </Tile> + <Tile id="-10001"/> - <Tile id="-143" /> + <Tile id="-1143" /> <Tile id="-902" /> <Tile id="-903" /> Modified: trunk/18xx/tiles/CombineTiles.pl =================================================================== --- trunk/18xx/tiles/CombineTiles.pl 2011-04-03 11:57:06 UTC (rev 1509) +++ trunk/18xx/tiles/CombineTiles.pl 2011-04-03 19:34:06 UTC (rev 1510) @@ -47,4 +47,4 @@ # - From tiles/TDwoID: all tiles with an ID <= 0 (preprinted tiles). # These images do not have the ID on the tile (create these separately from TD). # - From tiles/handmade: all tiles in that dir will overwrite any of the above. -# These are the tiles modified by hand with Inkscape. +# These are the tiles modified by hand or with Inkscape. Modified: trunk/18xx/tiles/TileDictionary.18t =================================================================== (Binary files differ) Modified: trunk/18xx/tiles/TileDictionary.xml =================================================================== --- trunk/18xx/tiles/TileDictionary.xml 2011-04-03 11:57:06 UTC (rev 1509) +++ trunk/18xx/tiles/TileDictionary.xml 2011-04-03 19:34:06 UTC (rev 1510) @@ -21733,4 +21733,37 @@ </junctions> <connections/> </tile> -</tiles> \ No newline at end of file + <tile> + <ID>-10001</ID> + <shape>tsHexagon</shape> + <level>tlMapFixed</level> + <name>TNLouisville</name> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tp1SideF</position> + <revenue> + <value>30</value> + <position>tp3CornerA</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideB</position1> + <position2>tp4SideD</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp1SideF</position1> + <position2>tp4SideB</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp1SideF</position1> + <position2>tp4SideD</position2> + </connection> + </connections> + </tile> +</tiles> Modified: trunk/18xx/tiles/Tiles.xml =================================================================== --- trunk/18xx/tiles/Tiles.xml 2011-04-03 11:57:06 UTC (rev 1509) +++ trunk/18xx/tiles/Tiles.xml 2011-04-03 19:34:06 UTC (rev 1510) @@ -3813,4 +3813,10 @@ <Station id="city2" position="252" slots="1" type="City"/> <Station id="city3" position="452" slots="1" type="City"/> </Tile> + <Tile colour="fixed" id="-10001" name="TNLouisville"> + <Station id="city1" position="501" slots="1" type="City" value="30"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> </Tiles> \ No newline at end of file Added: trunk/18xx/tiles/svg/tile-10001.svg =================================================================== --- trunk/18xx/tiles/svg/tile-10001.svg (rev 0) +++ trunk/18xx/tiles/svg/tile-10001.svg 2011-04-03 19:34:06 UTC (rev 1510) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#C0C0C0" stroke="#C0C0C0" stroke-width="1" stroke-linejoin="round"/><circle cx="140" cy="137" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,1 196,124 A 45,45 0 0,0 157,147" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,340 A 294,294 0 0,0 157,193 A 45,45 0 0,1 157,147" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,1 196,124 A 45,45 0 0,0 157,147" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,340 A 294,294 0 0,0 157,193 A 45,45 0 0,1 157,147" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="140" cy="137" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="123" cy="43" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="123" y="43" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">30</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-03 19:35:43
|
Revision: 1511 http://rails.svn.sourceforge.net/rails/?rev=1511&view=rev Author: evos Date: 2011-04-03 19:35:37 +0000 (Sun, 03 Apr 2011) Log Message: ----------- Property Changed: ---------------- trunk/18xx/ trunk/18xx/tiles/ Property changes on: trunk/18xx ___________________________________________________________________ Modified: svn:ignore - *.bat *.txt .cvsignore .classpath .externalToolBuilders 18xx.zip deploy.xml .project zip.xml NewUIstuff.zip COMP.WPS rails.jar rails.jardesc Rails-1.0.1.jar my_my.properties log rails-1.0.1.jar rails*.zip rails-*.jar tools rails-?.*.* jar/* classes/* 18xx_autosave.rails 18xx_autosave.rails.tmp user.profiles o + *.bat *.txt .cvsignore .classpath .externalToolBuilders 18xx.zip deploy.xml .project zip.xml NewUIstuff.zip COMP.WPS rails.jar rails.jardesc Rails-1.0.1.jar my_my.properties log rails-1.0.1.jar rails*.zip rails-*.jar tools rails-?.*.* jar/* classes/* 18xx_autosave.rails 18xx_autosave.rails.tmp user.profiles o C.properties A.properties B.properties Property changes on: trunk/18xx/tiles ___________________________________________________________________ Modified: svn:ignore - Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt + Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt TileDictionary - kopie.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-10 18:59:20
|
Revision: 1515 http://rails.svn.sourceforge.net/rails/?rev=1515&view=rev Author: evos Date: 2011-04-10 18:59:13 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Code cleanups only Modified Paths: -------------- trunk/18xx/rails/algorithms/NetworkGraphBuilder.java trunk/18xx/rails/algorithms/NetworkVertex.java trunk/18xx/rails/algorithms/RevenueBonusTemplate.java trunk/18xx/rails/algorithms/RevenueCalculatorMulti.java trunk/18xx/rails/algorithms/RevenueTrainRun.java trunk/18xx/rails/common/GuiHints.java trunk/18xx/rails/game/MapManager.java trunk/18xx/rails/game/StartRound_1830.java trunk/18xx/rails/game/Tile.java trunk/18xx/rails/game/action/SetDividend.java trunk/18xx/rails/game/specific/_1825/ScoreTileOnlyOnceModifier.java trunk/18xx/rails/game/specific/_1825/StockRound_1825.java trunk/18xx/rails/game/specific/_1835/PrussianFormationRound.java trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java trunk/18xx/rails/game/specific/_18AL/NamedTrainRevenueModifier.java trunk/18xx/rails/game/state/EnumState.java trunk/18xx/rails/ui/swing/GameSetupWindow.java trunk/18xx/rails/ui/swing/MessagePanel.java trunk/18xx/rails/ui/swing/ORPanel.java trunk/18xx/rails/ui/swing/UpgradesPanel.java trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java trunk/18xx/rails/ui/swing/hexmap/GUIHex.java trunk/18xx/rails/util/ConvertTilesXML.java trunk/18xx/test/TestGameBuilder.java trunk/18xx/tools/ConvertTilesXML.java Modified: trunk/18xx/rails/algorithms/NetworkGraphBuilder.java =================================================================== --- trunk/18xx/rails/algorithms/NetworkGraphBuilder.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/algorithms/NetworkGraphBuilder.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -5,7 +5,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -20,15 +19,12 @@ import org.jgrapht.Graph; import org.jgrapht.Graphs; import org.jgrapht.ext.JGraphModelAdapter; -import org.jgrapht.graph.Multigraph; import org.jgrapht.graph.SimpleGraph; -import org.jgrapht.graph.Subgraph; import com.jgraph.layout.JGraphFacade; import com.jgraph.layout.JGraphLayout; import com.jgraph.layout.organic.JGraphFastOrganicLayout; -import rails.algorithms.NetworkEdge.MergeResult; import rails.game.BaseToken; import rails.game.City; import rails.game.GameManagerI; @@ -326,7 +322,6 @@ layout.run(facade); facade.scale(new Rectangle(1600,1200)); - @SuppressWarnings("unchecked") Map nested = facade.createNestedMap(true,true); jgraph.getGraphLayoutCache().edit(nested); Modified: trunk/18xx/rails/algorithms/NetworkVertex.java =================================================================== --- trunk/18xx/rails/algorithms/NetworkVertex.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/algorithms/NetworkVertex.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -2,7 +2,6 @@ import java.awt.Rectangle; import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; Modified: trunk/18xx/rails/algorithms/RevenueBonusTemplate.java =================================================================== --- trunk/18xx/rails/algorithms/RevenueBonusTemplate.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/algorithms/RevenueBonusTemplate.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -13,7 +13,6 @@ import rails.game.PhaseManager; import rails.game.TrainManager; import rails.game.TrainTypeI; -import rails.util.LocalText; import rails.util.Tag; /** Modified: trunk/18xx/rails/algorithms/RevenueCalculatorMulti.java =================================================================== --- trunk/18xx/rails/algorithms/RevenueCalculatorMulti.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/algorithms/RevenueCalculatorMulti.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,6 +1,5 @@ package rails.algorithms; -import rails.algorithms.RevenueCalculator.Terminated; final class RevenueCalculatorMulti extends RevenueCalculator { Modified: trunk/18xx/rails/algorithms/RevenueTrainRun.java =================================================================== --- trunk/18xx/rails/algorithms/RevenueTrainRun.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/algorithms/RevenueTrainRun.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -3,15 +3,12 @@ import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; import java.util.ArrayList; -import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.log4j.Logger; -import org.jgrapht.GraphPath; -import org.jgrapht.Graphs; import rails.algorithms.NetworkVertex.StationType; import rails.algorithms.NetworkVertex.VertexType; Modified: trunk/18xx/rails/common/GuiHints.java =================================================================== --- trunk/18xx/rails/common/GuiHints.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/common/GuiHints.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; -import rails.game.GameDef; import rails.game.RoundI; import rails.game.move.StateChange; import rails.game.state.EnumState; Modified: trunk/18xx/rails/game/MapManager.java =================================================================== --- trunk/18xx/rails/game/MapManager.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/MapManager.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -115,7 +115,7 @@ public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { MapHex hex; - int i, j, k, dx, dy; + int i, j, k; MapHex nb; for (String hexName : mHexes.keySet()) { Modified: trunk/18xx/rails/game/StartRound_1830.java =================================================================== --- trunk/18xx/rails/game/StartRound_1830.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/StartRound_1830.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -360,6 +360,7 @@ } } else if (auctionItem != null) { + // TODO Now dead code - should it be reactivated? setNextBiddingPlayer(auctionItem); } else { setNextPlayer(); Modified: trunk/18xx/rails/game/Tile.java =================================================================== --- trunk/18xx/rails/game/Tile.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/Tile.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -32,7 +32,6 @@ private final List<Upgrade> upgrades = new ArrayList<Upgrade>(); // Contains // Upgrade instances //private String upgradesString = ""; - @SuppressWarnings("unchecked") private final List[] tracksPerSide = new ArrayList[6]; // N.B. Cannot parametrise collection array private Map<Integer, List<Track>> tracksPerStation = null; Modified: trunk/18xx/rails/game/action/SetDividend.java =================================================================== --- trunk/18xx/rails/game/action/SetDividend.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/action/SetDividend.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -195,7 +195,6 @@ } /** Deserialize */ - @SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { Modified: trunk/18xx/rails/game/specific/_1825/ScoreTileOnlyOnceModifier.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/ScoreTileOnlyOnceModifier.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/specific/_1825/ScoreTileOnlyOnceModifier.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,7 +1,6 @@ package rails.game.specific._1825; import java.util.ArrayList; -import java.util.Map; import java.util.HashMap; import java.util.List; Modified: trunk/18xx/rails/game/specific/_1825/StockRound_1825.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/StockRound_1825.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/specific/_1825/StockRound_1825.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -87,8 +87,7 @@ String compName; int price; int number; - int share, maxShareToSell; - boolean dumpAllowed; + int maxShareToSell; Portfolio playerPortfolio = currentPlayer.getPortfolio(); /* @@ -100,7 +99,7 @@ // Check if shares of this company can be sold at all if (!mayPlayerSellShareOfCompany(company)) continue; - share = maxShareToSell = playerPortfolio.getShare(company); + maxShareToSell = playerPortfolio.getShare(company); if (maxShareToSell == 0) continue; /* May not sell more than the Pool can accept */ Modified: trunk/18xx/rails/game/specific/_1835/PrussianFormationRound.java =================================================================== --- trunk/18xx/rails/game/specific/_1835/PrussianFormationRound.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/specific/_1835/PrussianFormationRound.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -279,6 +279,7 @@ break; } + // This is now dead code, but won't be when some sensible validations exist if (errMsg != null) { DisplayBuffer.add(LocalText.getText("CannotMerge", action.getFoldedCompanyNames(), Modified: trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java =================================================================== --- trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,9 +1,7 @@ package rails.game.specific._1856; import rails.game.*; -import rails.game.action.BuyCertificate; import rails.game.state.IntegerState; -import rails.util.LocalText; /** Needed to copy behaviour on share selling from StockRound_1856. */ public class ShareSellingRound_1856 extends ShareSellingRound { Modified: trunk/18xx/rails/game/specific/_18AL/NamedTrainRevenueModifier.java =================================================================== --- trunk/18xx/rails/game/specific/_18AL/NamedTrainRevenueModifier.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/specific/_18AL/NamedTrainRevenueModifier.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,9 +1,7 @@ package rails.game.specific._18AL; import java.util.ArrayList; -import java.util.Collection; import java.util.List; -import java.util.Set; import rails.algorithms.NetworkTrain; import rails.algorithms.NetworkVertex; Modified: trunk/18xx/rails/game/state/EnumState.java =================================================================== --- trunk/18xx/rails/game/state/EnumState.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/game/state/EnumState.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -7,6 +7,7 @@ super (name, object); } + @SuppressWarnings("unchecked") public E value() { return (E)object; } Modified: trunk/18xx/rails/ui/swing/GameSetupWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -4,7 +4,6 @@ import java.awt.*; import java.awt.event.*; import java.io.File; -import java.io.IOException; import java.util.*; import java.util.List; @@ -261,7 +260,6 @@ } } else if (arg0.getSource().equals(recentButton)) { File saveDirectory = new File(Config.get("save.directory")); - if (saveDirectory == null) return; recentFiles = new TreeSet<File>(new Comparator<File> (){ public int compare (File a, File b) { Modified: trunk/18xx/rails/ui/swing/MessagePanel.java =================================================================== --- trunk/18xx/rails/ui/swing/MessagePanel.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/MessagePanel.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -74,7 +74,7 @@ } // display String text = messageText.toString(); - int lines = text.split("<[Bb][Rr]>").length + 1; + //int lines = text.split("<[Bb][Rr]>").length + 1; // setLines(lines); message.setText("<html><center>" + text + "</center></html>"); Modified: trunk/18xx/rails/ui/swing/ORPanel.java =================================================================== --- trunk/18xx/rails/ui/swing/ORPanel.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/ORPanel.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -10,7 +10,6 @@ import org.apache.log4j.Logger; -import org.jgrapht.graph.Multigraph; import org.jgrapht.graph.SimpleGraph; import rails.algorithms.*; Modified: trunk/18xx/rails/ui/swing/UpgradesPanel.java =================================================================== --- trunk/18xx/rails/ui/swing/UpgradesPanel.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/UpgradesPanel.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -475,11 +475,6 @@ this.token = token; } - // NOTE: NOT USED - TokenI getToken() { - return token; - } - } /** JLabel extension to allow attaching the internal hex ID */ Modified: trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java =================================================================== --- trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,6 +1,5 @@ package rails.ui.swing.gamespecific._1856; -import javax.swing.JDialog; import javax.swing.WindowConstants; import rails.game.*; Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java =================================================================== --- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -71,14 +71,6 @@ protected String toolTip = ""; - /** - * Stores the neighbouring views. This parallels the neighors field in - * MapHex, just on the view side. - * - * @todo check if we can avoid this - */ - private GUIHex[] neighbors = new GUIHex[6]; - // GUI variables double[] xVertex = new double[6]; double[] yVertex = new double[6]; Modified: trunk/18xx/rails/util/ConvertTilesXML.java =================================================================== --- trunk/18xx/rails/util/ConvertTilesXML.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/rails/util/ConvertTilesXML.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -349,11 +349,6 @@ outputJunction.setAttribute("slots", station[1]); } - // String[] p = (String[]) ((String[]) stationMap.get(type)).clone(); - if (station == null) { - throw new ConfigurationException("Unknown junction type: " + type); - } - // Junction revenue Element revenue = (Element) inputJunction.getElementsByTagName("revenue").item(0); Modified: trunk/18xx/test/TestGameBuilder.java =================================================================== --- trunk/18xx/test/TestGameBuilder.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/test/TestGameBuilder.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -1,7 +1,6 @@ package test; import java.io.File; -import java.io.FilenameFilter; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; Modified: trunk/18xx/tools/ConvertTilesXML.java =================================================================== --- trunk/18xx/tools/ConvertTilesXML.java 2011-04-06 22:13:54 UTC (rev 1514) +++ trunk/18xx/tools/ConvertTilesXML.java 2011-04-10 18:59:13 UTC (rev 1515) @@ -330,11 +330,6 @@ outputJunction.setAttribute("slots", station[1]); } - // String[] p = (String[]) ((String[]) stationMap.get(type)).clone(); - if (station == null) { - throw new ConfigurationException("Unknown junction type: " + type); - } - // Junction revenue Element revenue = (Element) inputJunction.getElementsByTagName("revenue").item(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-13 20:24:39
|
Revision: 1516 http://rails.svn.sourceforge.net/rails/?rev=1516&view=rev Author: evos Date: 2011-04-13 20:24:27 +0000 (Wed, 13 Apr 2011) Log Message: ----------- 1880 initial commit (contribution from Martin Brumm) Modified Paths: -------------- trunk/18xx/data/GamesList.xml trunk/18xx/tiles/TileDictionary.18t trunk/18xx/tiles/TileDictionary.xml trunk/18xx/tiles/Tiles.xml trunk/18xx/tiles/svg/tile89.svg trunk/18xx/tools/ConvertTilesXML.java Added Paths: ----------- trunk/18xx/data/1880/ trunk/18xx/data/1880/CompanyManager.xml trunk/18xx/data/1880/Game.xml trunk/18xx/data/1880/Map.xml trunk/18xx/data/1880/StockMarket.xml trunk/18xx/data/1880/TileSet.xml trunk/18xx/data/1880/Tiles.xml trunk/18xx/rails/game/specific/_1880/ trunk/18xx/rails/game/specific/_1880/OperatingRound_1880.java trunk/18xx/rails/game/specific/_1880/PublicCompany_1880.java trunk/18xx/rails/game/specific/_1880/StockRound_1880.java trunk/18xx/tiles/svg/tile-15.svg trunk/18xx/tiles/svg/tile-80001.svg trunk/18xx/tiles/svg/tile-80002.svg trunk/18xx/tiles/svg/tile-80003.svg trunk/18xx/tiles/svg/tile-80004.svg trunk/18xx/tiles/svg/tile-80020.svg trunk/18xx/tiles/svg/tile8850.svg trunk/18xx/tiles/svg/tile8851.svg trunk/18xx/tiles/svg/tile8852.svg trunk/18xx/tiles/svg/tile8854.svg trunk/18xx/tiles/svg/tile8855.svg trunk/18xx/tiles/svg/tile8856.svg trunk/18xx/tiles/svg/tile8857.svg trunk/18xx/tiles/svg/tile8858.svg trunk/18xx/tiles/svg/tile8860.svg trunk/18xx/tiles/svg/tile8861.svg trunk/18xx/tiles/svg/tile8862.svg trunk/18xx/tiles/svg/tile8863.svg trunk/18xx/tiles/svg/tile8864.svg trunk/18xx/tiles/svg/tile8865.svg trunk/18xx/tiles/svg/tile8866.svg trunk/18xx/tiles/svg/tile887.svg trunk/18xx/tiles/svg/tile8871.svg trunk/18xx/tiles/svg/tile8872.svg trunk/18xx/tiles/svg/tile8873.svg trunk/18xx/tiles/svg/tile8874.svg trunk/18xx/tiles/svg/tile8875.svg trunk/18xx/tiles/svg/tile8877.svg trunk/18xx/tiles/svg/tile8878.svg trunk/18xx/tiles/svg/tile8879.svg trunk/18xx/tiles/svg/tile888.svg trunk/18xx/tiles/svg/tile8880.svg trunk/18xx/tiles/svg/tile8886.svg trunk/18xx/tiles/svg/tile8887.svg trunk/18xx/tiles/svg/tile8888.svg trunk/18xx/tiles/svg/tile895.svg Property Changed: ---------------- trunk/18xx/tiles/ Added: trunk/18xx/data/1880/CompanyManager.xml =================================================================== --- trunk/18xx/data/1880/CompanyManager.xml (rev 0) +++ trunk/18xx/data/1880/CompanyManager.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,184 @@ +<?xml version="1.0"?> +<!-- 1880 CompanyManager.xml --> +<CompanyManager> + + <CompanyType name="Investor" class="rails.game.PublicCompany"> + <ShareUnit percentage="100" /> + <Certificate type="President" shares="1" /> + <StockPrice market="no" /> + <BaseTokens> + <HomeBase lay="whenFloated" /> + </BaseTokens> + <Payout split="no" /> + </CompanyType> + + <CompanyType name="Private" class="rails.game.PrivateCompany" /> + + + <CompanyType name="Major" class="rails.game.PublicCompany" capitalisation="incremental" > + <Capitalisation Type="incremental" /> + <TileLays> + <Number colour="yellow" phase="2,3,4,5,6,7,8" number="2" /> + </TileLays> + <Float percentage="60" /> + <StockPrice par="yes" /> + <ShareUnit percentage="10" /> + <Certificate type="President" shares="2" /> + <Certificate shares="1" number="8" /> + <BaseTokens> + <LayCost method="sequence" cost="0,40,100" /> + </BaseTokens> + <Capitalisation type="incremental" /> + <Trains number="4,4,3,3,3,3,2,2" /> + <CanUseSpecialProperties /> + </CompanyType> + + <Company Name="A1" longname="Chinese Eastern Railway" type="Investor" tokens="1" > + <Home hex="A3" city="1" /> + </Company> + <Company Name="A2" longname="South Manchuria Railway" type="Investor" tokens="1" > + <Home hex="E13" city="1" /> + </Company>> + <Company Name="A3" longname="Zeng Tai Railway" type="Investor" tokens="1" > + <Home hex="H6" city="1" /> + </Company> + <Company Name="A4" longname="Schantung-Eisenbahngesellschaft" + type="Investor" tokens="1" > + <Home hex="H14" city="1" /> + </Company> + <Company Name="A5" longname="Kowloon-Canton Railway" type="Investor" tokens="1" > + <Home hex="Q15" city="1" /> + </Company> + <Company Name="A6" longname="Macau Hafen" type="Investor" tokens="1" > + <Home hex="P12" city="1" /> + </Company> + <Company Name="A7" longname="Kunming-Hekou Railway" type="Investor" tokens="1" > + <Home hex="Q7" city="1" /> + </Company> + <Company name="WR" longname="Woosong Railway" type="Private" + basePrice="5" revenue="0"> + <!--SpecialProperty condition="ifOwnedByPlayer" Phasenwechsel-Freie Lok --> + <ClosingConditions> + <Phase>4</Phase> + <SpecialProperties condition="ifExercised" /> + </ClosingConditions> + </Company> + <Company name="KR" longname="Kaiping Railway" type="Private" + basePrice="10" revenue="5"> + <ClosingConditions> + <Phase>4</Phase> + </ClosingConditions> + </Company> + <Company name="YC" longname="Yanda Ferry + Company" type="Private" + basePrice="25" revenue="10"> <!-- SpecialProperty condition="ifOwnedByPlayer" when="revenuecalcStep" revenue="10" --> + </Company> + <Company name="TL" longname="Taiwan Western Line" type="Private" + basePrice="45" revenue="15"> <!-- SpecialProperty condition="ifOwnedByPlayer" when="revenuecalcStep" revenue="20" --> + </Company> + <Company name="CC" longname="Chinese Rivers Ferry + Company" + type="Private" basePrice="70" revenue="20"> + <SpecialProperty condition="ifOwnedByPlayer" + when="tileLayingStep" class="rails.game.special.SpecialTileLay"> + <SpecialTileLay location="M15" extra="no" free="yes" /> + </SpecialProperty> + </Company> + <Company name="JO" longname="Jeme Tien Yow Engineer Office" + type="Private" basePrice="70" revenue="20"> + <SpecialProperty condition="ifOwnedByPlayer" when="tileLayingStep" + class="rails.game.specific._1880.BuildingPermit"> + </SpecialProperty> + </Company> + <Company name="IG" longname="Imperial Qing Government" type="Private" + basePrice="160"> + <Info key="ComesWithPresidency" parm="BCR,20" /> + </Company> + <Company name="RC" longname="Rocket Company" type="Private" + basePrice="70" revenue="0"> + <SpecialProperty condition="ifOwnedByPlayer" when="trainBuyingStep" class="rails.game.special.SpecialTrainBuy" /> + <!-- Kostenfreie Lok bei Phasenwechsel durch Lokkauf --> + <!-- Can exchange Certificate for actual train in one phase 2,2+3,3,3+3,4 + as soon as train has been bought --> + <!-- The train can be moved upon purchase into one company owned by the + owner of the certificate --> <!-- Company must have space for the new train, but can hand back an older + train to bank (2+2,3,3+3) --> + <ClosingConditions> + <Phase>5</Phase> + <SpecialProperties condition="ifExercised" /> + </ClosingConditions> + </Company> + <Company name="BCR" longname="Baocheng Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="0000FF"> + <Home hex="M3" /> + </Company> + <Company name="JHA" longname="Jingha Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="F8" /> + </Company> + <Company name="JHU" longname="Jinghu + Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="F8" /> + </Company> + <Company name="JGG" longname="Jingguang Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="F8" /> + </Company> + <Company name="JLR" longname="Jinglan Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="F8" /> + </Company> + <Company name="BZU" longname="Binzhou + Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="B8" /> + </Company> + <Company name="LHR" longname="Longhai Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="J2" /> + </Company> + <Company name="SCR" longname="Schichang Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="N12" /> + </Company> + <Company name="CKR" longname="Chengkun Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="O5" /> + </Company> + <Company name="NXR" longname="Ningxi + Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="J6" /> + </Company> + <Company name="HKR" longname="Hukun Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="K14" /> + </Company> + <Company name="NJR" longname="Najiang Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="K12" /> + </Company> + <Company name="QSR" longname="Qinshen + Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="D13" /> + </Company> + <Company name="WNR" longname="Wunan Railway" type="Major" + tokens="3" fgColour="FFFFFF" bgColour="FF0000"> + <Home hex="L10" /> + </Company> + <StartPacket roundClass="rails.game.StartRound_1880"> + <Bidding initial="5" minimum="5" increment="5" /> + <Item name="WR" type="Private" /> + <Item name="KR" type="Private" /> + <Item name="YC" type="Private" /> + <Item name="TL" type="Private" /> + <Item name="CC" type="Public" /> + <Item name="JO" type="Private" /> + <Item name="IG" type="Private"> + <SubItem name="BCR" type="Public" /> + <Item name="RC" type="Private" /> + </Item> + </StartPacket> +</CompanyManager> \ No newline at end of file Property changes on: trunk/18xx/data/1880/CompanyManager.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/1880/Game.xml =================================================================== --- trunk/18xx/data/1880/Game.xml (rev 0) +++ trunk/18xx/data/1880/Game.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,103 @@ +<?xml version="1.0"?> +<ComponentManager> + <Component name="GameManager" class="rails.game.GameManager"> + <Game name="1880"/> + <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"/> + <GameParameters> + <PlayerShareLimit percentage="100" /> + <StockRound class="rails.game.specific._1880.StockRound_1880"> + <NoSaleInFirstSR/> + </StockRound> + <OperatingRound class="rails.game.specific._1880.OperatingRound_1880"/> + </GameParameters> + <EndOfGame/> + <!-- need to implement the 3 OR set limit after purchase of first 8 Train --> + </Component> + <Component name="PlayerManager" class="rails.game.PlayerManager"> + <Players number="3" cash="600" certLimit="20"/> + <Players number="4" cash="480" certLimit="16"/> + <Players number="5" cash="400" certLimit="14"/> + <Players number="6" cash="340" certLimit="12"/> + <Players number="7" cash="300" certLimit="11"/> + </Component> + <Component name="Bank" class="rails.game.Bank"> + <Bank amount="30000"/> + </Component> + <Component name="TileManager" class="rails.game.TileManager" + file="TileSet.xml"/> + <Component name="Map" class="rails.game.MapManager" file="Map.xml"/> + <Component name="CompanyManager" class="rails.game.CompanyManager" + file="CompanyManager.xml"/> + <Component name="StockMarket" class="rails.game.StockMarket" + file="StockMarket.xml"/> + <Component name="TrainManager" class="rails.game.TrainManager"> + <Defaults> + <Reach base="stops" countTowns="major"/> + <Score towns="yes"/> + </Defaults> + <Train name="2" majorStops="2" cost="100" amount="10"/> + <Train name="2+2" majorStops="2" minorStops="2" cost="180" amount="5"/> + <Train name="3" majorStops="3" cost="180" amount="6" startPhase="2"/> + <Train name="3+3" majorStops="3" minorStops="3" cost="300" amount="5" startPhase="3"/> + <Train name="4" majorStops="4" cost="300" amount="5" startPhase="4" rustedTrain="2"/> + <Train name="4+4" majorStops="4" minorStops="4" cost="450" amount="5" startPhase="5" rustedTrain="2+2"/> + <Train name="6" majorStops="6" cost="600" amount="5" startPhase="6" rustedTrain="3"/> + <Train name="6e" majorStops="-1" cost="700" amount="5" startPhase="7" rustedTrain="3+3"/> + <!-- majorStops="-1" indicates that this not a normally running train--> + <!-- The e-type trains are express trains that can ignore towns/cities on their way for a maximum payout--> + <Train name="8" majorStops="8" cost="800" amount="2" startPhase="8" rustedTrain="4"/> + <Train name="8e" majorStops="-1" cost="900" amount="2" rustedTrain="4+4"/> + <!-- majorStops="-1" indicates that this not a normally running train--> + <!-- The e-type trains are express trains that can ignore towns/cities on their way for a maximum payout--> + <Train name="10" majorStops="10" cost="1000" amount="-1"/> + </Component> + <Component name="PhaseManager" class="rails.game.PhaseManager"> + <Phase name="1"> + <Tiles colour="yellow"/> + <OperatingRounds number="-1"/> + <Float percentage="20"/> + <Trains tradingAllowed="yes"/> + <Stocks avail="5"/> + </Phase> + <Phase name="2"> + <Tiles colour="yellow,green"/> + <OffBoardRevenue step="2"/> + <Float percentage="30"/> + <Stocks avail="10"/> + </Phase> + <Phase name="3"> + <Tiles colour="yellow,green"/> + + </Phase> + <Phase name="4"> + <Tiles colour="yellow,green"/> + <Privates close="yes"/> + <Investors active="no"/> + <Communists active="yes"/> + <Float percentage="40"/> + </Phase> + <Phase name="5"> + <Tiles colour="yellow,green,brown"/> + <OffBoardRevenue step="3"/> + </Phase> + <Phase name="6"> + <Tiles colour="yellow,green,brown"/> + <Float percentage="60"/> + <Comunists active="no"/> + </Phase> + <Phase name="7"> + <Tiles colour="yellow,green,brown"/> + </Phase> + <Phase name="8"> + <Tiles colour="yellow,green,brown,grey"/> + <OffBoardRevenue step="4"/> + </Phase> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + <Modifier class="rails.game.specific._1880.OffBoardRevenueModifier" /> + <Modifier class="rails.game.specific._1880.ExpressTrainRevenueModifier" /> + </Component> + </Component> +</ComponentManager> \ No newline at end of file Property changes on: trunk/18xx/data/1880/Game.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/1880/Map.xml =================================================================== --- trunk/18xx/data/1880/Map.xml (rev 0) +++ trunk/18xx/data/1880/Map.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,118 @@ +<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="vertical" even="B"> + <Hex name="A3" tile="-902" value="20,30,40,50" city="Russia" /> + <Hex name="A5" tile="-10" city="Qiqihar"/> + <Hex name="A7" tile="-1" /> + <Hex name="A9" tile="0" /> + <Hex name="A11" tile="0" /> + <Hex name="A13" tile="0" /> + <Hex name="A15" tile="-902" orientation="2" value="10,20,30,40" /> + <Hex name="B4" tile="0" /> + <Hex name="B6" tile="0" /> + <Hex name="B8" tile="-10" city="Harbin" /> + <Hex name="B10" tile="0" /> + <Hex name="B12" tile="-2" /> + <Hex name="B14" tile="-80001" city="testa"/> + <Hex name="C3" tile="0" cost="30" /> + <Hex name="C5" tile="0" cost="30" /> + <Hex name="C7" tile="-1" /> + <Hex name="C9" tile="-10" city="Changchun" /> + <Hex name="C11" tile="-10" city="Jilin City" /> + <Hex name="C13" tile="0" /> + <Hex name="C15" tile="0" cost="30" /> + <Hex name="D4" tile="0" cost="30"/> + <Hex name="D6" tile="0" cost="30"/> + <Hex name="D8" tile="0" cost="30"/> + <Hex name="D10" tile="0" /> + <Hex name="D12" tile="-80020" city="Shenyang, Fushun" /> + <Hex name="D14" tile="-1" /> + <Hex name="E3" tile="0" cost="30" /> + <Hex name="E5" tile="0" cost="30" /> + <Hex name="E7" tile="0" cost="30" /> + <Hex name="E9" tile="-80001" city="Test" /> + <Hex name="E11" tile="0" impassable="E13" /> + <Hex name="E13" tile="-10" city="Dalian" impassable="E11" /> + <Hex name="F2" tile="0" /> + <Hex name="F4" tile="-80020" city="Hohhot,Datong" /> + <Hex name="F6" tile="-80001" city="Test8" cost="30" /> + <Hex name="F8" tile="-80004" city="Beijing" orientation="5" label="Beijing"/> + <Hex name="F10" tile="-10" city="Tianjin" /> + <Hex name="G1" tile="0" cost="20" /> + <Hex name="G3" tile="-10" city="Baotou" cost="20" /> + <Hex name="G5" tile="0" cost="50" /> + <Hex name="G7" tile="0" /> + <Hex name="G9" tile="-1" /> + <Hex name="G11" tile="-1" cost="20" /> + <Hex name="G13" tile="0" /> + <Hex name="G15" tile="-1" /> + <Hex name="H2" tile="0" cost="30"/> + <Hex name="H4" tile="0" cost="20" /> + <Hex name="H6" tile="-10" city="Taiyuan" /> + <Hex name="H8" tile="-80020" city="Test9, Test10"/> + <Hex name="H10" tile="-10" city="Jinan" cost="20" /> + <Hex name="H12" tile="-2" /> + <Hex name="H14" tile="-10" city="Qingdao" /> + <Hex name="I1" tile="-903" orientation="5" value="10,20,30,40" city="Orumqi" /> + <Hex name="I3" tile="0" cost="30" /> + <Hex name="I5" tile="0" cost="20" /> + <Hex name="I7" tile="0" cost="50" /> + <Hex name="I9" tile="-80020" city="Kaifeng, Zhengzhou" cost="20" /> + <Hex name="I11" tile="0" /> + <Hex name="I13" tile="0" /> + <Hex name="J2" tile="-10" city="Lhasa" cost="50"/> + <Hex name="J4" tile="0" cost="30"/> + <Hex name="J6" tile="-10" cost="30" city="Xian" /> + <Hex name="J8" tile="-2" cost="30" /> + <Hex name="J10" tile="0" /> + <Hex name="J12" tile="-10" city="Hefei" /> + <Hex name="J14" tile="-1" cost="20"/> + <Hex name="K1" tile="-903" orientation="5" value="0,0,0,80" city="Lhasa" /> + <Hex name="K3" tile="0" cost="30" /> + <Hex name="K5" tile="-1" cost="30" /> + <Hex name="K7" tile="-1" cost="30" /> + <Hex name="K9" tile="0" cost="30" /> + <Hex name="K11" tile="0" /> + <Hex name="K13" tile="-10" cost="20" city="Nanjing" /> + <Hex name="K15" tile="-10" city="Shanghai" label="S"/> + <Hex name="L2" tile="0" /> + <Hex name="L4" tile="0" /> + <Hex name="L6" tile="0" /> + <Hex name="L8" tile="0" cost="50"/> + <Hex name="L10" tile="-10" city="Wuhan" cost="20"/> + <Hex name="L12" tile="-2" cost="20"/> + <Hex name="L14" tile="-80001" city="Test6" /> + <Hex name="L16" tile="-1" /> + <Hex name="M1" tile="0" cost="40"/> + <Hex name="M3" tile="-10" city="Chengdu" /> + <Hex name="M5" tile="-1" cost="30" /> + <Hex name="M7" tile="-10" city="Chongqing" cost="20" /> + <Hex name="M9" tile="0" /> + <Hex name="M11" tile="0" /> + <Hex name="M13" tile="0" /> + <Hex name="M15" tile="-1" /> + <Hex name="N2" tile="0" cost="40" /> + <Hex name="N4" tile="-80002" city="Test4,Test5" cost="20"/> + <Hex name="N6" tile="0" cost="20"/> + <Hex name="N8" tile="0" cost="30"/> + <Hex name="N10" tile="-80001" city="Test3" /> + <Hex name="N12" tile="-80020" city="Changsha, Nanchang" /> + <Hex name="N14" tile="0" /> + <Hex name="N16" tile="-903" orientation="2" value="30,30,0,0" city="Taiwan" /> + <Hex name="O1" tile="0" cost="60" /> + <Hex name="O3" tile="-2" cost="20"/> + <Hex name="O5" tile="-10" city="Kunming" /> + <Hex name="O7" tile="-80001" city="Test2" cost="30" /> + <Hex name="O9" tile="0" cost="30" /> + <Hex name="O11" tile="-2" /> + <Hex name="O13" tile="0" /> + <Hex name="O15" tile="-1" cost="30"/> + <Hex name="P2" tile="0" cost="40"/> + <Hex name="P4" tile="-1" cost="40"/> + <Hex name="P6" tile="-1" /> + <Hex name="P8" tile="-10" city="Nanning" /> + <Hex name="P10" tile="-1" cost="30" /> + <Hex name="P12" tile="-10" city="Macau" /> + <Hex name="P14" tile="-10" city="Guangzhu" /> + <Hex name="Q7" tile="-902" orientation="4" value="30,40,50,60" city="French Indochina" /> + <Hex name="Q13" tile="-902" orientation="4" value="20,30,40,50" city="Haikou" /> + <Hex name="Q15" tile="-901" orientation="3" value="20,30,10,70" city="Hongkong"/> +</Map> \ No newline at end of file Property changes on: trunk/18xx/data/1880/Map.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/1880/StockMarket.xml =================================================================== --- trunk/18xx/data/1880/StockMarket.xml (rev 0) +++ trunk/18xx/data/1880/StockMarket.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<StockMarket type="rectangular"> + <UpOrDownRight /> + <StockSpaceType name="revenue5" colour="255,255,100" /> + <StockSpaceType name="revenue10" colour="255,255,0" /> + <StockSpaceType name="revenue15" colour="100,255,255" /> + <StockSpaceType name="revenue20" colour="0,255,255" /> + <StockSpace name="A3" price="70" /> + <StockSpace name="A4" price="65" /> + <StockSpace name="A5" price="60" /> + <StockSpace name="A6" price="55" /> + <StockSpace name="A7" price="50" /> + <StockSpace name="A8" price="45" /> + <StockSpace name="A9" price="40" /> + <StockSpace name="B2" price="85" /> + <StockSpace name="B3" price="80" /> + <StockSpace name="B4" price="75" /> + <StockSpace name="B5" price="70" /> + <StockSpace name="B6" price="65" /> + <StockSpace name="B7" price="60" /> + <StockSpace name="B8" price="55" /> + <StockSpace name="B9" price="50" /> + <StockSpace name="C1" price="100" /> + <StockSpace name="C2" price="95" /> + <StockSpace name="C3" price="90" /> + <StockSpace name="C4" price="85" /> + <StockSpace name="C5" price="80" /> + <StockSpace name="C6" price="75" /> + <StockSpace name="C7" price="70" /> + <StockSpace name="C8" price="65" /> + <StockSpace name="C9" price="60" /> + <StockSpace name="D1" price="105" /> + <StockSpace name="D2" price="100" > + <Startspace /> + </StockSpace> + <StockSpace name="D3" price="95" /> + <StockSpace name="D4" price="90" > + <Startspace /> + </StockSpace> + <StockSpace name="D5" price="85" /> + <StockSpace name="D6" price="80" > + <Startspace /> + </StockSpace> + <StockSpace name="D7" price="75" /> + <StockSpace name="D8" price="70" > + <Startspace /> + </StockSpace> + <StockSpace name="D9" price="65" /> + <StockSpace name="E1" price="110" /> + <StockSpace name="E2" price="105" /> + <StockSpace name="E3" price="100" /> + <StockSpace name="E4" price="95" /> + <StockSpace name="E5" price="90" /> + <StockSpace name="E6" price="85" /> + <StockSpace name="E7" price="80" /> + <StockSpace name="E8" price="75" /> + <StockSpace name="E9" price="70" /> + <StockSpace name="F1" price="115" type="revenue5" /> + <StockSpace name="F2" price="110" type="revenue5" /> + <StockSpace name="F3" price="105" type="revenue5" /> + <StockSpace name="F4" price="100" type="revenue5" /> + <StockSpace name="F5" price="95" type="revenue5" /> + <StockSpace name="F6" price="90" type="revenue5" /> + <StockSpace name="F7" price="85" type="revenue5" /> + <StockSpace name="G1" price="120" type="revenue5" /> + <StockSpace name="G2" price="115" type="revenue5" /> + <StockSpace name="G3" price="110" type="revenue5" /> + <StockSpace name="G4" price="105" type="revenue5" /> + <StockSpace name="G5" price="100" type="revenue5" /> + <StockSpace name="G6" price="95" type="revenue5" /> + <StockSpace name="G7" price="90" type="revenue5" /> + <StockSpace name="H1" price="125" type="revenue5" /> + <StockSpace name="H2" price="120" type="revenue5" /> + <StockSpace name="H3" price="115" type="revenue5" /> + <StockSpace name="H4" price="110" type="revenue5" /> + <StockSpace name="H5" price="105" type="revenue5" /> + <StockSpace name="H6" price="100" type="revenue5" /> + <StockSpace name="I1" price="130" type="revenue10" /> + <StockSpace name="I2" price="125" type="revenue10" /> + <StockSpace name="I3" price="120" type="revenue10" /> + <StockSpace name="I4" price="115" type="revenue10" /> + <StockSpace name="I5" price="110" type="revenue10" /> + <StockSpace name="J1" price="140" type="revenue10" /> + <StockSpace name="J2" price="135" type="revenue10" /> + <StockSpace name="J3" price="130" type="revenue10" /> + <StockSpace name="J4" price="125" type="revenue10" /> + <StockSpace name="J5" price="120" type="revenue10" /> + <StockSpace name="K1" price="150" type="revenue15" /> + <StockSpace name="K2" price="145" type="revenue15" /> + <StockSpace name="K3" price="140" type="revenue15" /> + <StockSpace name="K4" price="135" type="revenue15" /> + <StockSpace name="L1" price="160" type="revenue15" /> + <StockSpace name="L2" price="155" type="revenue15" /> + <StockSpace name="L3" price="150" type="revenue15" /> + <StockSpace name="L4" price="145" type="revenue15" /> + <StockSpace name="M1" price="180" type="revenue20" /> + <StockSpace name="M2" price="170" type="revenue20" /> + <StockSpace name="M3" price="165" type="revenue20" /> + <StockSpace name="N1" price="200" type="revenue20" /> + <StockSpace name="N2" price="190" type="revenue20" /> + <StockSpace name="N3" price="180" type="revenue20" /> +</StockMarket> Property changes on: trunk/18xx/data/1880/StockMarket.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/1880/TileSet.xml =================================================================== --- trunk/18xx/data/1880/TileSet.xml (rev 0) +++ trunk/18xx/data/1880/TileSet.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,142 @@ +<TileManager tiles="Tiles.xml"> + <!-- Preprinted tiles --> + <Tile id="0"><!-- Empty space --> + <Upgrade id="7,8,9" /> + </Tile> + <Tile id="-1"><!-- 1 town --> + <Upgrade id="8850,8851,8852" /> + </Tile> + <Tile id="-2"><!-- 2 towns --> + <Upgrade id="8854,8855,8856,8857,8858" /> + </Tile> + <Tile id="-10"><!-- 1 city --> + <Upgrade id="5,6,57"/> + </Tile> + <Tile id="-80020"> + <Upgrade id="235" /> + </Tile> + <Tile id="-80001"> + <Upgrade id="5,6,57,8850,8851,8852" /> + </Tile> + <Tile id="-80002"> + <Upgrade id="8854,8855,8856,8857,8858,235" /> + </Tile> + <Tile id="-80003"> + <Upgrade id="8887" /> + </Tile> + <Tile id="-80004"> + <Upgrade id="8886" /> + </Tile> + <Tile id="-901"/> + <Tile id="-902"/> + <Tile id="-903"/> + + <!-- Yellow --> + <Tile id="5" quantity="6"> + <Upgrade id="14,15,619" /> + </Tile> + <Tile id="6" quantity="6"> + <Upgrade id="14,15,619" /> + </Tile> + <Tile id="7" quantity="5"> + <Upgrade id="18,26,27,28,29,30,31" /> + </Tile> + <Tile id="8" quantity="15"> + <Upgrade id="16,17,19,23,24,25,28,29,30,31" /> + </Tile> + <Tile id="9" quantity="15"> + <Upgrade id="18,19,20,23,24,26,27" /> + </Tile> + <Tile id="57" quantity="6"> + <Upgrade id="14,15,619" /> + </Tile> + <Tile id="235" quantity="5"> + <Upgrade id="8860,8861,8862,8863,8864,8865" /> + </Tile> + <Tile id="8850" quantity="5" /> + <Tile id="8851" quantity="6" /> + <Tile id="8852" quantity="6" /> + <Tile id="8854" quantity="2" /> + <Tile id="8855" quantity="2" /> + <Tile id="8856" quantity="2" /> + <Tile id="8857" quantity="2" /> + <Tile id="8858" quantity="2" /> + <Tile id="8877" quantity="1"> <!-- Shanghai Yellow--> + <Upgrade id="8878" /> + </Tile> + <!-- Green --> + <Tile id="14" quantity="4"> + <Upgrade id="63" /> + <Upgrade id="611" /> + </Tile> + <Tile id="15" quantity="8"> + <Upgrade id="63" /> + <Upgrade id="611" /> + </Tile> + <Tile id="619" quantity="4"> + <Upgrade id="63" /> + <Upgrade id="611" /> + </Tile> + <Tile id="16" quantity="2" /> + <Tile id="17" quantity="1" /> + <Tile id="18" quantity="1" /> + <Tile id="19" quantity="2" /> + <Tile id="20" quantity="2" /> + <Tile id="23" quantity="4" /> + <Tile id="24" quantity="4" /> + <Tile id="25" quantity="3" /> + <Tile id="26" quantity="2" /> + <Tile id="27" quantity="2" /> + <Tile id="28" quantity="2" /> + <Tile id="29" quantity="2" /> + <Tile id="30" quantity="2" /> + <Tile id="31" quantity="2" /> + <Tile id="8886" quantity="1"> + <Upgrade id="8887" /> + </Tile> + <Tile id="8878" quantity="1"> + <Upgrade id="8879" /> + </Tile> + <Tile id="8860" quantity="1"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8861" quantity="2"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8862" quantity="1"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8863" quantity="1"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8864" quantity="1"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8865" quantity="1"> + <Upgrade id="8872,8873,8874" /> + </Tile> + <Tile id="8866" quantity="3"/> + <Tile id="887" quantity="5"/> + <Tile id="888" quantity="3"/> + <!-- Brown--> + <Tile id="63" quantity="6" > + <Upgrade id="895,455" /> + </Tile> + <Tile id="611" quantity="3" > + <Upgrade id="895,455" /> + </Tile> + <Tile id="8871" quantity="3" /> + <Tile id="8872" quantity="2" /> + <Tile id="8873" quantity="2" /> + <Tile id="8874" quantity="2" /> + <Tile id="8879" quantity="1" /> + <Tile id="8887" quantity="1" > + <Upgrade id="8888" /> + </Tile> + <!-- Grey --> + <Tile id="455" quantity="3" /> + <Tile id="895" quantity="3" /> + <Tile id="8875" quantity="1" /> + <Tile id="8880" quantity="1" /> + <Tile id="8888" quantity="1" /> +</TileManager> Property changes on: trunk/18xx/data/1880/TileSet.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/1880/Tiles.xml =================================================================== --- trunk/18xx/data/1880/Tiles.xml (rev 0) +++ trunk/18xx/data/1880/Tiles.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,391 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?><Tiles><Tile colour="white" id="0" name="empty"/><Tile colour="white" id="-1" name="1 village"> + <Station id="city1" position="002" type="Town"/> + </Tile><Tile colour="white" id="-2" name="2 villages"> + <Station id="city1" position="102" type="Town"/> + <Station id="city2" position="302" type="Town"/> + </Tile><Tile colour="white" id="-10" name="1 city"> + <Station id="city1" position="302" slots="1" type="City"/> + </Tile><Tile colour="white" id="-80020" name="2 cities Initial"> + <Station id="city1" position="002" slots="1" type="City"/> + <Station id="city2" position="302" slots="1" type="City"/> + </Tile><Tile colour="white" id="-80001" name="Medium City"> + <Station id="city1" position="052" slots="1" type="City"/> + </Tile><Tile colour="white" id="-80002" name="2 Medium Cities"> + <Station id="city1" position="002" slots="1" type="City"/> + <Station id="city2" position="302" slots="1" type="City"/> + </Tile><Tile colour="white" id="-80003" name="Shanghai"> + <Station id="city1" position="052" slots="1" type="City"/> + </Tile><Tile colour="yellow" id="-80004" name="Beijing"> + <Station id="city1" position="103" slots="1" type="City" value="20"/> + <Station id="city2" position="203" slots="1" type="City" value="20"/> + <Station id="city3" position="403" slots="1" type="City" value="20"/> + <Station id="city4" position="503" slots="1" type="City" value="20"/> + <Track from="city3" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city4" gauge="normal" to="side5"/> + </Tile><Tile colour="red" id="-901" name="OM 1 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="red" id="-902" name="OM 2 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile><Tile colour="red" id="-903" name="OM 3 way"> + <Station id="city1" position="0" type="OffMapCity" value="-1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile><Tile colour="yellow" id="5" name="5"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="yellow" id="6" name="6"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="yellow" id="7" name="7"> + <Track from="side3" gauge="normal" to="side4"/> + </Tile><Tile colour="yellow" id="8" name="8"> + <Track from="side3" gauge="normal" to="side5"/> + </Tile><Tile colour="yellow" id="9" name="9"> + <Track from="side3" gauge="normal" to="side0"/> + </Tile><Tile colour="yellow" id="57" name="57"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="yellow" id="235" name="235"> + <Station id="city1" position="502" slots="1" type="City" value="20"/> + <Station id="city2" position="352" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="yellow" id="8850" name="8850"> + <Station id="city1" position="352" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="yellow" id="8851" name="8851"> + <Station id="city1" position="307" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile><Tile colour="yellow" id="8852" name="8852"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="yellow" id="8854" name="8854"> + <Station id="city1" position="0" type="Town" value="20"/> + <Station id="city2" position="252" type="Town" value="20"/> + <Track from="side2" gauge="normal" to="city2"/> + <Track from="side2" gauge="normal" to="side1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile><Tile colour="yellow" id="8855" name="8855"> + <Station id="city1" position="303" type="Town" value="20"/> + <Station id="city2" position="103" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side1" gauge="normal" to="city2"/> + <Track from="side1" gauge="normal" to="side4"/> + </Tile><Tile colour="yellow" id="8856" name="8856"> + <Station id="city1" position="307" type="Town" value="20"/> + <Station id="city2" position="008" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="city2"/> + <Track from="side1" gauge="normal" to="city1"/> + <Track from="city2" gauge="normal" to="side2"/> + </Tile><Tile colour="yellow" id="8857" name="8857"> + <Station id="city1" position="303" type="Town" value="20"/> + <Station id="city2" position="107" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side5" gauge="normal" to="city2"/> + <Track from="side1" gauge="normal" to="city2"/> + <Track from="side0" gauge="normal" to="city1"/> + </Tile><Tile colour="yellow" id="8858" name="8858"> + <Station id="city1" position="201" type="Town" value="20"/> + <Station id="city2" position="501" type="Town" value="20"/> + <Track from="side4" gauge="normal" to="city2"/> + <Track from="side4" gauge="normal" to="side0"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="side1"/> + </Tile><Tile colour="yellow" id="8877" name="8877"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="14" name="14"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="15" name="15"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="619" name="619"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="16" name="16"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="17" name="17"> + <Track from="side0" gauge="normal" to="side2"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="18" name="18"> + <Track from="side3" gauge="normal" to="side0"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="19" name="19"> + <Track from="side5" gauge="normal" to="side1"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile><Tile colour="green" id="20" name="20"> + <Track from="side1" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="23" name="23"> + <Track from="side4" gauge="normal" to="side0"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile><Tile colour="green" id="24" name="24"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="25" name="25"> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="26" name="26"> + <Track from="side5" gauge="normal" to="side0"/> + <Track from="side0" gauge="normal" to="side3"/> + </Tile><Tile colour="green" id="27" name="27"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="28" name="28"> + <Track from="side3" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="29" name="29"> + <Track from="side3" gauge="normal" to="side4"/> + <Track from="side3" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="30" name="30"> + <Track from="side0" gauge="normal" to="side2"/> + <Track from="side2" gauge="normal" to="side3"/> + </Tile><Tile colour="green" id="31" name="31"> + <Track from="side1" gauge="normal" to="side2"/> + <Track from="side2" gauge="normal" to="side4"/> + </Tile><Tile colour="green" id="8886" name="8886"> + <Station id="city1" position="303" slots="1" type="City" value="40"/> + <Station id="city2" position="203" slots="1" type="City" value="40"/> + <Station id="city3" position="103" slots="1" type="City" value="40"/> + <Station id="city4" position="503" slots="1" type="City" value="40"/> + <Station id="city5" position="003" slots="1" type="City" value="40"/> + <Station id="city6" position="403" slots="1" type="City" value="40"/> + <Track from="city1" gauge="normal" to="city1"/> + <Track from="city6" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city2" gauge="normal" to="side2"/> + <Track from="city3" gauge="normal" to="side1"/> + <Track from="city5" gauge="normal" to="side0"/> + <Track from="city4" gauge="normal" to="side5"/> + <Track from="city4" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="8878" name="8878"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="side5" gauge="normal" to="city1"/> + <Track from="side2" gauge="normal" to="city1"/> + </Tile><Tile colour="green" id="8860" name="8860"> + <Station id="city1" position="308" slots="1" type="City" value="40"/> + <Station id="city2" position="008" slots="1" type="City" value="40"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side5" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="city2"/> + <Track from="side2" gauge="normal" to="city2"/> + </Tile><Tile colour="green" id="8861" name="8861"> + <Station id="city1" position="452" slots="1" type="City" value="40"/> + <Station id="city2" position="152" slots="1" type="City" value="40"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="city2"/> + <Track from="side1" gauge="normal" to="city2"/> + </Tile><Tile colour="green" id="8862" name="8862"> + <Station id="city1" position="452" slots="1" type="City" value="40"/> + <Station id="city2" position="052" slots="1" type="City" value="40"/> + <Track from="side0" gauge="normal" to="city2"/> + <Track from="side5" gauge="normal" to="city2"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="city1"/> + </Tile><Tile colour="green" id="8863" name="8863"> + <Station id="city1" position="0" slots="1" type="City" value="40"/> + <Station id="city2" position="552" slots="1" type="City" value="40"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side4" gauge="normal" to="city2"/> + <Track from="city2" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="8864" name="8864"> + <Station id="city1" position="308" slots="1" type="City" value="40"/> + <Station id="city2" position="152" slots="1" type="City" value="40"/> + <Track from="side0" gauge="normal" to="city2"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="8865" name="8865"> + <Station id="city1" position="252" slots="1" type="City" value="40"/> + <Station id="city2" position="551" slots="1" type="City" value="40"/> + <Track from="side1" gauge="normal" to="city1"/> + <Track from="side5" gauge="normal" to="city2"/> + <Track from="city2" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="green" id="8866" name="8866"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="green" id="887" name="887"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile><Tile colour="green" id="888" name="888"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="brown" id="63" name="63"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="brown" id="611" name="611"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="brown" id="8871" name="8871"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="brown" id="8872" name="8872"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="brown" id="8873" name="8873"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="brown" id="8874" name="8874"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile><Tile colour="brown" id="8879" name="8879"> + <Station id="city1" position="0" slots="2" type="City" value="60"/> + <Track from="city1" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="side4" gauge="normal" to="city1"/> + </Tile><Tile colour="brown" id="8887" name="8887"> + <Station id="city1" position="403" slots="1" type="City" value="60"/> + <Station id="city2" position="303" slots="1" type="City" value="60"/> + <Station id="city3" position="203" slots="1" type="City" value="60"/> + <Station id="city4" position="103" slots="1" type="City" value="60"/> + <Station id="city5" position="003" slots="1" type="City" value="60"/> + <Station id="city6" position="503" slots="1" type="City" value="60"/> + <Track from="city6" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side3"/> + <Track from="city3" gauge="normal" to="side2"/> + <Track from="city4" gauge="normal" to="side1"/> + <Track from="city5" gauge="normal" to="side0"/> + </Tile><Tile colour="gray" id="455" name="495"> + <Station id="city1" position="0" slots="3" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile><Tile colour="gray" id="895" name="895"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="gray" id="8875" name="8875"> + <Station id="city1" position="0" slots="2" type="City" value="60"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="gray" id="8880" name="8880"> + <Station id="city1" position="0" slots="2" type="City" value="70"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="city1"/> + <Track from="side0" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile><Tile colour="gray" id="8888" name="Beijing"> + <Station id="city1" position="403" slots="1" type="City" value="80"/> + <Station id="city2" position="303" slots="1" type="City" value="80"/> + <Station id="city3" position="203" slots="1" type="City" value="80"/> + <Station id="city4" position="103" slots="1" type="City" value="80"/> + <Station id="city5" position="003" slots="1" type="City" value="80"/> + <Station id="city6" position="503" slots="1" type="City" value="80"/> + <Track from="city3" gauge="normal" to="side2"/> + <Track from="city4" gauge="normal" to="side1"/> + <Track from="city5" gauge="normal" to="side0"/> + <Track from="city6" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city2" gauge="normal" to="side3"/> + <Track from="city2" gauge="normal" to="side2"/> + <Track from="city2" gauge="normal" to="side1"/> + <Track from="city2" gauge="normal" to="side0"/> + <Track from="city2" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side4"/> + <Track from="city3" gauge="normal" to="side1"/> + <Track from="city3" gauge="normal" to="side0"/> + <Track from="city3" gauge="normal" to="side5"/> + <Track from="city3" gauge="normal" to="side4"/> + <Track from="city3" gauge="normal" to="side4"/> + <Track from="city3" gauge="normal" to="side3"/> + <Track from="city4" gauge="normal" to="side2"/> + <Track from="city4" gauge="normal" to="side0"/> + <Track from="city4" gauge="normal" to="side5"/> + <Track from="city4" gauge="normal" to="side4"/> + <Track from="city4" gauge="normal" to="side3"/> + <Track from="city5" gauge="normal" to="side1"/> + <Track from="city5" gauge="normal" to="side2"/> + <Track from="city5" gauge="normal" to="side3"/> + <Track from="city5" gauge="normal" to="side4"/> + <Track from="city5" gauge="normal" to="side5"/> + <Track from="city6" gauge="normal" to="side4"/> + <Track from="city6" gauge="normal" to="side3"/> + <Track from="city6" gauge="normal" to="side2"/> + <Track from="city6" gauge="normal" to="side1"/> + <Track from="city6" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile></Tiles> \ No newline at end of file Property changes on: trunk/18xx/data/1880/Tiles.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-04-10 18:59:13 UTC (rev 1515) +++ trunk/18xx/data/GamesList.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -279,6 +279,15 @@ <Description>18TN</Description> <Players minimum="3" maximum="5"/> </Game> + <Game name="1880"> + <Note>Prototype</Note> + <Description>1880 - China + (c) 2010 Double O Games Mayfair Games, Inc. + Designed by Leonhard Ogler and Helmut Ohley + Limitations: + All aspects not present in 1880 have not been implemented yet.</Description> + <Players minimum="3" maximum="7"/> + </Game> <Credits>Rails is a computer implementation of a number of railroad board games, Added: trunk/18xx/rails/game/specific/_1880/OperatingRound_1880.java =================================================================== --- trunk/18xx/rails/game/specific/_1880/OperatingRound_1880.java (rev 0) +++ trunk/18xx/rails/game/specific/_1880/OperatingRound_1880.java 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,23 @@ +/** + * + */ +package rails.game.specific._1880; + +import rails.game.GameManagerI; +import rails.game.OperatingRound; + +/** + * @author Martin + * + */ +public class OperatingRound_1880 extends OperatingRound { + + /** + * @param gameManager + */ + public OperatingRound_1880(GameManagerI gameManager) { + super(gameManager); + // TODO Auto-generated constructor stub + } + +} Property changes on: trunk/18xx/rails/game/specific/_1880/OperatingRound_1880.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1880/PublicCompany_1880.java =================================================================== --- trunk/18xx/rails/game/specific/_1880/PublicCompany_1880.java (rev 0) +++ trunk/18xx/rails/game/specific/_1880/PublicCompany_1880.java 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,23 @@ +/** + * + */ +package rails.game.specific._1880; + +import rails.game.*; +import rails.game.state.IntegerState; + +/** + * @author Martin + * + */ +public class PublicCompany_1880 extends PublicCompany { + + /** + * + */ + + + + + +} Property changes on: trunk/18xx/rails/game/specific/_1880/PublicCompany_1880.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1880/StockRound_1880.java =================================================================== --- trunk/18xx/rails/game/specific/_1880/StockRound_1880.java (rev 0) +++ trunk/18xx/rails/game/specific/_1880/StockRound_1880.java 2011-04-13 20:24:27 UTC (rev 1516) @@ -0,0 +1,57 @@ +/** + * This class implements the 1880 rules for making new companies + * being available in the IPO after buying shares of another company. + */ +package rails.game.specific._1880; + +import java.util.ArrayList; +import java.util.List; + +import rails.game.*; +import rails.game.action.BuyCertificate; +import rails.util.LocalText; + +public class StockRound_1880 extends StockRound { + + /** + * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Stock Round + * + */ + public StockRound_1880 (GameManagerI aGameManager) { + super (aGameManager); + } + + + @Override + // The sell-in-same-turn-at-decreasing-price option does not apply here + protected int getCurrentSellPrice (PublicCompanyI company) { + + String companyName = company.getName(); + int price; + + if (sellPrices.containsKey(companyName)) { + price = (sellPrices.get(companyName)).getPrice(); + } else { + price = company.getCurrentSpace().getPrice(); + } + // stored price is the previous unadjusted price + price = price / company.getShareUnitsForSharePrice(); + // Price adjusted by -5 per share for selling + price = price -5; + return price; + } + + /** Share price goes down 1 space for any number of shares sold. + */ + @Override + protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { + // No more changes if it has already dropped + if (!soldBefore) { + super.adjustSharePrice (company, 1, soldBefore); + } + } +} + + \ No newline at end of file Property changes on: trunk/18xx/rails/game/specific/_1880/StockRound_1880.java ___________________________________________________________________ Added: svn:mime-type + text/plain Property changes on: trunk/18xx/tiles ___________________________________________________________________ Modified: svn:ignore - Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt TileDictionary - kopie.xml + Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt TileDictionary - kopie.xml TileDictionary - kopie.18t Modified: trunk/18xx/tiles/TileDictionary.18t =================================================================== (Binary files differ) Modified: trunk/18xx/tiles/TileDictionary.xml =================================================================== --- trunk/18xx/tiles/TileDictionary.xml 2011-04-10 18:59:13 UTC (rev 1515) +++ trunk/18xx/tiles/TileDictionary.xml 2011-04-13 20:24:27 UTC (rev 1516) @@ -10997,408 +10997,6 @@ </connections> </tile> <tile> - <ID>391</ID> - <shape>tsHexagon</shape> - <level>tlYellow</level> - <name>391</name> - <category> - <value>Atl</value> - <position>tp3SideB</position> - </category> - <junctions> - <junction> - <junType>jtCity</junType> - <position>tp2SideC</position> - <revenue> - <value>30</value> - <position>tp3SideF</position> - </revenue> - </junction> - <junction> - <junType>jtCity</junType> - <position>tp2SideA</position> - <revenue> - <value>30</value> - <position>tp3SideF</position> - </revenue> - </junction> - <junction> - <junType>jtCity</junType> - <position>tp2SideE</position> - <revenue> - <value>30</value> - <position>tp3SideF</position> - </revenue> - </junction> - </junctions> - <connections> - <connection> - <conType>ctNormal</conType> - <position1>tp2SideC</position1> - <position2>tp4SideC</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tp2SideA</position1> - <position2>tp4SideA</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tp2SideE</position1> - <position2>tp4SideE</position2> - </connection> - </connections> - </tile> - <tile> - <ID>392</ID> - <shape>tsHexagon</shape> - <level>tlGreen</level> - <name>392</name> - <category> - <value>Sav</value> - <position>tp3CornerF</position> - </category> - <junctions> - <junction> - <junType>jtDoubleCity</junType> - <position>tpCenter</position> - <revenue> - <value>30</value> - <position>tp3CornerA</position> - </revenue> - </junction> - </junctions> - <connections> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideB</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideC</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideD</position2> - </connection> - </connections> - </tile> - <tile> - <ID>393</ID> - <shape>tsHexagon</shape> - <level>tlGreen</level> - <name>393</name> - <category> - <value>Aug</value> - <position>tp3CornerF</position> - </category> - <junctions> - <junction> - <junType>jtDoubleCity</junType> - <position>tpCenter</position> - <revenue> - <value>30</value> - <position>tp3CornerA</position> - </revenue> - </junction> - </junctions> - <connections> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideF</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideC</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideD</position2> - </connection> - <connection> - <conType>ctNormal</conType> - <position1>tpCenter</position1> - <position2>tp4SideE</position2> - </connection> - </connections> - </tile> - <tile> - <ID>394</ID> - <shape>tsHexagon</shape> - <level>tlGreen</level> - <name>394</name> - <category> - <value>Atl</value> - <position>tp3CornerF</position> - </category> - <junctions> - <j... [truncated message content] |
From: <wak...@us...> - 2011-04-19 20:57:30
|
Revision: 1523 http://rails.svn.sourceforge.net/rails/?rev=1523&view=rev Author: wakko666 Date: 2011-04-19 20:57:21 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Add in batik-1.7, update classpath. Modified Paths: -------------- trunk/18xx/.classpath trunk/18xx/test/SVGOffscreenLoader.java Added Paths: ----------- trunk/18xx/lib/batik-1.7/ trunk/18xx/lib/batik-1.7/CHANGES trunk/18xx/lib/batik-1.7/LICENSE trunk/18xx/lib/batik-1.7/NOTICE trunk/18xx/lib/batik-1.7/README trunk/18xx/lib/batik-1.7/batik-rasterizer.jar trunk/18xx/lib/batik-1.7/batik-slideshow.jar trunk/18xx/lib/batik-1.7/batik-squiggle.jar trunk/18xx/lib/batik-1.7/batik-svgpp.jar trunk/18xx/lib/batik-1.7/batik-ttf2svg.jar trunk/18xx/lib/batik-1.7/batik.jar trunk/18xx/lib/batik-1.7/lib/ Modified: trunk/18xx/.classpath =================================================================== --- trunk/18xx/.classpath 2011-04-18 16:18:35 UTC (rev 1522) +++ trunk/18xx/.classpath 2011-04-19 20:57:21 UTC (rev 1523) @@ -1,15 +1,16 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path=""/> - <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry exported="true" kind="lib" path="lib/batik-1.6/batik.jar"/> - <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/js.jar"/> - <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/pdf-transcoder.jar"/> - <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/xerces_2_5_0.jar"/> - <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/xml-apis.jar"/> - <classpathentry exported="true" kind="lib" path="lib/log4j-1.2/log4j-1.2.14.jar"/> - <classpathentry kind="lib" path="lib/jgraph5/jgraph.jar"/> - <classpathentry kind="lib" path="lib/jgrapht-0.7.3/jgrapht-jdk1.5.jar"/> - <classpathentry kind="lib" path="lib/junit_3.8.2/junit.jar"/> - <classpathentry kind="output" path="classes"/> -</classpath> +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry excluding="lib/batik-1.7/|lib/jgraph5/|lib/jgrapht-0.7.3/|lib/junit_3.8.2/|lib/log4j-1.2/|lib/batik-1.7/lib/|lib/jgraph5/|lib/jgrapht-0.7.3/|lib/junit_3.8.2/|lib/log4j-1.2/|lib/batik-1.7/|lib/batik-1.7/lib/" kind="src" path=""/> + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="lib/log4j-1.2/log4j-1.2.14.jar"/> + <classpathentry kind="lib" path="lib/jgrapht-0.7.3/jgrapht-jdk1.5.jar"/> + <classpathentry kind="lib" path="lib/junit_3.8.2/junit.jar"/> + <classpathentry kind="lib" path="lib/jgraph5/jgraph.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/batik.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/lib/batik-bridge.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/lib/batik-dom.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/lib/batik-ext.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/lib/batik-gvt.jar"/> + <classpathentry kind="lib" path="lib/batik-1.7/lib/batik-util.jar"/> + <classpathentry kind="output" path="classes"/> +</classpath> Added: trunk/18xx/lib/batik-1.7/CHANGES =================================================================== --- trunk/18xx/lib/batik-1.7/CHANGES (rev 0) +++ trunk/18xx/lib/batik-1.7/CHANGES 2011-04-19 20:57:21 UTC (rev 1523) @@ -0,0 +1,1528 @@ +Change Log +========== + +The following log records some of the most important changes. +Bug fixing is an on-going task, so it is implied in all sub-releases. + +1.7beta1 -> 1.7 +--------------- + +1. Bugzilla problem reports fixed: + + 26815, 28344, 35165, 36570, 37496, 38498, 40163, 40727, 41205, + 41820, 41947, 41955, 41988, 42014, 42021, 42032, 42075, 42118, + 42137, 42168, 42169, 42196, 42209, 42210, 42212, 42221, 42228, + 42255, 42258, 42311, 42312, 42333, 42381, 42386, 42479, 42504, + 42505, 42543, 42645, 42651, 42697, 42698, 42807, 42961, 42963, + 442968, 3022, 43043, 43045, 43165, 43194, 43195, 43370, 43418, + 443446, 3638, 43657, 43744, 43760, 43764, 43787, 43854, 43871, + 443904, 3953, 44029, 44054, 44092, 44146 + +2. New features + + * xml:id support (http://www.w3.org/TR/xml-id/). + * ElementTraversal support (http://www.w3.org/TR/ElementTraversal/). + * Enhanced DOM Viewer window, contributed from Ivan Andjelkovic, + a Google Summer of Code student. + +3. Improvements + + * Support for cursor="move" on OS X, and cursor="help" on all + platforms. + * Improved conversion to/from WMF. + * data: URIs now supported as external stylesheets, scripts, filters. + * SVG 1.1 feature strings now reported. + * The viewBox="" attribute on <svg> is now animatable. + * Implemented SVGSVGelement.getViewBox(). + * A document's document element can now be replaced. + * Performing animation hyperlinking backwards is now supported, as + well as using <a> elements to hyperlink to animations. + * Updated pdf-transcoder.jar to one built from FOP 0.94. + * Squiggle's View Source window is now syntax highlighted. + +4. Bug fixes + + * XPath interface objects now exposed to ECMAScript. + * The three other MIME types for ECMAScript are now really supported + (text/javascript, application/javascript, application/ecmascript). + * Pseudo-elements now parsed properly in CSS selectors. + * Avoid null pointer exception when event-base timing specifiers + in animations reference an element by ID within a <use> shadow tree. + * Invalid min="" and max="" values on animation elements now ignored. + * Corrected CSS cascade order for rules of equal specificity. + * Fixed CSS :lang() processing so that it matches case insenstiviely, + using xml:lang="" as well as lang="", and using proper hyphen- + separated tokens. + * Gradients with gradientUnits="objectBoundingBox" disabled when the + bounding box has zero width or height. + * Avoid an array index exception for certain degenerate motion path + animations. + * Fixed mouse event button reporting. + * Avoid null pointer exception when cloning <symbol> and <image> + elements. + * Make empty <filter> elements result in no rendering for the + filtered element. + * SVGStylable.getPresentationAttribute() now returns null if the given + presentation attribute is not specified on the element. + * Specifying textLength="" on text elements that have non-text nodes + as their first children now works. + * Avoid numerical accuracy issues when sampling frozen animations. + * Event listeners are now removed when <text> elements are removed + from the document. + * Invalid SVG 1.0 feature string removed. + * Ensure animation elements are properly deinitialised when they are + removed from the document. + * Allowed animations in <use> element shadow trees to have syncbase + timing specifiers that refer to elements outside the shadow tree. + * Fixed bug in DOM event removal/dispatch. + * Ensure the animation engine is resumed if it is sleeping when a + beginElement() call is made. + * Avoid a null pointer exception in JSVGScrollPane if the document + doesn't return a bounds. + * Avoid a null pointer exception when painting a GraphicsNode on to an + SVGGraphics2D. + * Rasterizer -cssUser command line argument now resolved against + current working directory. + * Fixed bug in key event dispatching code. + * Decrease memory required for storing animation elements' previous + intervals (used for hyperlinking). + * Avoid infinite loop for animations with multiple, identical begin + (or end) instance times. + * Ensure TIFF and JPEG codecs really aren't compiled unless the relevant + Sun classes are present. + * Avoid null pointer exception when accessing animated marker orient + values. + * Patched Rhino so that the ECMAScript debugger runs on OS X. + * Ensure the animation engine is initialised before the SVGLoad event + is dispatched. + * Restored exception throwing from bridge classes when required + length attributes are missing. + * Duplicated codec classes removed from awt-util jar. + * Avoid null pointer exceptions in DOMMouseEvent objects. + * Motion animation transforms are now applied after the transform="" + attribute. + * Fixed bug in DOM event default action invocation in SVG 1.2 documents. + * Fixed bug in CSS class name matching, which occured only when an + element was declared to be a member of multiple classes, where one + is a prefix of another. + * Fixed bug on OS X where the zoom interactor overlay was not shown. + +5. Misc + + * Official maven artifacts are now supplied. + +1.6 -> 1.7beta1 +--------------- + +1. Bugzilla problem reports fixed: + + 22260, 25428, 28337, 29417, 29552, 32415, 34217, 34234, 34364, + 34847, 34938, 35349, 35480, 35549, 35655, 35661, 35683, 35722, + 35727, 35773, 35878, 35976, 35977, 36165, 36253, 36278, 36309, + 36455, 36483, 36485, 36493, 36511, 36613, 36614, 36615, 36743, + 36745, 36746, 36747, 36769, 36889, 36924, 36933, 37276, 37497, + 37890, 37891, 37892, 37986, 37989, 38045, 38158, 38176, 38178, + 38183, 38379, 38475, 38497, 38549, 38558, 38568, 38750, 38775, + 38782, 38785, 38831, 38872, 38930, 38932, 38933, 38990, 39032, + 39058, 39202, 39297, 39303, 39318, 39361, 39751, 39755, 39784, + 39831, 39838, 40098, 40167, 40336, 40368, 40392, 40393, 40397, + 40403, 40405, 40594, 40605, 40631, 40681, 40686, 40857, 40898, + 40927, 40994, 41079, 41165, 41216, 41234, 41288, 41329, 41331, + 41336, 41473, 43954 + +2. New features + + * DOM Level 3 Core/Events/XPath support. + * Improved WMF transcoder support. + * Override style declaration support. + * Near complete SMIL Animation support. + * SVG 1.2 features: + * resource documents + * shapechange and RenderedBBoxChange events + * SVGGlobal startMouseCapture/stopMouseCapture methods + * handler elements + +3. Improvements + + * The SVG namespace declaration is now not assumed for the document element + when an SVG declaration is not present. Certain non-conformant content + will now be identified as being in error. + * New MacRenderer implementation that avoids 10x slowdown on + Tiger. + * Mutations to flowText contents now cause the rendering to update, and + flowRegion objects are now rendered. + * Support for normalized path segments on SVGAnimatedPathData, thanks to + Andres Toussaint. + * Updated pdf-transcoder.jar to one built from FOP 0.9alpha1: + * This fixes text being drawn as text in PDF. + * JPEG streams being embedded as JPEG. + * Default bitmap dpi is 300. + * Most gradients and patterns are now correct (pattern overflow isn't + handled properly although most of the code is present), and + gradients with complex repeats are rasterized due to difficulties + expressing them in PDF. + * Transcoders with the KEY_EXECUTE_ONLOAD hint set force the document + to be dynamic. + * Added JIIO codecs to Batik (not enabled by default) + * Support for finding XML Parser through JAXP. + * Enhancements to ArabicTextHandler. + * Update Manager's MIN_REPAINT time is now adjustable. + * GraphicsUtil warning about Graphics from BufferedImage + w/o BUFFERED_IMAGE hint is now controllable with property. + * JSVGScrollPane now has 'scrollbarAlwaysVisible' mode. + * Improved Path parser so it is more conformant. + * Updated Rhino to 1.6R5. + * Documents in Squiggle's Go menu now have the full URI as a tooltip. + * Better version number reporting from org.apache.batik.Version. + * Implemented SVGPathElement.getPathSegAtLength. + * Implemented 'getFunctionName' for built in CSS functions. + * Exposed SAXDocumentFactory's parser to subclasses. + * Added a -snapshotTime option to the rasteriser. + * Now using Apache XML Commons External, for SAC, DOM 3 Core, SMIL Animation + and SVG 1.1 DOM bindings. + * Encoding as specified in a Content-Type header's charset parameter is now + honoured when scripts are loaded. + * Changed InterpreterFactory so that multiple MIME types can be associated + with a given Interpreter. + * text/javascript, text/ecmascript, application/javascript and + application/ecmascript are now all supported as script types for Rhino. + Processing of application/ecmascript is as specified in RFC 4329. + * Improved integration when running under Mac OS X: Squiggle's menu bar + is now at the top of the screen, the application window has a proper + name and functional About/Preferences/Quit menu items, and a Squiggle.app + application bundle can now be created. + * JAR files now have Implementation-* attributes. + * Added an interface for all ImageRenderers to get/set RenderingHints. + +3. Bug fixes + + * SVGMatrix.rotate now takes deg rather than radians. + * Fixed mouseout/mouseover tracking, which regressed some time between + 1.5beta5 and 1.6. + * Fixed misplaced glyph for mixed LTR and RTL text. + * Fixed handling of tooltips from title elements. + * Fixed rendering error (bug 36511). + * Fix for broken event propagation across 'use' element shadow tree boundary. + * Fixed a bug in the handling of 'x', 'y', 'width', 'height', + on feImage elements. + * Fixed bug in EventTarget.{add,remove}EventListenerNS wrapper + for Rhino. + * Fixed memory leak with dynamically added title tooltips. + * Fixed bug with update regions and filters. + * Fixed a problem with feSpotLight and feSpecular lighting (bug 36745). + * Fixed bug with event removal for multiple events and the same target + (thanks Andreas). + * Fixed problem with lowercase 'European' vowels (accented vowels). + * Fixed duplicated fragment identifier bug. + * Fix to allow transcoders that execute onload to work with SVG 1.2 + documents. + * Fix incorrect reporting of modifier key states in DOM UI event objects. + * The broken link image works again now. + * Convert "" to null for namespace URIs given to public DOM interfaces. + * Gradient scaleback is now 0.999 rather than 0.97. + * ttf2svg now emits a document with an SVG namespace declaration. + * Include the o.a.b.ext.awt.image.spi.{ImageWriter,RegistryEntry} service + resource files in the codec jar. (Fixes problems with data: URIs for + images when Squiggle is run from the jars.) + * Fixed problem with ZoomAndPan handling overriding user disabling of + interactors. + * More sensible handling of source 'URLs' in svgrasterizer. + * Greyscale sources are now treated as if they have sRGB Gamma. + * Fixed SVGTextContentElement.getExtentOfChar to use glyph metrics rather + than the glyph shape bounding box. + * Changed Errors to UnsupportedOperationExceptions for unimplemented methods. + * JSVGViewerFrame uses reflection for the Rhino debugger to enable + compilation without Rhino. + * Fixed phantom 'double click' bug. + * Handle 'style' elements added and removed from the document when they are + not at the root of the addition/removal. + * Make CSS engine not throw an NPE for extension elements that don't expose + an OverrideStyleProvider. + * Fixes for text-on-a-path with glyphs who's geometry doesn't "start" at 0. + * Various deadlock fixes. + * Fixed bug where writing TIFF with JPEG compression fails. + * Fixed significant performance bug in creating geometry (it was + parsing the entire path for each entry in the path, O(N^2)). + * Fixed SVGTextContent interfaces on FlowRoot elements. + * Fixed NPE when reloading an SVG 1.2 document quickly. + * Fixed bug where mousing over 'a' elements would result in exceptions. + * Avoid NPEs when loading scripts from file: URIs. + * Fixed flowText regression by rebasing off SVGOMTextPositioningElement. + * radialGradient has a default value of "50%" for 'r' (thanks Tonny). + * Fixed bug in key event dispatching when compiled under JDK 1.3. + * Avoid precision errors in stringification of transform list values + (thanks Nick). + * Unmaximize Squiggle window if the "Automatically resize window when + loading documents" option is turned on. + * Fixed improper rendering of the batik70.svg sample under OS X. + * Fixed synchronization bug in the SVG generator. + +4. Misc + + * Code now compiles under Java 1.5 and 1.6. + * Lots of code/javadoc cleanups. + * New Forrest-based website for Batik. + * New about box/splash screen. + * Visual refresh for Squiggle's toolbar icons and Preferences window. + +1.5.1 -> 1.6 +------------ + +1. Bugzilla problem reports fixed: + + 28035, 28188, 28429, 28432, 28487, 29110, 29891, 30580, 30584, + 30739, 30923, 30925, 30948, 31603, 32108, 32435, 32872, 32951, + 33242, 33733, 33890, 33923, 33986, 34030, 34041, 34115 + + +2. SVG 1.2 Features: + + * All SVG 1.2 elements/features have been moved from + the Batik namespace into the SVG 1.2 namespace (except for + flowText which remains, due to some loss of functionality + with the current flowRoot and potential spec instability). + * Implementation of SVG 1.2 flowRoot element (text flow into + arbitrary regions with bidi support). + * There is now an SVG12CSSEngine which has support for new + properties in SVG 1.2 + + +3. Improvements: + + * Massive performance improvement (>10X) for drawing on Mac OS X. + * Document.getElementById now uses a Hashtable to speedup lookups. + * JavaScript can now be used in an Applet out of the box. + * Added support for 'font' shorthand property. + * Added support for 'deselectAll' SVG DOM call. + * getEncolsureList and getIntersectionList are implemented. + * Added support for get[Screen]PixelUnitToMillimeterX/Y + * SVG DOM getTotalLength, and getPointAtLength are now implemented. + * Support for preserveAspectRatio DOM methods. + * Squiggle browser now has a 'Save As' menu item. + * Can toggle if xml:base should be added to saved SVG. + * Can 'pretty print' saved XML for readability. + * ExtensibleSVGDOMImplementation no longer exists, + the SVGDOMImplementation is now extensible. There is a + new baseclass ExtensibleDOMImplementation that provides + extension capabilities to any DOMImplementation subclass. + As a result the name of the services meta-file has moved to: + 'org.apache.batik.dom.DomExtension' + from: + 'org.apache.batik.dom.svg.DomExtension'. + People with DOM extension will have to update the service file + accordingly. + * ExtensibleDOMImplementation now allows 'extension' elements in + the SVG Namespace (they are always lower priority than 'buit ins'). + * When a new Document is loaded a new BridgeContext is created for it. + As a result each document now get's it's own CSS engine. + * ttf2svg now supports 'auto ranging' so it looks at the font + to decide what to output. + * DOM will now detect when the child passed to insert/remove + * AbstractParentNode will now throw a DOM Hierarchy exception + if you try to append a node as a child of it's self (PR 34030) + * Anti-aliased clips (hqClip patch). This can be disabled by setting + the transcoding hint to vector or print (so content doesn't get + rasterized). PR 29110. + * Control of tiled image rendering based on rendering hint. + Using this hint may greatly increase the amount of memory used. + * The Marker interface now has a 'getCharIndex()' method to + get the index of the character the Mark is associated with. + node is not the child of the node insert/remove is called on. + * DrawImage now defaults color model to sRGB_Unpre if the destination + doesn't include alpha. + * The pattern element now shares one rendering tree across all + references. + * Some improvements for Kerning in SVG Font (faster) + * Arabic diacritics are now positioned relative to the right edge + of the base glyph. Bug 28429 + * Basic DocumentType implementation, if present DOMUtilities will + now emit a proper doctype specification + * GVT Tree walker can now be given any node in the GVT tree and it + walk just that subtree. + * Many places now use getResource as Stream instead of Resource + bundles where localization is not wanted/needed. + * Tweaked UpdateManager repaint scheduling alg. + It now tracks when the rendering goes 'out of date' + with the document and runs runnables until it is out of + them or MIN_REPAINT_TIME is exceeded. + * Arc2D now translated to path with elliptical arc commands + in SVGGraphics2D interface. + * JSVGScrollPane now uses bbox of geometry if no viewBox is provided. + * Refactored the text and flow bridges so make things cleaner. + * Implemented textLength to return the value of + getComputedTextLength when the textLength attribute is not + set. + * Potentially large optimization in BBox generation + * The DOM tree viewer now has an option to hide text nodes that + only contain whitespace. + * The DOM tree viewer now includes the id of an element in the + tree view if it has one. + * Improvements to empty bounds handling, should decrease update areas. + * GVT Render requests are now compressed. This helps when doing + live resize of large documents. + * Some refactoring/restructuring of svggen.XmlWriter to potentially + make it a pretty printing DOM serializer. + * Latest pdf-transcoder from FOP which supports '-dpi' switch. + * ScrollPane now should do a better job of fitting document w/o + scrollbars + * title and desc changes are now dynamically tracked. + * ScriptFactorys now loaded via Services interface. + * Made the JDK image loading Mediatracker static + (so others could use it easier). + * ParsedURL now uses the current Batik version as it's default + UserAgent + * Rationalized Text Selection code. Copy to clipboard is now done + by JGVTComponent only if 'unix style' text selection is requested + (default). + +4. Bug Fixes: + + * Fixed all known memory leaks with loading images. + * Changing documents in JSVGScrollPane now works properly. + * Fixed a small memory leak when changing xlink:href on a + use referencing a local element. + * No longer uses Thread.interrupt. On some JVM's this can confuse the + class loader. + * Adding elements in the 'null' namespace nolonger causes a NPE exception. + * Fixed colorspace error in ColorMatrixRed. + * Line element no longer has a fill associated with it. + * Fixed bug #29416 - problem with empty quotes in CSS. + * Fixed bug #34210 - element selectors are now case sensitive + * Index out of bounds error fixed in linear gradient. + * AOI problem in PrintTranscoder now fixed. + * Null Pointer exception when PrintingTranscoding documents + using SVG fonts is fixed (the BridgeContext was being + disposed of too early). + * PrintTranscoder now uses UserAgent to report exceptions + rather than silently swallowing them. + * Fixed some minor bugs in the GlyphLayout code for flow regions. + * Very minor tweaks in JSVGScrollPane. + * Applied patch 28188, fixed tooltip text & title text, thanks Glen + * Applied patch 28487, fixed enabled/disabled state for + toolbar buttons, thanks Glen + * Fixed bug in text selection (programatically selected text wouldn't + clear properly. + * Fixed bug 23035 - Xlink attributes initialized with wrong values. + * Fixed Bug 28785 - 'a' element not clickable with namespace prefix. + * Bug 30584 - Concurrent Modification believed fixed (couldn't get + test case to fail after fix). + * Bug 29891 - Rasterizer problem if w/h == viewBox w/h + * No more 'flicker' when panning a dynamic document. + * CmapFormat4 now clips charCode 0->65534. + * All Object.wait calls are now in while loops to prevent spurious wakeups. + * DOM keypress events will now be generated for so called + Java 'action' keyEvents (previously only keydown/up were + generated). + * Fixed a bug in the PNG Encoder for some 1,2 or 4 bit/pixel images. + * Fixed bug in PackBits TIFF files with multiple IFD's + * The 'debug' messages are now synced with GUI messages. Also they + are localizable. + * Tweaked the way we generate paths to avoid a bug + in the Mac OS X Java implemention where a close + followed by a moveto didn't join the path properly. + * Fixed width/height change onload bug in transcoders submitted + by Simon Mieth. Thanks! + * Fixed a bug with CSS shorthand properties not being set by presentation + attributes. + * DOMImplementations now return empty documents if + qualifiedName in createDocument is null (PR 32108) + * Fixed 'flashing' with JSVGScrollPane. + * Fixed PR: 30923. Text children now respect display and + visibility properties (including dynamic changes). + * Fixed visibility update bug reported by George Armhold. + * Fixed visibility bug on image elements. + * getBBox should now work per the specification. + a) fill="none" will still give bbox + b) It is now the tight bounds of the geometry + c) It does not include the stroke anymore. + d) When called on 'undisplayed' elements returns null (not sure + what the spec really says about this). + * Modification of use element's width/height now works. + * Fixed potential interrupted bug in the RunnableQueue class. + * The document loader cache now uses soft references to avoid + being a memory leak. + * Improved the xml:space support. + * textPath no longer supports 'position attributes' on it's self + * textPath now supports progression position attributes provided + by parent/child tspan/text nodes. + * systemLanguage, requiredFeatures, requiredExtensions now all fail + to match when given an empty string (as specified by the SVG + specification). Bug #33242 (thanks Rick Graham). + * Fixed potential synchronization issues in JavaScript intervals. + * Small optimization in Event dispatch. + * Removed debug print from SVGOMAnimatedPreserveAspectRatio.java + * Synchronization fix in SoftReferenceCache. + * SAXParser now includes 'ignorableWhitespace' when building the + DOM tree. I also tweaked the way text and CDATA sections are + created. + * UpdateManager is now always the 'source' of UpdateManagerEvents + previously in some cases it was an inner class. + * Fix for masks when using Alpha Premultiplied (Mac OS X). + * Improved consistency of events from the RunnableQueue. + Calling suspend/resumeExecution should now always generate + a runHandler event (although the events may be "compressed" + so suspend/resume may only generate one resume event). + * Fixed bug in handling kerning elements with multiple glyph entries + in g/u 1or2. + * Removed use of 'getTagName' to use 'getLocalName' to avoid issues with + prefixed svg elements. + * Fixed a mistake in the generation of SVG fonts that include + arabic forms (PR 33733) + * Fixed handling of complex paint types (base types with + fallbacks). + * Fixed CSS SVG DOM interfaces for complex paint types + (see bug 33923). Added new test for same. + * Text Selection events are now generated even when the + done event is not over a graphics node. + * The double '#' bug is gone in the SVG Pretty Printer. PR 33890 + * The worst of the 'extra spaces' problem with the pretty printer + is solved. + * Fixed updates to SVG Font based text (PR 34041) + * Bug fix in NumberParser (thanks dvholten) + * Fixed bug 34115 - CSSStyleDecl doesn't collapse properties. + * JSVGCanvas no longer holds cached viewBox so it responds + properly when viewBox is updated in SVG content. + +5. Misc: + + Documentation updates + JavaDoc will now reference W3 and JDK docs + Updated MAINTAIN file + Splash/startup screen now embed font (a little simpler SVG as well). + Some Rhino improvements. + New Tests for bugs. + + Thanks to everyone on batik-dev/users for reporting problems and + working on finding solutions. + +1.5 -> 1.5.1 +------------ +1. Security: + + A script security issue was reported in the Batik Squiggle + browser. Squiggle uses the Rhino scripting engine and some features + of that engine can be leveraged by malicious scripts to gain access + to otherwise protected resources (like the file system). + + The Batik team has worked with the Rhino team to fix the isssue + that was reported and the Batik 1.5.1 patch release addresses the + issue. + +2. Features: + + Rhino JavaScript Debugger now integrated with Squiggle. + Better line numbers in error messages. + Zachary DelProposto's Scroll pane class is added. Allows for + scrollbars on SVG documents. + Cool solitaire examples in SVG. + +3. Performance fixes: + + Parents who have children added/removed no longer invalidate + their entire area. + When a element is removed or CSS properties changed all next + siblings are not repainted unless CSS rules change them. + First event dispatch is much quicker than the past. + Switched to Xerces 2.5.0 to improve performance of data protocol. + Changes to paint properties on text is now _much_ faster. + When using many objects from an external file the file will only + be loaded/parsed once. + Modifying x/y and some viewBox changes on SVG elements is now much + faster. + Better JPEG embedding in PDF. + +4. Conformance: + Batik now passes all non SMIL-Animation tests from the SVG Working + Group beSuite. + + @font-face CSS property and font-face elements are now compliant + with SVG specification. + + Changes to the 'class' attribute now update rendering tree + correctly. + + selectSubString now implemented. + + Dynamic modification of display, and marker properties supported. + SVG 'a' element respects 'preventDefault' on event object. + Pattern element no longer applies object bounding box transform + if viewBox is specified. + +5. Bugs: + + Fullscreen mode (F11) works again. + getExtentOfChar() returns bbox in text elements coordinate system. + SVGPoint now supports matrixTransform in more cases + clientX/Y now correct when target is a text element. + Bugfix in parsing some TrueType fonts fixed. + Now applies the 'all' media type to all content. + Image transcoders default to 400x400 rather than issuing an error + (consistent with viewer). + The properties opacity/filter/masking/pointer-events now work + on SVG elements. + Clearing text selection now works + Zero width/height image elements now work properly. + BBox info is correct for zero width/height items. + Fills/strokes text when text-rendering is set to geometricPrecision + rather than using drawGlyphVector. + getCssText() returns the relative version of URI's + SVG Graphics2D outputs correct rendering hints for text. + TextNodes returns the correct bounds. + Proper text child set as 'target' of events. + Events handled correctly for documents that reference the same + image multiple times. + Image are displayed as 'broken links' instead of being an error. + FeColorMatrix now respects color-interpolation-filters property. + elem.style.setProperty now works for shorthand properties. + Fixed race condition in JSVGComponent.set[SVG]Document. + Fixed several memory leaks dealing with use element. + Glyph element's 'd' attribute uses inherited winding-rule. + SVG 'style' element no longer generates multiple 'xml:space' attrs. + SAXDocumentFactory now generates only one CData node for each + CData section in source document. + Memory leak with addEventListener and objects that ref event target fixed. + Click events now allow a small amount of 'slop'. + Fixed bug in rendering with Double Buffering. + Clicking on the Canvas no longer clears the system clipboard. + No longer recascades elements in use tree from foreign documents + Now supports CSS properties with the max negative 32bit int value + Now supports more JPEG image types. + No longer throws a Class Cast exception when using named colors + as the fallback for icc-colors + clearTimeout, clearInterval no longer throw exceptions for null + objects. + clipPath now respects clip-rule when using 'use' element. + + Bug PRs: 12536, 23030, 23038, 23079, 23177, 24919, 25251, 25463 + + +1.5beta5 -> 1.5 +--------------- + +1. Features: + + - With JDK 1.4 text-rendering="optimizeSpeed" will render + non-anti-aliased hinted text (for axially aligned text). + + - The pointer-events property is now handled correctly for elements + without fill or stroke paint. + + - Improved stroke accuracy when shape-rendering="geometricPrecision" + + - JSVGComponent.setSVGDocument with 'null' now releases all + heavy resources and makes the Canvas display only Background. + + - Many memory leaks fixed. + + - Transcoders and JSVGComponent will now accept any Document + and convert to a Batik SVG Document if needed. + + - Script interpreters are loaded lazily. This means that unless you + use them (by having event attributes or script elements) you + don't need any script engines. + + Performance Improvements: + + - Image drawing is now 5-10x faster, for most raster images. + + - Significant performance improvement for patterns that are + filtered or have filters applied to them (take Batik70 for + example). + + - AbstractParentNode insertNode, removeNode, replaceNode are + now much faster for Parents with many children. + + + Library changes: + + - Updated to the Rhino 1.5R41 library + + Others: + + - Added control of floating point precision used in SVGGraphics2D + (see the org.apache.batik.svggen.SVGGeneratorContext class) + + - Batik now almost never opens image URL's twice. + + - JSVGComponent/BridgeContext now has three levels of interactivity. + STATIC, INTERACTIVE, DYNAMIC. With increasing memory overhead + and build time requirements. + + - Improved test environment with automated memory leak, performance, + threading and interactivity tests. There are now over 1000 tests + in the regard regression test suite. + + - Window.parseXML now returns a Document when no 'host' + Document provided. + +2. Bugs: + + See: http://nagoya.apache.org/bugzilla for details on each bug. + + - 6526 pointer-events does not work for fill="none" stroke="none" + - 6683 JSVGCanvas - Problem adding to JScrollPane + - 6951 see samples/tests/spec/paints/linearGradientLine.svg + - 8854 Fix feImage implementation according to latest SVG 1.0/1.1 c + - 9981 Improve Documentation on Scripting with Java + - 9994 text-decoration:underline is incorrect with tspan elements. + - 12013 Squiggle renders jagged curves/paths 12079 transcoder.wmf + - 13870 Language Code errors + - 14011 problem using rasterizer with the headless option + - 14673 not-so-pretty text rendering + - 14788 TranscoderInput(XMLReader reader) does not seem to be implem + - 14789 TranscoderInput(Document document) is incorrect + - 15348 SVGGraphics2D should not export scientific notation on CSS p + - 17168 SVGGraphics2D has package level protected on DOMGroupManager + - 17863 API to get Version info + - 17965 SVGGraphics2D adds 'font-size' attribute to 'line' and 'circ + - 18143 Removing attribute using Element.removeAttributeNode doesn't + - 18566 JSVGComponent packs its parent window + - 18640 Problem with setSVGDocument + - 18840 A few issues with the Batik source + - 18841 Problems with imports in Batik source + - 19017 error when attempting SVG to PDF conversion + - 19363 zero width on rect element causes error + - 19392 Bug in "org.apache.batik.dom.util.DOMUtilities.java" + - 19865 Exception rendering linked PNG file. + - 20147 JSVGCanvas doesn't function with JInternalFrame + - 20201 incorrect gAMA chunk for sRGB + - 20331 bug on batik SVG DOM implementation on the SVGPathSegArcAbs + - 20332 bug on batik SVG DOM implementation on the SVGPathSegCurveto + - 20811 A rect disabled because of zero width or height doesn't get + - 21125 XML comment cause css parser to abort parsing + - 21259 Drawing on an SVGGraphics2D and then using JPEGTranscoder pr + - 21352 XML comments inside script elements treated as script code + - 21358 Dynamic Update of content referenced by a <use> does not wor + - 21361 Bug on SVGPaint implementation + - 21362 Bug on CSSStyleDeclaration on URI reference + - 21374 Implement conformant Java Handler code + - Viewer now properly displays w/h x/y locations in + 'viewbox' coordinates. + - Fixed dirty regions for nodes that change size then + position in the rendering tree (where the new position + has a different rendering transform). + - Fixed handling Fragment URL's with colon's in them. + - Batik no longer considers all @font-face rules a syntax error. + Batik now just ignores them. + - Fixed use elements in Documents with no base url. + - Runs of RTL Text now work with JDK 1.4. + Nested embed and bidi-override properties should now work. + - Fixed bug setting viewBox on outermost SVG element as + described in: + http://koala.ilog.fr/batik/mlists/batik-users/archives/msg03513.html + - JSVGComponent/Canvas now repaints when it changes size + (even when no viewBox). + - Modifying zero W/H rect, circle, ellipse now works properly. + - Fixed the handling of kerning attribute. + - JSVGComponent.setSVGDocument with a Document that has been + previously viewed in the Canvas now works + - 'style' and 'script' elements no longer include the contents + of XML Comments (unless inside a CDATA block). + - Fixed a with absolute x/y attributes in non-text + progression direction. + - Fixed JSVGComponent when it's working threads are + interrupted. + - RhinoInterpreter once again binds the Global Object + as 'window' + + +3. Extensions: + + - Updated multiImage element to match WD. + + +4. Documentation: + + - Updated the FAQ with frequent questions on UpdateManager, DOM + updates and visual updates. + + - Updated the implementation status page and the home page. + + +1.5beta4b -> 1.5beta5 +--------------------- + +1. Features: + + Library changes: + + - Xerces 2.3 is now the default parser. The parser can still be controlled + through the org.apache.batik.util.XMLResourceDescriptor class. + + ** NOTE ** + + While the general performance of the Xerces 2.3 parser seems equivalent + to those of the Crimson parser used previously, there is a notable exception + in the handling of long attributes. This makes a very visible difference + for SVG content that uses embeded images through the 'data:' protocol which + can be extremely slow with Xerces 2.3. The bookOfKells.svgz example, which + used the data: protocol for rather long images has been removed from the + distribution as it does not load in a reasonable amount of time when using + Xerces. + + - Rhino version has been updated from 1.5R3 to 1.5R4 allowing to fix + BR #11968 (DOM access functions should return ECMAScript strings). + + - Removed SAX and DOM sources from the Batik project. Now use xml-apis.jar + from xml-commons. + + Others: + + - currentScale/Translate now implemented (get and set). + + - Implemented getScreenCTM, fixed getCTM (SVGLocatable) + + - onzoom, onscroll, onresize events are now implemented. + + - Integrated pdf-transcoder from FOP. + + - Ctrl-K/L work in fullscreen mode. + + - initial support for SVGList ( provided for SVGPointList in + <polygon> and <polyline>, SVGPathSegList in <path>, SVGLengthList + in textual elements, SVGTransformList in graphical elements ) + + - RFE #12735 : added support for dynamic modifications of 'xlink:href' in image element + + - Now skips reading the SVG DTD unless validation + is turned on (improves load times for small docs). + + - glyph-orientation-horizontal now works. + + - linearGradient's can now be anti-aliased (radial gradient + anti-aliasing also improved). + + - PNG Transcoder can now produce 1,2,4 & 8 bit indexed PNG's. + + - rasterizer can now be used in headless mode (JDK 1.4) + + - JPEG files now have X/YDensity set according to -dpi option. + + - Batik Docs now include a dependency graph for the jar files. + + - In ECMAScript, add the ability to pass an Object instead of a + Function to the Window.getURL() method in which case the + operationComplete method is called once the URL is retrieved. + + - SVGUserAgent now controls the default font-family + + - Added max-width and max-height support in the rasterizer infrastructure + (contribution by Henri Ruini, Hen...@no...) + + - Improvements to the WMFTranscoder by Luan O'Caroll + + - Added better error reporting for external scripts: errors now include the uri + of the external scripts in addition to the line number which is convenient + when an SVG file references multiple external scripts. + + - Modified the way SVG public identifiers are mapped to system identifiers. + The resource file now contains the mapping to the correct SVG DTD instead + of only containing the allowed SVG 1.0 system identifiers for a hard + coded DTD. + + - Added support for cursors. + +Bug Fixes: + + - clientX/Y values in MouseEvents are now returned in screen + pixels (it had been the viewBox coordinate system which was + convenient but wrong and problematic for some cases). + + - Changed default extension for TIFF files to '.tif' from '.tiff'. + + - Fixed bugs in screen updating when the size/location of the + root graphics node changed, and when transform on group + changes after bounds on a child. + + - ToolTips no longer 'hang around' under JDK 1.4.1 + + - The JSVGCanvas no longer steals focus and pops forward whenever + the cursor passes over the canvas. + + - The JSVGCanvas will no longer thrown an exception if an SVG + document is set prior to the component's size being set. + + - Text anchor for vertical text. + + - For corrupt/incomplete JPEG images now shows what it can. + + - Fixed bug with Indexed PNG's that have a bKGD chunk. + + - getRelatedTarget fixed for mouseout event. + + - glyph-orientation-horizontal/vertical no longer require a unit + as per the SVG specification. + + - Fixes for 'jar' protocol. + + - Fixed compressed Tiff writing. + + - Missing Glyph's are now rendered correctly. + + - Text selection now works better with altGlyphs. + + - PrintTranscoder no longer scales 'real world' units wrong. + + - Fixed a bug involving the 'use' element with a width/height in + an SVGFont referenced from external documents. + + - Collaboration with Philipe Converset (Qarbon) on an extension to define + margins in filter regions. This is now supported in the Batik namespace. + +2. Bugs: + + 12389 Focus issue in Squiggle's URL text field + 12121 Cursor in URL field disappears + 12168 MarkerShapePainter delivers wrong PaintedArea + 12239 [PATCH] Moved some method local variables into class + 12954 add support for stroke-width:0 + 15162 PNGTranscoder gives error message about TIFF transcoder + 17167 stroke-dashoffset does not support negative length + 13713 <use> element fails when using percentage values x/y coords + 17183 baseline-shift doesn't refer to parent "line-height" + 15063 Version-dependent code in package org.apache.batik.gvt.font + 12736 Allow non-element nodes to be added to g and svg elements. + + - Added Units resolutions to CSS rects + + - 'd' and 'points' can now be empty on <path>, <polygon> and + <polylines> + + - Now support the transform attribute on the <switch> element + + - Fixed class loader delegation bug in RhinoClassLoader + + - Patch from Keiron Liddle fixing PNGTranscoder KEY_INDEXED hint type + issue (was Boolean instead of Integer) + +3. Extensions: + + - Binary distributions now include jar files that can display + extensions. + + - The multImage element can now reference SVG images as well + as raster images. + + - flowText now supports vertical-align. + + - flowText now uses 'flowRegion' and 'rect' to describe flow + areas. + +4. Documentation: + + - Status of Batik implementation of SVG DOM. + + - Diagram showing the various Batik jar files and their relationships. + + +1.5beta4 -> 1.5beta4b +--------------------- + +This is a patch release fixing a bug on linking. + +1.5beta3 -> 1.5beta4 +-------------------- + +1. Features + + - Squiggle Browser: + + - the F11 key lets users enter the full screen mode or exit the + full screen mode if they are already in that mode. + + - the Browser can now handle XML files which contain a stylesheet + declaration referencing an XSL transformation. If that transformation + generates an SVG document, Squiggle will display it. + + By default, this feature is disabled because it requires that + the user either uses the JDK 1.4 (or greater) version (which at + this time is not a requirement for Batik) or that an XSL transformation + engine (such as Xalan) be in the classpath. + + To enable the feature, uncomment the following line (i.e., remove the '#'): + + #org.apache.batik.apps.svgbrowser.XMLInputHandler + + in the: + + resources/META-INF/services/org.apache.batik.apps.svgbrowser.SquiggleInputHandler + + file. + + - Scripting: + + - Added the ability to use an ECMAScript object providing an handleEvent + method for the listener argument of the addEventListener method on DOM objects + (previously only ECMAScript functions were accepted as parameter). [RFE9149] + +2. Bug Fixes + + - Images - bounds/hints now updated correctly when changed via script + - Local refs now work with null Document URL. + - Double buffered rendering now updates correctly on Mac OS X. + - ParseXML no longer assumes doc is SVG. + - Squiggle can now do Http authentication. + - SVG Font bounds fix + - Text layout fix (anchor and textLength) + - Adding/Removing children no longer invalidates entire parent region. + - handling of position attributes (x,y,dx,dy,rotate) on emtpy tspans has been fixed. + - Fixed improper handling on <altGlyphItem> + - Removed unnecessary font matching with <altGlyph> which can be found + - 'stroke-dasharray' now works with units, + - fixed bugs (CSS !important rules, DOM replaceChild on the root element, + SVG paint parsing, CSS percentages). + + +1.5beta2 -> 1.5beta3 +-------------------- + +1. Features: + + - Squiggle Browser: + + - now keeps a history of recently visited URIs + + - offers more control over the security features + + - Enhanced Security Support: + + - downloading of all external resources can now be + controlled through the UserAgent. This includes + scripting (as before) but also <image>, <use>, and + all elements which may reference external resources + (over 15). + + - users security policy now takes precedence over the + application policy. Users can set the java.security.policy + system property when starting a Batik application and it + will take precedence. + + - Interactivity and Scripting Support Improvements: + + - filter, mask, gradients, clip, pattern and marker are now + updated when the geometry of the referencing graphical + element is dynamically changed. + + - implementation of keyboard events (KeyEvents from DOM Level 2 + Working Draft). In the near future, the batik team will + implement the TextEvents from the DOM Level 3 Events module. + + - Newly supported elements (can now be modified by scripts): + <svg>, <image> and <text> element children (such as <tspan>); + + - Support for addition/removal/modification of stylesheets + + - Misc: + + - external scripts can now be gzipped. + + - added getPixelUnitToMillimeter to UserAgent classes + NOTE: the getPixelToMM and getPixelToMillimeter methods will be + removed after 1.5b3 is released! + + - Improvements in the support for the <flowText> extension + + - Added support for attribute/id/adjacent selector and :first-child + dynamic updates, + +2. Bug Fixing: + + - #1075, #4834, #5233, #5347, #5806, #6642, #6683, #7053,#8330, #9740, + #9058, #9067, #9304, #9429, #9520, #9779, #9804, #9272, #9276, + - bug in feColorMatrix + - DOM: getElementByTagName, invalidateElementsByTagName, cloneNode(false) + - mouseout bug on <tspan> fixed + - File->Open dialog bug on JDK 1.4 fixed. + - Memory leak fixes + - ttf2svg now emits kern elements with the proper sign + - MultiImage now respects xml:base + - Fixed mouse location bug + +3. Documentation Update: + + - Many additional links have been added to the Batik documentation + as well as improvements in its structure and content, thanks to + the work of Robert Di Blasi. + +1.5beta1 -> 1.5beta2 +-------------------- + +** Note on the new security support ** + +- Scripts are now run in a sand-box by default for the Batik sample + applications (the Squiggle SVG Browser and the Rasterizer). Users of + the SVG toolkit who what to run scripts securely need to add + security support in their application and may use the work done for + Squiggle as an example + (e.g., see the org.apache.batik.util.ApplicationSecurityEnforcer class). + +- There is a known limitiation: scripts loaded from a 'file:' url + cannot access (i.e., load files) under the same root. This is not + true for scripts loaded from a server (e.g., 'http:' urls). + +1. Features: + + - Scripting support for styling properties: + + - Most of the CSS properties and style attributes can now + be changed dynad:/work/dev/svg/apache/builds/batik-1.5beta3/mically. See: + http://xml.apache.org/batik/supportedProperties.html + + - Added support for style and class attributes dynamic updates + + + - DOM support: + + - Implementation of SVGLocatable including SVGMatrix + + - All class members of type: SVGLength now works on most of the + graphical elements (rect.x.baseVal.value) + + - Implementation of CSS DOM (getStyle, getComputedStyle...) + + + - Events/Interactivity: + - DOMFocusIn, DOMFocusOut and DOMActivate event types are not supported + + + - Security: + + - Secure scripting is now in place. Scripts in ECMAScript or + Java code are run in a sand-box by default. The Batik browser + (called Squiggle), has the following security options: + . secure execution of scripts can be on or off. + . scripts for a given language can be disabled/enabled. + . scripts can be constrained to come from the same origin + as the document referencing them. + In the Squiggle SVG browser, the security options can be set + through the Preferences dialog, in the browser options panel. + + + - Misc: + + - xml:base is now supported for the image element. + + - <flowText> extension element that flows text into multiple boxes. + Trying to track the SVG 1.1 Working Group on this element. + + - getURL, parseXML supported in the Window object. + + + - Testing: + + - Improved test infrastructure. There are new tests for handling + automatic regression testing of scripting features and there are + more tests (801 now) in the regard regression test suite. + + +2. Bug Fixing: + + - Fixed bugs with textPath w/ text-anchor, and textPath w/ multiple + trailing tspan elements. + + - Work around for RenderingHints when Batik Jars loaded multiple times + in the same JVM (through different class loaders). + + - Fixed a bug with X/Y Resolution for Tiff. + + - UIEvents are not dispatched properly on <text> children (<tspan>...) + + - <a> is now supported on <text> element children + +1.1.1 -> 1.5beta1 +----------------- + +** Note on enhanced scripting support ** + +- Support for DOM Core and DOM Events (Mutation events and UI events) + +- Limitations: + - No support for dynamic modification of CSS properties. + In particular, setAttributeNS of presentation attributes + such as 'fill' or 'stroke' or modification of the 'style' + attribute are not supported. + +1. Features: + - Enhanced scripting support: it is now possible to modify + SVG documents through scripting + - Tiff Transcoder now takes FORCE_TRANSPARENT_WHITE hint. + - Tiff Transcoder now writes resolution tags. + - Implementation of SVG 1.1 solidColor element (in Batik extensions) + - Implementation of multiImage element (a Batik extension). + - Event compression mecanism (e.g., concatenates mouseMove events) + +2. Bug Fixing + + - textLength now works in all cases except nested textLengths. + - 'image' element now respects xml:base. + - Renderer now reuses image buffers more often. + - Speed improvements in cases with lots of tspans. + - Filtered Raster Images now _much_ faster. + - Things mostly work with current Mac OS X JVM (still some trouble with + images/filters). + - Applying a ICC Profile no longer messes up alpha channel in some cases. + - PNG Transcoder now always writes sRGB chunk. + - feImage image positioning fix + - <use> bridge fix, + - SVG generator <use> export fix + - +1.1 -> 1.1.1 Release +-------------------- + +1. Bug fixing: + + - dx/x and dy/y now work when combined. + - clip-path now takes transforms into account + - AbstractRable constructors problem fixed. + - Put in workaround for worst of Mac OS X text problems (layout + still isn't 100% correct in most cases). + - Removed code that is no longer needed in GlyphLayout + - Fixed the last text layout issues on Mac OS X (GlyphVector was + returning the metrics for the first char for all chars in the vector. + We now use the difference in defaultGlyphPositions to get the + character advances). + - Fixed JViewerFrame issue with large (width/height) documents. + +2. Improvements + - Text bounds computation is now much faster + +1.1rc4 -> 1.1 Release +---------------------- + +1. Bug Fixing and Improvements + + - Code factorization in parsers. + - Parsers bug fixing. + - Added examples (maps, bookOfKells example, sunRise, mathMetal). + Maps are a contribution of Andreas Neumann, + MathMetal is a contribution of Christophe Held. + - Added default xmlns and xmlns:xlink on root <svg> in generator + - Integrated Ant task contribution from Henri Ruini + - Improved error dialog (now includes details with the error stack trace). + - Printing fix. + - text-anchor fix. + +1.1rc3 -> 1.1rc4 Release +------------------------ + +1. Features: + + - rewrite of rasterizer thanks to Henri Ruini's contribution + - improved image handling strategies in the SVG generator thanks + to Paul Evenblij's contribution. + - 'requiredFeatures', 'requiredExtensions' and 'systemLanguage' on + graphical elements + - anchor on raster images and SVG images now works properly + - anchor inside a SVG image now works properly + - <a> inside <text> or <tspan> is now displayed + - many tests added (transcoder...) + - SVG viewer: added dialog box at start up time while loading classes + - SVG viewer: limited number of files in history + +2. Bug fixing: + + - memory leak fix + - DOM core serialization + - Parsing of CSS comments + - SVG generator fixes (bug 4945 and 4389) + - rasterizer fixes + - text now works with JDK 1.4b3. Remaining issue with + BufferedImages. + +3. Improvements: + + - general performance improvements in the build and rendering + phases of the viewing component (for example float parsing + has been improved). + +1.1rc2 -> 1.1rc3 Release +------------------------ + +1. Features: + - Support for xml:base + - TextSearch dialog is available (with a zoom option) + - Full support for Alternate Stylesheets + - Full support for CSS Media (including a way to define custom media) + - Changed Text Selection UI. (selectable in the preference dialog) + Added Text Selection API to GVT & swing packages + - KeyStroke on the JSVGCanvas (for pan and zoom using keyboard) + - SVG Font: The font lookup now takes into account namespaces + - Provide a way to set the quality of an exported JPEG image + - Printing now uses the CSS print medium + - More complete handling of partial URLs + - Two new extensions solidColor (a single color 'paint server' acts + similar to the gradients and pattern fills/stroke), & paintSwitch + similar to a switch element but children are paint servers instead + of graphical elements. + +2. Bug fixes: + - Fix in gradient element boundary conditions + - Fix and performance improvements in lighting filters + - Fix in PNG encoding for BufferedImage' subimages. + - feDisplacementMap fix (array out of bound exception) + - font lookup now uses namespace properly + - 'enable-background' now work on <svg> element + - zero length on <rect>, <circle> and <ellipse> disable the rendering + - linear gradient with x1=y1=x2=y2 + - printing now supports SVG URI fragment + - Javadoc improvements and clean-up + - Source clean-up + - DOM: getElementsByTagNameNS now works properly + - SVGDOM: huge cleanup of the implementation + (preparation for dynamic features) + - CSS parser bug fix + - Bridge: 'overflow' on SVG <image> should now work properly + - GVT: cleanup the API - GraphicsNodeRenderContext is now obsolete + + +3. Testing + + - Reorganized tests (see samples/tests subdirectory) + - Improved test reporting (i.e., better HTML report) + - Simplified test infrastructure configuration files. + - Lots of new tests (see samples/tests/structure/styling and + samples/tests/spec/structure for examples) and + samples/batikCandy.svg. + + +1.1rc1 -> 1.1rc2 Release +------------------------ + +1. Bug fixes: + + - 'preserveAspectRatio' now works properly on both raster and SVG images + - bug fix with the 'clip' property on <symbol>, <image>, <marker> + - thumbnail bug fix (sometimes the area of interest became hidden) + - filename filter added to the file selection dialog in the svgbrowser when + exporting as PNG and JPG + - Infinite loop removed. Elliptical arc may cause an infinite loop if the end + point of the arc was the same than current point in the <path> datas. + - SVGGraphics2D can now generates SVG Font on demand + +2. Improvements: + + - Added new custom filter extension (look at the samples/extensions/histogramNormalization.svg) + - Added tooltips on <title> and <desc>. + +1.0 -> 1.1rc1 Release +--------------------- + +1. Enhancements: + a. HTTP headers fields (useragent/accepted...) now implemented. + b. Anti-aliased gradients (when color-rendering set to quality). + c. Small patterns are now much faster + d. Ability to flush cached image data. + e. full horizontal and vertical kerning now implemented for SVG fonts + f. added support for orientation and lang <glyph> attributes + g. improved support for Arabic text, includes handling of Arabic shaping + and ligatures for both SVG and system fonts + h. improved text selection + i. improved text rendering speed + +2. Bug fixes: + a. PNG files now use the proper gamma when reading/writing + b. Off by one bug... [truncated message content] |
From: <ev...@us...> - 2011-04-26 19:41:37
|
Revision: 1530 http://rails.svn.sourceforge.net/rails/?rev=1530&view=rev Author: evos Date: 2011-04-26 19:41:31 +0000 (Tue, 26 Apr 2011) Log Message: ----------- Implemented game end after share price has maxed out (for 18GA) Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/data/18GA/Game.xml trunk/18xx/rails/game/Bank.java trunk/18xx/rails/game/GameManager.java trunk/18xx/rails/game/GameManagerI.java trunk/18xx/rails/game/StockMarket.java trunk/18xx/rails/game/StockMarketI.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/LocalisedText.properties 2011-04-26 19:41:31 UTC (rev 1530) @@ -42,8 +42,8 @@ BuyPrivatePrompt={0} from {1} for {2}...{3} BankIsBrokenDisplayText=Bank is broken. Play continues until {0} BankIsBrokenReportText=Bank is broken -bankIsBrokenPlaySetOfORs=the current set of operating rounds is finished. -bankIsBrokenPlayOnlyOR=the current operating round is finished. +gameOverPlaySetOfORs=the current set of operating rounds is finished. +gameOverPlayOnlyOR=the current operating round is finished. BankHas=The Bank has {0}. BankSizeIs=Bank size is {0} BaseTokenSlotIsReserved=Base token slot is reserved @@ -363,6 +363,8 @@ MapWindowTitle=Rails: Map MapWindowORTitle=Rails: Map, Operating Round {0} ({1} of {2}) MARKET=Stock Market +MaxedSharePriceDisplayText={0} share price has maxed at {1}. Play continues until {2} +MaxedSharePriceReportText={0} share price has maxed at {1} MayDiscardTrain={0} may voluntarily discard a train MayNotBuyAndSell={0} may not both buy and sell shares MayNotYetOperate={0} may not yet operate: {1}% sold whereas {2}% required Modified: trunk/18xx/data/18GA/Game.xml =================================================================== --- trunk/18xx/data/18GA/Game.xml 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/data/18GA/Game.xml 2011-04-26 19:41:31 UTC (rev 1530) @@ -15,7 +15,8 @@ <Bankruptcy/> <BankBreaks limit="0" finish="currentOR"/> <!-- "Runs out"; when "broken", -1 is the limit --> - <!-- Also when the share value reaches $300; this is configured in the stock market XML --> + <!-- Also when the share value reaches $300; this is configured in the stock market XML, + but uses the 'finish' attribute value defined above. --> </EndOfGame> </Component> <Component name="PlayerManager" class="rails.game.PlayerManager"> Modified: trunk/18xx/rails/game/Bank.java =================================================================== --- trunk/18xx/rails/game/Bank.java 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/rails/game/Bank.java 2011-04-26 19:41:31 UTC (rev 1530) @@ -31,8 +31,6 @@ /** Is the bank broken (remains true once set) */ private BooleanState broken = new BooleanState("Bank.broken", false); - // /** Is the bank just broken (returns true exactly once) */ - // private BooleanState brokenReported = new BooleanState("Bank.brokenReported", false); /** * The money format template. '@' is replaced by the numeric amount, the @@ -151,16 +149,6 @@ } } - public boolean isBroken() { - return broken.booleanValue(); - } - - // public boolean isJustBroken() { - // boolean result = broken.booleanValue() && !brokenReported.booleanValue(); - // brokenReported.set(true); - // return result; - // } - /** * @return Portfolio of stock in Bank Pool */ Modified: trunk/18xx/rails/game/GameManager.java =================================================================== --- trunk/18xx/rails/game/GameManager.java 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/rails/game/GameManager.java 2011-04-26 19:41:31 UTC (rev 1530) @@ -118,6 +118,9 @@ new IntegerState("RelativeORNumber"); protected IntegerState numOfORs = new IntegerState("numOfORs"); + /** GameOver pending, a last OR or set of ORs must still be completed */ + protected BooleanState gameOverPending = new BooleanState ("GameOverPending", false); + /** GameOver is executed, no more moves */ protected BooleanState gameOver = new BooleanState("GameOver" ,false); protected Boolean gameOverReportedUI = false; protected BooleanState endedByBankruptcy = new BooleanState("EndedByBankruptcy", false); @@ -415,9 +418,9 @@ bankBreaksTag.getAttributeAsInteger("limit", gameEndsWhenBankHasLessOrEqual); String attr = bankBreaksTag.getAttributeAsString("finish"); - if (attr.equalsIgnoreCase("SetOfORs")) { + if (attr.equalsIgnoreCase("setOfORs")) { gameEndsAfterSetOfORs = true; - } else if (attr.equalsIgnoreCase("CurrentOR")) { + } else if (attr.equalsIgnoreCase("currentOR")) { gameEndsAfterSetOfORs = false; } } @@ -645,7 +648,7 @@ startOperatingRound(true); } else if (round instanceof OperatingRound) { - if (bank.isBroken() && !gameEndsAfterSetOfORs) { + if (gameOverPending.booleanValue() && !gameEndsAfterSetOfORs) { finishGame(); @@ -655,7 +658,7 @@ } else if (startPacket != null && !startPacket.areAllSold()) { startStartRound(); } else { - if (bank.isBroken() && gameEndsAfterSetOfORs) { + if (gameOverPending.booleanValue() && gameEndsAfterSetOfORs) { finishGame(); } else { ((OperatingRound)round).checkForeignSales(); @@ -1331,17 +1334,36 @@ public void registerBrokenBank(){ + gameOverPending.set(true); ReportBuffer.add(LocalText.getText("BankIsBrokenReportText")); String msgContinue; if (gameEndsAfterSetOfORs) - msgContinue = LocalText.getText("bankIsBrokenPlaySetOfORs"); + msgContinue = LocalText.getText("gameOverPlaySetOfORs"); else - msgContinue = LocalText.getText("bankIsBrokenPlayOnlyOR"); + msgContinue = LocalText.getText("gameOverPlayOnlyOR"); String msg = LocalText.getText("BankIsBrokenDisplayText", msgContinue); DisplayBuffer.add(msg); addToNextPlayerMessages(msg, true); } + public void registerMaxedSharePrice(PublicCompanyI company, StockSpaceI space){ + gameOverPending.set(true); + ReportBuffer.add(LocalText.getText("MaxedSharePriceReportText", + company.getName(), + Bank.format(space.getPrice()))); + String msgContinue; + if (gameEndsAfterSetOfORs) + msgContinue = LocalText.getText("gameOverPlaySetOfORs"); + else + msgContinue = LocalText.getText("gameOverPlayOnlyOR"); + String msg = LocalText.getText("MaxedSharePriceDisplayText", + company.getName(), + Bank.format(space.getPrice()), + msgContinue); + DisplayBuffer.add(msg); + addToNextPlayerMessages(msg, true); + } + private void finishGame() { gameOver.set(true); Modified: trunk/18xx/rails/game/GameManagerI.java =================================================================== --- trunk/18xx/rails/game/GameManagerI.java 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/rails/game/GameManagerI.java 2011-04-26 19:41:31 UTC (rev 1530) @@ -67,7 +67,8 @@ public abstract void registerBankruptcy(); public abstract void registerBrokenBank(); - + public void registerMaxedSharePrice(PublicCompanyI company, StockSpaceI space); + public boolean isDynamicOperatingOrder(); /** Modified: trunk/18xx/rails/game/StockMarket.java =================================================================== --- trunk/18xx/rails/game/StockMarket.java 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/rails/game/StockMarket.java 2011-04-26 19:41:31 UTC (rev 1530) @@ -4,6 +4,7 @@ import java.util.*; import rails.game.move.PriceTokenMove; +import rails.game.state.BooleanState; import rails.util.LocalText; import rails.util.Tag; @@ -20,6 +21,8 @@ protected ArrayList<StockSpaceI> startSpaces = new ArrayList<StockSpaceI>(); protected int[] startPrices; protected StockSpaceTypeI defaultType; + + GameManagerI gameManager; /* Game-specific flags */ protected boolean upOrDownRight = false; /* @@ -28,10 +31,8 @@ */ /* States */ - protected boolean gameOver = false; /* - * Some games have "rails.game over" - * stockmarket squares - */ + /** GameOver becomes true if a stock market square is reached that is marked as such */ + protected BooleanState gameOver = new BooleanState ("GameOver", false); ArrayList<PublicCertificate> ipoPile; @@ -155,7 +156,9 @@ */ public void finishConfiguration (GameManagerI gameManager) { - for (PublicCompanyI comp : GameManager.getInstance().getCompanyManager().getAllPublicCompanies()) { + this.gameManager = gameManager; + + for (PublicCompanyI comp : gameManager.getCompanyManager().getAllPublicCompanies()) { if (!comp.hasStarted() && comp.getStartSpace() != null) { comp.getStartSpace().addFixedStartPrice(comp); } @@ -302,7 +305,7 @@ /* Check for rails.game closure */ if (to.endsGame()) { ReportBuffer.add(LocalText.getText("GAME_OVER")); - gameOver = true; + gameManager.registerMaxedSharePrice(company, to); } } @@ -347,13 +350,6 @@ return null; } - /** - * @return - */ - public boolean isGameOver() { - return gameOver; - } - public PublicCertificate removeShareFromPile(PublicCertificate stock) { if (ipoPile.contains(stock)) { int index = ipoPile.lastIndexOf(stock); Modified: trunk/18xx/rails/game/StockMarketI.java =================================================================== --- trunk/18xx/rails/game/StockMarketI.java 2011-04-26 15:15:37 UTC (rev 1529) +++ trunk/18xx/rails/game/StockMarketI.java 2011-04-26 19:41:31 UTC (rev 1530) @@ -41,8 +41,6 @@ public StockSpaceI getStartSpace(int price); - public boolean isGameOver(); - public void processMove(PublicCompanyI company, StockSpaceI from, StockSpaceI to); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-27 22:45:41
|
Revision: 1537 http://rails.svn.sourceforge.net/rails/?rev=1537&view=rev Author: evos Date: 2011-04-27 22:45:34 +0000 (Wed, 27 Apr 2011) Log Message: ----------- Added 1830 Reading variant XML files (contribution from Scott Petersen) Modified Paths: -------------- trunk/18xx/data/1830/CompanyManager.xml trunk/18xx/data/1830/Game.xml trunk/18xx/data/1830/Map.xml trunk/18xx/data/1830/TileSet.xml trunk/18xx/data/1830/Tiles.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/util/MakeGameTileSets.java trunk/18xx/tiles/TileDictionary.18t trunk/18xx/tiles/TileDictionary.xml trunk/18xx/tiles/Tiles.xml Added Paths: ----------- trunk/18xx/tiles/svg/tile-30006.svg trunk/18xx/tiles/svg/tile-30007.svg Modified: trunk/18xx/data/1830/CompanyManager.xml =================================================================== --- trunk/18xx/data/1830/CompanyManager.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/1830/CompanyManager.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -123,6 +123,14 @@ <Home hex="L16" city="0" allCitiesBlocked="yes" /> </Company> </IfOption> + <IfOption name="Variant" value="Reading"> + <Company name="RDG" type="Public" tokens="2" fgColour="000000" bgColour="C8F526" + longname="Reading Railroad"> + <Home hex="H14"/> + <Certificate type="President" shares="3"/> + <Certificate shares="1" number="7"/> + </Company> + </IfOption> <StartPacket roundClass="rails.game.StartRound_1830"> <Bidding initial="5" minimum="5" increment="1"/> @@ -131,7 +139,12 @@ <Item name="D&H" type="Private" basePrice="70"/> <Item name="M&H" type="Private" basePrice="110"/> <Item name="C&A" type="Private" basePrice="160"> + <IfOption name="C&ACertificate(ReadingOnly)" value="PRR"> <SubItem name="PRR" type="Public" /> + </IfOption> + <IfOption name="C&ACertificate(ReadingOnly)" value="RDG"> + <SubItem name="RDG" type="Public" /> + </IfOption> </Item> <Item name="B&O" type="Private" basePrice="220"> <SubItem name="B&O" type="Public" president="yes"/> Modified: trunk/18xx/data/1830/Game.xml =================================================================== --- trunk/18xx/data/1830/Game.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/1830/Game.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -15,7 +15,7 @@ <!-- The options in Game.xml are not currently used. See GamesList.xml for the real ones. --> - <GameOption name="Variant" values="Basegame,Pere Marquette,Coalfields" default="Basegame" /> + <GameOption name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading" 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" /> @@ -26,6 +26,8 @@ <GameOption name="LeaveAuctionOnPass" type="toggle" default="no"/> <GameOption name="TwoPlayersCertLimit70Percent" type="toggle" default="yes"/> <GameOption name="SeparateSalesAtSamePrice" type="toggle" default="yes"/> + <GameOption name="C&ACertificate(ReadingOnly)" values="PRR,RDG" default="PRR"/> + <GameParameters> <PlayerShareLimit percentage="60"> <!-- Option "NumberOfPlayers" is automatically set @@ -48,7 +50,7 @@ </EndOfGame> </Component> <Component name="PlayerManager" class="rails.game.PlayerManager"> - <IfOption name="Variant" value="Basegame,"> + <IfOption name="Variant" value="Basegame"> <Players number="2" cash="1200" certLimit="28"/> <Players number="3" cash="800" certLimit="20"/> <Players number="4" cash="600" certLimit="16"/> @@ -71,6 +73,13 @@ <Players number="6" cash="400" certLimit="12"/> <Players number="7" cash="360" certLimit="11"/> </IfOption> + <IfOption name="Variant" value="Reading"> + <Players number="2" cash="1200" certLimit="29"/> + <Players number="3" cash="800" certLimit="21"/> + <Players number="4" cash="600" certLimit="17"/> + <Players number="5" cash="480" certLimit="14"/> + <Players number="6" cash="400" certLimit="12"/> + </IfOption> </Component> <Component name="Bank" class="rails.game.Bank"> <Bank amount="12000"/> @@ -100,18 +109,18 @@ --> </Defaults> <Train name="2" majorStops="2" cost="80" amount="6"> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Attributes obsoleting="yes"/> </IfOption> </Train> <Train name="3" majorStops="3" cost="180" amount="5" startPhase="3"> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Attributes obsoleting="yes"/> </IfOption> </Train> <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4" rustedTrain="2"> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Attributes obsoleting="yes" amount="5"/> </IfOption> </Train> @@ -124,11 +133,11 @@ <IfOption name="WithOptional6Train" value="no"> <Attributes amount="2"/> </IfOption> - <IfOption name="Variant" value="Pere Marquette,Coalfields"> + <IfOption name="Variant" value="Pere Marquette,Coalfields,Reading"> <Attributes amount="3" releasedTrain="7,D"/> </IfOption> </Train> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Train name="7" majorStops="7" cost="710" amount="2"/> </IfOption> <Train name="D" majorStops="99" startPhase="D" rustedTrain="4"> @@ -136,7 +145,7 @@ <Attributes cost="1100"/> <Exchange cost="800"/> </IfOption> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Attributes cost="900"/> <Exchange cost="750"/> </IfOption> Modified: trunk/18xx/data/1830/Map.xml =================================================================== --- trunk/18xx/data/1830/Map.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/1830/Map.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -35,7 +35,7 @@ <IfOption name="Variant" value="Basegame,Pere Marquette"> <Hex name="D24" tile="-7" orientation="2"/> </IfOption> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Hex name="D24" tile="-30001"/> </IfOption> <Hex name="E3" tile="0"/> @@ -49,7 +49,7 @@ <Hex name="E19" tile="-10"/> <Hex name="E21" tile="0" cost="120"/> <Hex name="E23" tile="-11" orientation="5" label="B" city="Boston"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="F2" tile="-903" orientation="5" value="40,70" city="Chicago"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -63,7 +63,7 @@ <Hex name="F14" tile="0"/> <Hex name="F16" tile="-10" cost="120"/> <Hex name="F18" tile="0"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="F20" tile="-2"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -88,13 +88,19 @@ <IfOption name="Variant" value="Basegame,Pere Marquette"> <Hex name="H12" tile="-101" city="Altoona"/> </IfOption> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Hex name="H12" tile="-30003" pic="-30002" city="Altoona"/> </IfOption> - <Hex name="H14" tile="0"/> + <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields"> + <Hex name="H14" tile="0"/> + </IfOption> + <IfOption name="Variant" value="Reading"> + <Hex name="H14" tile="-30007" pic="-30006" city="Reading"/> + </IfOption> + <Hex name="H16" tile="-10"/> <Hex name="H18" tile="-20" label="OO"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="I1" tile="-901" orientation="5" value="30,60" city="Gulf"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -109,7 +115,7 @@ <Hex name="I15" tile="-11" label="B" city="Baltimore"/> <Hex name="I17" tile="0" cost="80"/> <Hex name="I19" tile="-3" orientation="2"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="J2" tile="-902" orientation="5" value="30,60" city="Gulf"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -125,6 +131,10 @@ <Hex name="K13" tile="-902" orientation="4" value="30,40" city="Deep South"/> <Hex name="K15" tile="-104" orientation="3"/> </IfOption> + <IfOption name="Variant" value="Reading"> + <Hex name="K13" tile="-903" orientation="4" value="30,40" city="Deep South"/> + <Hex name="K15" tile="-30005" value="20" city="Norfolk"/> + </IfOption> <IfOption name="Variant" value="Coalfields"> <Hex name="K1" tile="-908"/> <Hex name="K3" tile="-10" city="Lexington"/> Modified: trunk/18xx/data/1830/TileSet.xml =================================================================== --- trunk/18xx/data/1830/TileSet.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/1830/TileSet.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -19,7 +19,7 @@ <IfOption name="Variant" value="Basegame,Pere Marquette"> <Upgrade id="53"/> </IfOption> - <IfOption name="Variant" value="Coalfields"> + <IfOption name="Variant" value="Coalfields,Reading"> <Upgrade id="2053"/> </IfOption> </Tile> @@ -44,6 +44,7 @@ <Tile id="-30003" pic="-30002"/><!-- Coalfields: Altoona --> <Tile id="-30004"/><!-- Coalfields: Coalfields --> <Tile id="-30005"/><!-- Coalfields: Norfolk --> + <Tile id="-30007" pic="-30006"/><!-- Reading: Reading--> <!-- Yellow tiles --> <Tile id="1" quantity="1"> @@ -78,7 +79,7 @@ </IfOption> </Tile> <Tile id="57"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Attributes quantity="4"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -95,7 +96,7 @@ <!-- Green tiles --> <Tile id="14"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Attributes quantity="3"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -104,7 +105,7 @@ <Upgrade id="63" /> </Tile> <Tile id="15" quantity="2"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Attributes quantity="2"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -150,6 +151,11 @@ <Upgrade id="61" /> </Tile> </IfOption> + <IfOption name="Variant" value="Reading"> + <Tile id="2053" quantity="2" > + <Upgrade id="1061"/> + </Tile> + </IfOption> <IfOption name="Variant" value="Coalfields"> <Tile id="2053" extId="53" quantity="2"> <Upgrade id="1061" hex="E23" /> @@ -157,7 +163,7 @@ </Tile> </IfOption> <Tile id="54" quantity="1"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Upgrade id="62" /> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -181,18 +187,21 @@ <IfOption name="Variant" value="Basegame,Pere Marquette"> <Tile id="61" quantity="2" /> </IfOption> + <IfOption name="Variant" value="Reading"> + <Tile id="1061" quantity="2" /> + </IfOption> <IfOption name="Variant" value="Coalfields"> <Tile id="1061" extId="61" quantity="1" /> <Tile id="2061" extId="BA" quantity="1" /> </IfOption> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Tile id="62" quantity="1" /> </IfOption> <IfOption name="Variant" value="Coalfields"> <Tile id="1062" extId="62" quantity="1" /> </IfOption> <Tile id="63"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Attributes quantity="3"/> </IfOption> <IfOption name="Variant" value="Coalfields"> @@ -208,4 +217,4 @@ <IfOption name="Variant" value="Coalfields"> <Tile id="1717" extId="G17" quantity="1" /> </IfOption> -</TileManager> +</TileManager> \ No newline at end of file Modified: trunk/18xx/data/1830/Tiles.xml =================================================================== --- trunk/18xx/data/1830/Tiles.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/1830/Tiles.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -119,6 +119,17 @@ <Track from="city1" gauge="normal" to="side4"/> <Track from="city1" gauge="normal" to="side5"/> </Tile> + <Tile colour="fixed" id="-30007" name="Reading intern"> + <Station id="city1" position="052" slots="1" type="City" value="10"/> + <Track from="side4" gauge="normal" to="side1"/> + <Track from="side4" gauge="normal" to="side2"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side3" gauge="normal" to="side2"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side1" gauge="normal" to="city1"/> + <Track from="side2" gauge="normal" to="city1"/> + </Tile> <Tile colour="yellow" id="1" name="1"> <Station id="city1" position="408" type="Town" value="10"/> <Station id="city2" position="108" type="Town" value="10"/> Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/data/GamesList.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -28,7 +28,7 @@ - optionally, a default value (only affects a toggle; in a dropdown the first item is always the default). --> - <Option name="Variant" values="Basegame,Pere Marquette,Coalfields" default="Basegame" /> + <Option name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading" 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" /> @@ -37,6 +37,7 @@ <Option name="UnlimitedTiles" type="toggle" default="no"/> <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="no"/> + <Option name="C&ACertificate(ReadingOnly)" values="PRR,RDG" default="PRR" ></Option> <Option name="SeparateSalesAtSamePrice" type="toggle" default="yes"/> <Players minimum="2" maximum="6"/> </Game> Modified: trunk/18xx/rails/util/MakeGameTileSets.java =================================================================== --- trunk/18xx/rails/util/MakeGameTileSets.java 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/rails/util/MakeGameTileSets.java 2011-04-27 22:45:34 UTC (rev 1537) @@ -120,11 +120,14 @@ for (int i = 0; i < tiles.getLength(); i++) { tileName = ((Element) tiles.item(i)).getAttribute("id"); - System.out.println("Tile "+tileName); // Save the tile in a Map so that we can check completeness // later. + // If we already have it, skip + if (tilesInSet.containsKey(tileName)) continue; tilesInSet.put(tileName, null); + System.out.println("Tile "+tileName); + // Get the Tile specification Element tileSpec = (Element) tileMap.get(tileName); if (tileSpec != null) { Modified: trunk/18xx/tiles/TileDictionary.18t =================================================================== (Binary files differ) Modified: trunk/18xx/tiles/TileDictionary.xml =================================================================== --- trunk/18xx/tiles/TileDictionary.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/tiles/TileDictionary.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -23527,4 +23527,100 @@ </connection> </connections> </tile> + <tile> + <ID>-30006</ID> + <shape>tsHexagon</shape> + <level>tlMapFixed</level> + <name>Reading</name> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tp2CornerA</position> + <revenue> + <value>10</value> + <position>tp3CornerB</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideE</position1> + <position2>tp4SideB</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideE</position1> + <position2>tp4SideC</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideB</position1> + <position2>tp4SideD</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideD</position1> + <position2>tp4SideC</position2> + </connection> + </connections> + </tile> + <tile> + <ID>-30007</ID> + <shape>tsHexagon</shape> + <level>tlMapFixed</level> + <name>Reading intern</name> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tp2CornerA</position> + <revenue> + <value>10</value> + <position>tp3CornerB</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideE</position1> + <position2>tp4SideB</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideE</position1> + <position2>tp4SideC</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideB</position1> + <position2>tp4SideD</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideD</position1> + <position2>tp4SideC</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideE</position1> + <position2>tp2CornerA</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideD</position1> + <position2>tp2CornerA</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideB</position1> + <position2>tp2CornerA</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp4SideC</position1> + <position2>tp2CornerA</position2> + </connection> + </connections> + </tile> </tiles> \ No newline at end of file Modified: trunk/18xx/tiles/Tiles.xml =================================================================== --- trunk/18xx/tiles/Tiles.xml 2011-04-27 19:58:09 UTC (rev 1536) +++ trunk/18xx/tiles/Tiles.xml 2011-04-27 22:45:34 UTC (rev 1537) @@ -4128,4 +4128,22 @@ <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side4"/> </Tile> + <Tile colour="fixed" id="-30006" name="Reading"> + <Station id="city1" position="052" slots="1" type="City" value="10"/> + <Track from="side4" gauge="normal" to="side1"/> + <Track from="side4" gauge="normal" to="side2"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side3" gauge="normal" to="side2"/> + </Tile> + <Tile colour="fixed" id="-30007" name="Reading intern"> + <Station id="city1" position="052" slots="1" type="City" value="10"/> + <Track from="side4" gauge="normal" to="side1"/> + <Track from="side4" gauge="normal" to="side2"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side3" gauge="normal" to="side2"/> + <Track from="side4" gauge="normal" to="city1"/> + <Track from="side3" gauge="normal" to="city1"/> + <Track from="side1" gauge="normal" to="city1"/> + <Track from="side2" gauge="normal" to="city1"/> + </Tile> </Tiles> \ No newline at end of file Added: trunk/18xx/tiles/svg/tile-30006.svg =================================================================== --- trunk/18xx/tiles/svg/tile-30006.svg (rev 0) +++ trunk/18xx/tiles/svg/tile-30006.svg 2011-04-27 22:45:34 UTC (rev 1537) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#C0C0C0" stroke="#C0C0C0" stroke-width="1" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 49,255 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 294,294 0 0,0 49,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,0 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 49,255 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 294,294 0 0,0 49,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,0 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="269" cy="43" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="269" y="43" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">10</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> Added: trunk/18xx/tiles/svg/tile-30007.svg =================================================================== --- trunk/18xx/tiles/svg/tile-30007.svg (rev 0) +++ trunk/18xx/tiles/svg/tile-30007.svg 2011-04-27 22:45:34 UTC (rev 1537) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#C0C0C0" stroke="#C0C0C0" stroke-width="1" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 49,255 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 294,294 0 0,0 49,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,0 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 49,255 A 98,98 0 0,0 98,170 A 98,98 0 0,1 147,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,340 A 98,98 0 0,0 147,255 A 98,98 0 0,1 147,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 98,98 0 0,1 245,85 A 98,98 0 0,0 147,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,1 294,170 A 98,98 0 0,0 147,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 49,255 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 294,294 0 0,0 49,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 294,294 0 0,0 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,0 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 49,255 A 98,98 0 0,0 98,170 A 98,98 0 0,1 147,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,340 A 98,98 0 0,0 147,255 A 98,98 0 0,1 147,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,85 A 98,98 0 0,1 245,85 A 98,98 0 0,0 147,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 343,255 A 98,98 0 0,1 294,170 A 98,98 0 0,0 147,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="269" cy="43" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="269" y="43" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">10</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-29 13:04:02
|
Revision: 1539 http://rails.svn.sourceforge.net/rails/?rev=1539&view=rev Author: evos Date: 2011-04-29 13:03:56 +0000 (Fri, 29 Apr 2011) Log Message: ----------- 18TN: Enabled private purchase in first OR turn at fixed price. Modified Paths: -------------- trunk/18xx/LocalisedText.properties trunk/18xx/data/18TN/Game.xml trunk/18xx/rails/game/OperatingRound.java trunk/18xx/rails/ui/swing/ORUIManager.java Added Paths: ----------- trunk/18xx/rails/game/specific/_18TN/ trunk/18xx/rails/game/specific/_18TN/OperatingRound_18TN.java Modified: trunk/18xx/LocalisedText.properties =================================================================== --- trunk/18xx/LocalisedText.properties 2011-04-28 19:07:07 UTC (rev 1538) +++ trunk/18xx/LocalisedText.properties 2011-04-29 13:03:56 UTC (rev 1539) @@ -39,7 +39,7 @@ BUY_WHICH_PRIVATE=Buy which private? BUY_WHICH_TRAIN=Buy which train? # Note: in the next item, {0} MUST be in front -BuyPrivatePrompt={0} from {1} for {2}...{3} +BuyPrivatePrompt={0} from {1} for {2} BankIsBrokenDisplayText=Bank is broken. Play continues until {0} BankIsBrokenReportText=Bank is broken gameOverPlaySetOfORs=the current set of operating rounds is finished. Modified: trunk/18xx/data/18TN/Game.xml =================================================================== --- trunk/18xx/data/18TN/Game.xml 2011-04-28 19:07:07 UTC (rev 1538) +++ trunk/18xx/data/18TN/Game.xml 2011-04-29 13:03:56 UTC (rev 1539) @@ -23,6 +23,7 @@ <StockRound> <NoSaleInFirstSR/> </StockRound> + <OperatingRound class="rails.game.specific._18TN.OperatingRound_18TN"/> </GameParameters> <EndOfGame> <Bankruptcy/> Modified: trunk/18xx/rails/game/OperatingRound.java =================================================================== --- trunk/18xx/rails/game/OperatingRound.java 2011-04-28 19:07:07 UTC (rev 1538) +++ trunk/18xx/rails/game/OperatingRound.java 2011-04-29 13:03:56 UTC (rev 1539) @@ -2012,7 +2012,7 @@ lowerPrice = privateCompany.getLowerPrice(); // Is private buying allowed? - if (!getCurrentPhase().isPrivateSellingAllowed()) { + if (!isPrivateSellingAllowed()) { errMsg = LocalText.getText("PrivateBuyingIsNotAllowed"); break; } @@ -2417,7 +2417,7 @@ } // Can private companies be bought? - if (getCurrentPhase().isPrivateSellingAllowed()) { + if (isPrivateSellingAllowed()) { // Create a list of players with the current one in front int currentPlayerIndex = operatingCompany.get().getPresident().getIndex(); @@ -2430,24 +2430,14 @@ player = players.get(i % numberOfPlayers); for (PrivateCompanyI privComp : player.getPortfolio().getPrivateCompanies()) { - // start: br - // check to see if the private can be sold to a company if (!privComp.tradeableToCompany()) { continue; } - // changed so that Private companies know what prices they can be sold for - minPrice = privComp.getLowerPrice(); - if (minPrice == PrivateCompanyI.NO_PRICE_LIMIT) { - minPrice = 0; - } + minPrice = getPrivateMinimumPrice (privComp); - maxPrice = privComp.getUpperPrice(); - if (maxPrice == PrivateCompanyI.NO_PRICE_LIMIT) { - maxPrice = operatingCompany.get().getCash(); - } - // end: br + maxPrice = getPrivateMaximumPrice (privComp); possibleActions.add(new BuyPrivate(privComp, minPrice, maxPrice)); @@ -2526,6 +2516,26 @@ return true; } + protected boolean isPrivateSellingAllowed() { + return getCurrentPhase().isPrivateSellingAllowed(); + } + + protected int getPrivateMinimumPrice (PrivateCompanyI privComp) { + int minPrice = privComp.getLowerPrice(); + if (minPrice == PrivateCompanyI.NO_PRICE_LIMIT) { + minPrice = 0; + } + return minPrice; + } + + protected int getPrivateMaximumPrice (PrivateCompanyI privComp) { + int maxPrice = privComp.getUpperPrice(); + if (maxPrice == PrivateCompanyI.NO_PRICE_LIMIT) { + maxPrice = operatingCompany.get().getCash(); + } + return maxPrice; + } + protected void prepareRevenueAndDividendAction () { // There is only revenue if there are any trains Added: trunk/18xx/rails/game/specific/_18TN/OperatingRound_18TN.java =================================================================== --- trunk/18xx/rails/game/specific/_18TN/OperatingRound_18TN.java (rev 0) +++ trunk/18xx/rails/game/specific/_18TN/OperatingRound_18TN.java 2011-04-29 13:03:56 UTC (rev 1539) @@ -0,0 +1,46 @@ +package rails.game.specific._18TN; + +import java.util.List; + +import rails.game.*; + +public class OperatingRound_18TN extends OperatingRound { + + public OperatingRound_18TN (GameManagerI gameManager) { + super (gameManager); + } + + protected boolean isPrivateSellingAllowed() { + return getCurrentPhase().isPrivateSellingAllowed() + // 18TN special + || !operatingCompany.get().hasOperated() && !ownsPrivate(operatingCompany.get()); + } + + protected int getPrivateMinimumPrice (PrivateCompanyI privComp) { + int minPrice = privComp.getLowerPrice(); + if (minPrice == PrivateCompanyI.NO_PRICE_LIMIT) { + minPrice = 0; + } else if (!operatingCompany.get().hasOperated()) { + // 18TN special + minPrice = privComp.getBasePrice(); + } + return minPrice; + } + + protected int getPrivateMaximumPrice (PrivateCompanyI privComp) { + int maxPrice = privComp.getUpperPrice(); + if (maxPrice == PrivateCompanyI.NO_PRICE_LIMIT) { + maxPrice = operatingCompany.get().getCash(); + } else if (!operatingCompany.get().hasOperated()) { + // 18TN special + maxPrice = privComp.getBasePrice(); + } + return maxPrice; + } + + private boolean ownsPrivate (PublicCompanyI company) { + List<PrivateCompanyI> privates = company.getPortfolio().getPrivateCompanies(); + return privates != null && !privates.isEmpty(); + } + +} Property changes on: trunk/18xx/rails/game/specific/_18TN/OperatingRound_18TN.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/18xx/rails/ui/swing/ORUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/ORUIManager.java 2011-04-28 19:07:07 UTC (rev 1538) +++ trunk/18xx/rails/ui/swing/ORUIManager.java 2011-04-29 13:03:56 UTC (rev 1539) @@ -1255,13 +1255,21 @@ String chosenOption; BuyPrivate chosenAction = null; int minPrice = 0, maxPrice = 0; + String priceRange; for (BuyPrivate action : privates) { + minPrice = action.getMinimumPrice(); + maxPrice = action.getMaximumPrice(); + if (minPrice < maxPrice) { + priceRange = Bank.format(minPrice) + "..." + Bank.format(maxPrice); + } else { + priceRange = Bank.format(maxPrice); + } + privatesForSale.add(LocalText.getText("BuyPrivatePrompt", action.getPrivateCompany().getName(), action.getPrivateCompany().getPortfolio().getName(), - Bank.format(action.getMinimumPrice()), - Bank.format(action.getMaximumPrice()) )); + priceRange )); } if (privatesForSale.size() > 0) { @@ -1276,21 +1284,24 @@ chosenAction = privates.get(index); minPrice = chosenAction.getMinimumPrice(); maxPrice = chosenAction.getMaximumPrice(); - String price = - JOptionPane.showInputDialog(orWindow, - LocalText.getText("WHICH_PRIVATE_PRICE", - chosenOption, - Bank.format(minPrice), - Bank.format(maxPrice) ), - LocalText.getText("WHICH_PRICE"), - JOptionPane.QUESTION_MESSAGE); - try { - amount = Integer.parseInt(price); - } catch (NumberFormatException e) { - amount = 0; // This will generally be refused. + if (minPrice < maxPrice) { + String price = + JOptionPane.showInputDialog(orWindow, + LocalText.getText("WHICH_PRIVATE_PRICE", + chosenOption, + Bank.format(minPrice), + Bank.format(maxPrice) ), + LocalText.getText("WHICH_PRICE"), + JOptionPane.QUESTION_MESSAGE); + try { + amount = Integer.parseInt(price); + } catch (NumberFormatException e) { + amount = 0; // This will generally be refused. + } + chosenAction.setPrice(amount); + } else { + chosenAction.setPrice(maxPrice); } - chosenAction.setPrice(amount); - if (orWindow.process(chosenAction)) { updateMessage(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-05-06 19:27:43
|
Revision: 1546 http://rails.svn.sourceforge.net/rails/?rev=1546&view=rev Author: evos Date: 2011-05-06 19:27:33 +0000 (Fri, 06 May 2011) Log Message: ----------- Added runTo and runThrough properties and getters to MapHex. Possible values: "yes", "no" and "tokenOnly" (values of a new enum MapHex.Run). These new properties are intended to facilitate certain special cases as the names indicate. As an example, runThrough="tokenOnly" has been specified for 1830 Altoona and for the Reading home city in the 1830 Reading variant. Note: These properties are not actually used yet by any code. Modified Paths: -------------- trunk/18xx/data/1830/Map.xml trunk/18xx/rails/game/MapHex.java Modified: trunk/18xx/data/1830/Map.xml =================================================================== --- trunk/18xx/data/1830/Map.xml 2011-05-05 20:42:00 UTC (rev 1545) +++ trunk/18xx/data/1830/Map.xml 2011-05-06 19:27:33 UTC (rev 1546) @@ -86,16 +86,16 @@ <Hex name="H8" tile="0"/> <Hex name="H10" tile="-10"/> <IfOption name="Variant" value="Basegame,Pere Marquette"> - <Hex name="H12" tile="-101" city="Altoona"/> + <Hex name="H12" tile="-101" city="Altoona" runThrough="tokenOnly"/> </IfOption> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> - <Hex name="H12" tile="-30003" pic="-30002" city="Altoona"/> + <Hex name="H12" tile="-30003" pic="-30002" city="Altoona" runThrough="tokenOnly"/> </IfOption> <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields"> <Hex name="H14" tile="0"/> </IfOption> <IfOption name="Variant" value="Reading,Coalfields&Reading"> - <Hex name="H14" tile="-30007" pic="-30006" city="Reading"/> + <Hex name="H14" tile="-30007" pic="-30006" city="Reading" runThrough="tokenOnly"/> </IfOption> <Hex name="H16" tile="-10"/> Modified: trunk/18xx/rails/game/MapHex.java =================================================================== --- trunk/18xx/rails/game/MapHex.java 2011-05-05 20:42:00 UTC (rev 1545) +++ trunk/18xx/rails/game/MapHex.java 2011-05-06 19:27:33 UTC (rev 1546) @@ -12,6 +12,7 @@ import rails.game.model.ModelObject; import rails.game.move.Moveable; import rails.game.move.TileMove; + import rails.game.state.BooleanState; import rails.util.*; @@ -115,6 +116,35 @@ /** Any open sides against which track may be laid even at board edges (1825) */ protected boolean[] openHexSides; + + /** Run-through status of any "city"-type stations on the hex (whether visible or not). + * Indicates whether or not a single train can run through such stations, i.e. both enter and leave it. + * Has no meaning if no "city"-type stations exist on this hex. + * <p>Values (see Run below for definitions): + * <br>- "yes" (default for all except off-map hexes) means that trains of all companies + * may run through this station, unless it is completely filled with foreign base tokens. + * <br>- "tokenOnly" means that trains may only run through the station if it contains a base token of the operating company. + * <br>- "no" (default for off-map hexes) means that no train may run through this hex. + */ + protected Run runThroughAllowed = null; + + /** Run-to status of any "city"-type stations on the hex (whether visible or not). + * Indicates whether or not a single train can run from or to such stations, i.e. either enter or leave it. + * Has no meaning if no "city"-type stations exist on this hex. + * <p>Values (see Run below for definitions): + * <br>- "yes" (default) means that trains of all companies may run to/from this station. + * <br>- "tokenOnly" means that trains may only access the station if it contains a base token of the operating company. + * <br>- "no" would mean that the hex is inaccessible (like 18AL Birmingham in the early game), + * but this option is not yet useful as there is no provision yet to change this setting + * in an undoable way (no state variable). + */ + protected Run runToAllowed = null; + + public enum Run { + YES, + NO, + TOKENONLY + } protected MapManager mapManager = null; @@ -225,6 +255,24 @@ if (openHexSides == null) openHexSides = new boolean[6]; openHexSides[side%6] = true; } + + String runThroughString = tag.getAttributeAsString("runThrough"); + if (Util.hasValue(runThroughString)) { + try { + runThroughAllowed = Run.valueOf(runThroughString.toUpperCase()); + } catch (IllegalArgumentException e) { + throw new ConfigurationException ("Illegal value for MapHex runThrough property: "+runThroughString, e); + } + } + + String runToString = tag.getAttributeAsString("runTo"); + if (Util.hasValue(runToString)) { + try { + runToAllowed = Run.valueOf(runToString.toUpperCase()); + } catch (IllegalArgumentException e) { + throw new ConfigurationException ("Illegal value for MapHex runTo property: "+runToString, e); + } + } } public void finishConfiguration (GameManagerI gameManager) { @@ -240,6 +288,13 @@ cities.add(c); mCities.put(c.getNumber(), c); } + + if (runThroughAllowed == null) { + runThroughAllowed = currentTile.getColourName().equalsIgnoreCase("red") ? Run.NO : Run.YES; + } + if (runToAllowed == null) { + runToAllowed = Run.YES; + } } public void addImpassableSide (int orientation) { @@ -1239,4 +1294,12 @@ return endpoints; } + public Run isRunThroughAllowed() { + return runThroughAllowed; + } + + public Run isRunToAllowed() { + return runToAllowed; + } + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-05-08 15:37:57
|
Revision: 1547 http://rails.svn.sourceforge.net/rails/?rev=1547&view=rev Author: evos Date: 2011-05-08 15:37:49 +0000 (Sun, 08 May 2011) Log Message: ----------- 18Scan initial XML files Modified Paths: -------------- trunk/18xx/data/GamesList.xml trunk/18xx/tiles/TileDictionary.xml trunk/18xx/tiles/Tiles.xml trunk/18xx/tools/ConvertTilesXML.java trunk/18xx/tools/MakeGameTileSets.java Added Paths: ----------- trunk/18xx/data/18Scan/ trunk/18xx/data/18Scan/CompanyManager.xml trunk/18xx/data/18Scan/Game.xml trunk/18xx/data/18Scan/Map.xml trunk/18xx/data/18Scan/StockMarket.xml trunk/18xx/data/18Scan/TileSet.xml trunk/18xx/data/18Scan/Tiles.xml trunk/18xx/tiles/svg/tile-10004.svg trunk/18xx/tiles/svg/tile1121.svg trunk/18xx/tiles/svg/tile1584.svg trunk/18xx/tiles/svg/tile403.svg Removed Paths: ------------- trunk/18xx/rails/util/ConvertTilesXML.java trunk/18xx/rails/util/MakeGameTileSets.java Added: trunk/18xx/data/18Scan/CompanyManager.xml =================================================================== --- trunk/18xx/data/18Scan/CompanyManager.xml (rev 0) +++ trunk/18xx/data/18Scan/CompanyManager.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<CompanyManager> + <CompanyType name="Private" class="rails.game.PrivateCompany"> + <ClosingConditions> + <Phase>5</Phase> + </ClosingConditions> + <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="1.5"/> + <Tradeable toPlayer="yes"/> + </CompanyType> + <CompanyType name="Public" class="rails.game.PublicCompany"> + <PoolPaysOut/> + <Float percentage="60"/> + <ShareUnit percentage="10"/> + <Certificate type="President" shares="2"/> + <Certificate shares="1" number="8"/> + <BaseTokens> + <HomeBase lay="firstOR"/> + <LayCost method="sequence" cost="0,40,100"/> + </BaseTokens> + <Trains number="4,4,3,2"/> + <CanBuyPrivates/> + <CanUseSpecialProperties/> + </CompanyType> + <Company name="P1" type="Private" basePrice="20" revenue="5" + longname="Private 1"></Company> + + + <StartPacket roundClass="rails.game.StartRound_1830"> + <Bidding initial="5" minimum="5" increment="1"/> + <Item name="P1" type="Private" basePrice="20"/> + + + </StartPacket> +</CompanyManager> \ No newline at end of file Property changes on: trunk/18xx/data/18Scan/CompanyManager.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18Scan/Game.xml =================================================================== --- trunk/18xx/data/18Scan/Game.xml (rev 0) +++ trunk/18xx/data/18Scan/Game.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,92 @@ +<?xml version="1.0"?> +<ComponentManager> + <Component name="GameManager" class="rails.game.GameManager"> + <Game name="18Scan"/> + <GameParameters> + <PlayerShareLimit percentage="60"> + <IfOption name="NumberOfPlayers" value="2"> + <IfOption name="TwoPlayersCertLimit70Percent" value="yes"> + <Attributes percentage="70"/> + </IfOption> + </IfOption> + </PlayerShareLimit> + <BankPoolLimit percentage="50"/> + <StockRound> + <NoSaleInFirstSR/> + </StockRound> + </GameParameters> + <GuiClasses> + </GuiClasses> + <EndOfGame> + <Bankruptcy/> + <BankBreaks limit="0" finish="currentOR"/> + <!-- "Runs out"; when "broken", -1 is the limit --> + <!-- Also when the share value reaches $300; this is configured in the stock market XML, + but uses the 'finish' attribute value defined above. --> + </EndOfGame> + </Component> + <Component name="PlayerManager" class="rails.game.PlayerManager"> + <Players number="2" cash="900" certLimit="18"/> + <Players number="3" cash="600" certLimit="12"/> + <Players number="4" cash="450" certLimit="9"/> + </Component> + <Component name="Bank" class="rails.game.Bank"> + <Bank amount="6000"/> + </Component> + <Component name="TileManager" class="rails.game.TileManager" + file="TileSet.xml"/> + <Component name="Map" class="rails.game.MapManager" file="Map.xml"/> + <Component name="CompanyManager" class="rails.game.CompanyManager" + file="CompanyManager.xml"/> + <Component name="StockMarket" class="rails.game.StockMarket" + file="StockMarket.xml"/> + <Component name="TrainManager" class="rails.game.TrainManager"> + <Defaults> + <Reach base="stops" countTowns="no"/> + <Score towns="yes"/> + </Defaults> + <Train name="2" majorStops="2" cost="100" amount="5"/> + <Train name="3" majorStops="3" cost="180" amount="4" startPhase="3"/> + <Train name="4" majorStops="4" cost="300" amount="3" startPhase="4" + rustedTrain="2" /> + <Train name="5" majorStops="5" cost="450" amount="2" startPhase="5"/> + <Train name="6" majorStops="6" cost="630" amount="2" startPhase="6" + rustedTrain="3"/> + <Train name="8" majorStops="8" cost="800" startPhase="8" + rustedTrain="4"> + <IfOption name="UnlimitedTopTrains" value="yes"> + <Attributes amount="-1"/> + </IfOption> + <IfOption name="UnlimitedTopTrains" value="no"> + <Attributes amount="5"/> + </IfOption> + </Train> + </Component> + <Component name="PhaseManager" class="rails.game.PhaseManager"> + <Phase name="2" > + <Tiles colour="yellow"/> + <OperatingRounds number="1"/> + <Trains onePerTurn="yes" tradingAllowed="yes"/> + </Phase> + <Phase name="3"> + <Tiles colour="yellow,green"/> + <Privates sellingAllowed="yes"/> + <OperatingRounds number="2"/> + </Phase> + <Phase name="4"> + <Trains onePerTurn="no"/> + </Phase> + <Phase name="5"> + <Tiles colour="yellow,green,brown"/> + <OperatingRounds number="3"/> + <Privates close="yes"/> + <OffBoardRevenue step="2"/> + </Phase> + <Phase name="6" /> + <Phase name="8"> + <Tiles colour="yellow,green,brown"/> + </Phase> + </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + </Component> +</ComponentManager> \ No newline at end of file Property changes on: trunk/18xx/data/18Scan/Game.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18Scan/Map.xml =================================================================== --- trunk/18xx/data/18Scan/Map.xml (rev 0) +++ trunk/18xx/data/18Scan/Map.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,62 @@ +<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="horizontal" even="A"> + <!-- Hex name="" tile="" orientation="" value="" impassable="" label="" cost="" value="" port="yes/no" --> + <Hex name="A6" tile="-912" city="Kiel" value="20,30,50" orientation="5"/> + <Hex name="B5" tile="0"/> + <Hex name="B7" tile="-912" city="Stettin" value="10,30,60" orientation="5"/> + <Hex name="C6" tile="-10" city="Odense-Copenhagen" cost="40"/> + <Hex name="D1" tile="-911" city="Newcastle" value="20,50,80"/> + <Hex name="D3" tile="-10" city="Stavauger"/> + <Hex name="D5" tile="-10" city="Århus" impassable="E5"/> + <Hex name="D7" tile="-10" city="Malmö" cost="40"/> + <Hex name="E2" tile="-10" city="Bergen" impassable="D3"/> + <Hex name="E4" tile="-1" city="Kristiansand" impassable="D5"/> + <Hex name="E6" tile="0" impassable="D5"/> + <Hex name="F1" tile="0" cost="60"/> + <Hex name="F3" tile="0" cost="60"/> + <Hex name="F5" tile="-10" city="Göteborg" impassable="D4"/> + <Hex name="F7" tile="0"/> + <Hex name="G2" tile="0" cost="60"/> + <Hex name="G4" tile="-10" city="Oslo"/> + <Hex name="G6" tile="-1" city="Norrköping"/> + <Hex name="H1" tile="0" cost="60"/> + <Hex name="H3" tile="0" cost="60"/> + <Hex name="H5" tile="0"/> + <Hex name="H7" tile="0"/> + <Hex name="I2" tile="0" cost="60"/> + <Hex name="I4" tile="0"/> + <Hex name="I6" tile="0"/> + <Hex name="J1" tile="0" cost="60"/> + <Hex name="J3" tile="0" cost="60"/> + <Hex name="J5" tile="-1" city="Gävle"/> + <Hex name="K2" tile="-10" city="Trondheim" cost="60"/> + <Hex name="K4" tile="0"/> + <Hex name="K6" tile="-10004" city="Stockholm" impassable="M6"/> + <Hex name="L3" tile="-1" city="Östersund"/> + <Hex name="L5" tile="0" impassable="N5,M6"/> + <Hex name="L7" tile="0"/> + <Hex name="M2" tile="0" cost="60"/> + <Hex name="M4" tile="0" impassable="N5"/> + <Hex name="M6" tile="-10" city="Turku"/> + <Hex name="M8" tile="-911" city="Tallinn" value="0,30,60" orientation="4"/> + <Hex name="N1" tile="0" cost="60"/> + <Hex name="N3" tile="0"/> + <Hex name="N5" tile="0"/> + <Hex name="N7" tile="-10" city="Helsinki"/> + <Hex name="O2" tile="0" cost="60"/> + <Hex name="O4" tile="-10" city="Umeå" impassable="N5,P5"/> + <Hex name="O6" tile="-10" city="Tampere"/> + <Hex name="P1" tile="0" cost="60"/> + <Hex name="P3" tile="0"/> + <Hex name="P5" tile="0"/> + <Hex name="P7" tile="-1" city="Lahti"/> + <Hex name="Q2" tile="0" cost="60"/> + <Hex name="Q4" tile="0" impassable="S4,P5,R5"/> + <Hex name="Q6" tile="0" city="Tampere"/> + <Hex name="Q8" tile="-911" city="Vyborg" value="30,50,80" orientation="3"/> + <Hex name="R1" tile="-10" city="Narvik" cost="60"/> + <Hex name="R3" tile="-1" city="Lulea"/> + <Hex name="R5" tile="0"/> + <Hex name="S2" tile="-10" city="Gällivare"/> + <Hex name="S4" tile="-1" city="Oulu"/> + <Hex name="T1" tile="-4002" city="Kiruna" value="10,50,10" orientation="2"/> +</Map> Property changes on: trunk/18xx/data/18Scan/Map.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18Scan/StockMarket.xml =================================================================== --- trunk/18xx/data/18Scan/StockMarket.xml (rev 0) +++ trunk/18xx/data/18Scan/StockMarket.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,95 @@ +<StockMarket type="rectangular"> + + <StockSpace name="A1" price="82" /> + <StockSpace name="A2" price="75" /> + <StockSpace name="A3" price="70"/> + <StockSpace name="A4" price="65"/> + <StockSpace name="A5" price="60"/> + <StockSpace name="A6" price="50"/> + <StockSpace name="A7" price="40"/> + + <StockSpace name="B1" price="90" /> + <StockSpace name="B2" price="82" /> + <StockSpace name="B3" price="75" /> + <StockSpace name="B4" price="70"/> + <StockSpace name="B5" price="65"/> + <StockSpace name="B6" price="60"/> + <StockSpace name="B7" price="50"/> + + <StockSpace name="C1" price="100" /> + <StockSpace name="C2" price="90" /> + <StockSpace name="C3" price="82" /> + <StockSpace name="C4" price="75"/> + <StockSpace name="C5" price="70"> + <StartSpace /> + </StockSpace> + <StockSpace name="C6" price="65"/> + <StockSpace name="C7" price="60"/> + + <StockSpace name="D1" price="110" /> + <StockSpace name="D2" price="100" /> + <StockSpace name="D3" price="90"/> + <StockSpace name="D4" price="82"> + <StartSpace /> + </StockSpace> + <StockSpace name="D5" price="75" > + <StartSpace /> + </StockSpace> + <StockSpace name="D6" price="70"/> + <StockSpace name="D7" price="65"/> + + <StockSpace name="E1" price="122" /> + <StockSpace name="E2" price="110"/> + <StockSpace name="E3" price="100" > + <StartSpace /> + </StockSpace> + <StockSpace name="E4" price="90" > + <StartSpace /> + </StockSpace> + <StockSpace name="E5" price="82" /> + <StockSpace name="E6" price="75"/> + + <StockSpace name="F1" price="135"/> + <StockSpace name="F2" price="122" /> + <StockSpace name="F3" price="110" /> + <StockSpace name="F4" price="100" /> + <StockSpace name="F5" price="90" /> + + <StockSpace name="G1" price="150" /> + <StockSpace name="G2" price="135" /> + <StockSpace name="G3" price="122" /> + <StockSpace name="G4" price="110" /> + + <StockSpace name="H1" price="165" /> + <StockSpace name="H2" price="150" /> + <StockSpace name="H3" price="135" /> + <StockSpace name="H4" price="122" /> + + <StockSpace name="I1" price="180" /> + <StockSpace name="I2" price="165" /> + <StockSpace name="I3" price="150" /> + + <StockSpace name="J1" price="200" /> + <StockSpace name="J2" price="180" /> + <StockSpace name="J3" price="165" /> + + <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" /> + + <StockSpace name="M1" price="270" /> + <StockSpace name="M2" price="245" /> + + <StockSpace name="N1" price="300" /> + <StockSpace name="N2" price="270" /> + + <StockSpace name="O1" price="330" /> + + <StockSpace name="P1" price="360"/> + + <StockSpace name="Q1" price="400"/> + +</StockMarket> Property changes on: trunk/18xx/data/18Scan/StockMarket.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18Scan/TileSet.xml =================================================================== --- trunk/18xx/data/18Scan/TileSet.xml (rev 0) +++ trunk/18xx/data/18Scan/TileSet.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,78 @@ +<TileManager tiles="Tiles.xml"> + <!-- Preprinted Tiles--> + <Tile id="0"> + <Upgrade id="8,9"/> + </Tile> + <Tile id="-1"> + <Upgrade id="58"/> + </Tile> + <Tile id="-10"> + <Upgrade id="5"/> + </Tile> + <Tile id="-911"/> + <Tile id="-912"/> + <Tile id="-4002"/> + <Tile id="-10004"/> + + <!-- Yellow Tiles --> + <Tile id="5"> + <Upgrade id="15"/> + </Tile> + <Tile id="8"> + <Upgrade id="80,81,82,83"/> + </Tile> + <Tile id="9"> + <Upgrade id="82,83"/> + </Tile> + <Tile id="58"> + <Upgrade id="141,142,143,144"/> + </Tile> + <Tile id="403"> + <Upgrade id="1121"/> + </Tile> + + <!-- Green Tiles --> + <Tile id="15"/> + <Tile id="80"> + <Upgrade id="545,546"/> + </Tile> + <Tile id="81"> + <Upgrade id="546"/> + </Tile> + <Tile id="82"> + <Upgrade id="544,545,546"/> + </Tile> + <Tile id="83"> + <Upgrade id="544,545,546"/> + </Tile> + <Tile id="1121" extId="121"> + <Upgrade id="1584"/> + </Tile> + <Tile id="141"> + <Upgrade id="145,146,147"/> + </Tile> + <Tile id="142"> + <Upgrade id="145,146,147"/> + </Tile> + <Tile id="143"> + <Upgrade id="146,147"/> + </Tile> + <Tile id="144"> + <Upgrade id="147"/> + </Tile> + <Tile id="622"> + <Upgrade id="623"/> + </Tile> + + <!-- Brown Tiles --> + <Tile id="145"/> + <Tile id="146"/> + <Tile id="147"/> + <Tile id="544"/> + <Tile id="545"/> + <Tile id="546"/> + <Tile id="582"/> + <Tile id="1584" extId="584"/> + <Tile id="623"/> + +</TileManager> Property changes on: trunk/18xx/data/18Scan/TileSet.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/data/18Scan/Tiles.xml =================================================================== --- trunk/18xx/data/18Scan/Tiles.xml (rev 0) +++ trunk/18xx/data/18Scan/Tiles.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<Tiles> + <Tile colour="white" id="0" name="empty"/> + <Tile colour="white" id="-1" name="1 village"> + <Station id="city1" position="002" type="Town"/> + </Tile> + <Tile colour="white" id="-10" name="1 city"> + <Station id="city1" position="302" slots="1" type="City"/> + </Tile> + <Tile colour="red" id="-911" name="OMCity-1"> + <Station id="city1" position="0" slots="1" type="OffMapCity"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="red" id="-912" name="OMCity-2"> + <Station id="city1" position="0" slots="1" type="OffMapCity"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="red" id="-4002" name="Port-2"> + <Station id="city1" position="0" type="OffMapCity"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile> + <Tile colour="yellow" id="-10004" name="Stockholm"> + <Station id="city1" position="052" slots="1" type="City" value="30"/> + <Station id="city2" position="452" slots="1" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side4"/> + </Tile> + <Tile colour="yellow" id="5" name="5"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="yellow" id="8" name="8"> + <Track from="side3" gauge="normal" to="side5"/> + </Tile> + <Tile colour="yellow" id="9" name="9"> + <Track from="side3" gauge="normal" to="side0"/> + </Tile> + <Tile colour="yellow" id="58" name="58"> + <Station id="city1" position="401" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="yellow" id="403" name="Copenhagen"> + <Station id="city1" position="001" slots="1" type="City" value="30"/> + <Station id="city2" position="303" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="city2"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="15" name="15"> + <Station id="city1" position="0" slots="2" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + </Tile> + <Tile colour="green" id="80" name="80"> + <Track from="side1" gauge="normal" to="side2"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="81" name="81"> + <Track from="side0" gauge="normal" to="side2"/> + <Track from="side0" gauge="normal" to="side4"/> + <Track from="side2" gauge="normal" to="side4"/> + </Tile> + <Tile colour="green" id="82" name="82"> + <Track from="side0" gauge="normal" to="side2"/> + <Track from="side0" gauge="normal" to="side5"/> + <Track from="side2" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="83" name="83"> + <Track from="side2" gauge="normal" to="side4"/> + <Track from="side2" gauge="normal" to="side5"/> + <Track from="side4" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="1121" name="Copenhagen"> + <Station id="city1" position="0" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="141" name="141"> + <Station id="city1" position="0" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="142" name="142"> + <Station id="city1" position="0" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="green" id="143" name="143"> + <Station id="city1" position="0" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="green" id="144" name="144"> + <Station id="city1" position="0" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + </Tile> + <Tile colour="green" id="622" name="622"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="145" name="145"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="146" name="146"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="147" name="147"> + <Station id="city1" position="0" type="Town" value="20"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="544" name="544"> + <Track from="side1" gauge="normal" to="side4"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side4"/> + <Track from="side4" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side1"/> + </Tile> + <Tile colour="brown" id="545" name="545"> + <Track from="side0" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side4"/> + <Track from="side4" gauge="normal" to="side3"/> + <Track from="side0" gauge="normal" to="side5"/> + <Track from="side5" gauge="normal" to="side3"/> + <Track from="side5" gauge="normal" to="side4"/> + </Tile> + <Tile colour="brown" id="546" name="546"> + <Track from="side0" gauge="normal" to="side3"/> + <Track from="side1" gauge="normal" to="side3"/> + <Track from="side5" gauge="normal" to="side3"/> + <Track from="side5" gauge="normal" to="side1"/> + <Track from="side1" gauge="normal" to="side0"/> + <Track from="side0" gauge="normal" to="side5"/> + </Tile> + <Tile colour="brown" id="582" name="582"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + </Tile> + <Tile colour="brown" id="1584" name="Copenhagen"> + <Station id="city1" position="0" slots="3" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> + <Tile colour="brown" id="623" name="623"> + <Station id="city1" position="0" slots="2" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + </Tile> +</Tiles> \ No newline at end of file Property changes on: trunk/18xx/data/18Scan/Tiles.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-05-06 19:27:33 UTC (rev 1546) +++ trunk/18xx/data/GamesList.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -304,6 +304,11 @@ All aspects not present in 1880 have not been implemented yet.</Description> <Players minimum="3" maximum="7"/> </Game> + <Game name="18Scan"> + <Note>Prototype</Note> + <Description>18Scan</Description> + <Players minimum="2" maximum="4" /> + </Game> <Credits>Rails is a computer implementation of a number of railroad board games, Deleted: trunk/18xx/rails/util/ConvertTilesXML.java =================================================================== --- trunk/18xx/rails/util/ConvertTilesXML.java 2011-05-06 19:27:33 UTC (rev 1546) +++ trunk/18xx/rails/util/ConvertTilesXML.java 2011-05-08 15:37:49 UTC (rev 1547) @@ -1,424 +0,0 @@ -/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/util/ConvertTilesXML.java,v 1.10 2010/04/30 15:22:42 evos Exp $*/ -package rails.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.*; - -import rails.game.ConfigurationException; - -/** - * Convert an XML tile dictionary, as created by Marco Rocci's Tile Designer, to - * an XML file for use in Rails 18xx. <p> The default names are: - */ -public class ConvertTilesXML { - - private static List<String> directories = new ArrayList<String>(); - private static String inputFilePath = "TileDictionary.xml"; - private static String handmadeFilePath = "HandmadeTiles.xml"; - private static String outputFilePath = "Tiles.xml"; - - private static Map<String, String> colourMap, gaugeMap, sidesMap, cityMap; - private static Map<String, String[]> stationMap; - private static Map<String, String> junctionPosition; - - private static Map<Integer, Element> handmadeTiles - = new HashMap<Integer, Element>(); - - /** Maps non-edge non-station junctions to tracks ending there. */ - private static Map<String, List<Element>> unresolvedTrack; - - /** Maps tracks to edge/station junctions */ - private static Map<Element, String> resolvedTrack; - - private static Pattern namePattern = Pattern.compile("^(\\d+)(/.*)?"); - Document outputDoc; - Element outputJunction; - String tileNo; - String colour; - - static { - colourMap = new HashMap<String, String>(); - colourMap.put("tlYellow", "yellow"); - colourMap.put("tlGreen", "green"); - colourMap.put("tlBrown", "brown"); - colourMap.put("tlGray", "gray"); - colourMap.put("tlOffMap", "red"); - colourMap.put("tlMapFixed", "fixed"); - colourMap.put("tlMapUpgradableToYellow", "white"); - colourMap.put("tlMapUpgradableToGreen", "yellow"); - colourMap.put("tlMapUpgradableToBrown", "green"); - - stationMap = new HashMap<String, String[]>(); - stationMap.put("jtWhistlestop", new String[] { "Town", "0" }); - stationMap.put("jtCity", new String[] { "City", "1" }); - stationMap.put("jtDoubleCity", new String[] { "City", "2" }); - stationMap.put("jtTripleCity", new String[] { "City", "3" }); - stationMap.put("jtQuadrupleCity", new String[] { "City", "4" }); - stationMap.put("jtNone", new String[] { "", "0" }); - // Note: an additional station type is "Pass". - - gaugeMap = new HashMap<String, String>(); - gaugeMap.put("ctNormal", "normal"); - gaugeMap.put("ctSmall", "narrow"); - gaugeMap.put("ctUniversal", "dual"); - gaugeMap.put("ctTunnel", "normal"); - gaugeMap.put("ctMountain", "normal"); - // 1841 Pass: Station type is changed to Pass. - - sidesMap = new HashMap<String, String>(); - sidesMap.put("tp4SideA", "side0"); - sidesMap.put("tp4SideB", "side1"); - sidesMap.put("tp4SideC", "side2"); - sidesMap.put("tp4SideD", "side3"); - sidesMap.put("tp4SideE", "side4"); - sidesMap.put("tp4SideF", "side5"); - - cityMap = new HashMap<String, String>(); - cityMap.put("tpCenter", "0"); - cityMap.put("tp1SideA", "001"); - cityMap.put("tp1CornerA", "551"); - cityMap.put("tp1SideB", "101"); - cityMap.put("tp1CornerB", "051"); - cityMap.put("tp1SideC", "201"); - cityMap.put("tp1CornerC", "151"); - cityMap.put("tp1SideD", "301"); - cityMap.put("tp1CornerD", "251"); - cityMap.put("tp1SideE", "401"); - cityMap.put("tp1CornerE", "351"); - cityMap.put("tp1SideF", "501"); - cityMap.put("tp1CornerF", "451"); - cityMap.put("tp2SideA", "002"); - cityMap.put("tp2CornerA", "552"); - cityMap.put("tp2SideB", "102"); - cityMap.put("tp2CornerB", "052"); - cityMap.put("tp2SideC", "202"); - cityMap.put("tp2CornerC", "152"); - cityMap.put("tp2SideD", "302"); - cityMap.put("tp2CornerD", "252"); - cityMap.put("tp2SideE", "402"); - cityMap.put("tp2CornerE", "352"); - cityMap.put("tp2SideF", "502"); - cityMap.put("tp2CornerF", "452"); - cityMap.put("tp3SideA", "003"); - cityMap.put("tp3CornerA", "553"); - cityMap.put("tp3SideB", "103"); - cityMap.put("tp3CornerB", "053"); - cityMap.put("tp3SideC", "203"); - cityMap.put("tp3CornerC", "153"); - cityMap.put("tp3SideD", "303"); - cityMap.put("tp3CornerD", "253"); - cityMap.put("tp3SideE", "403"); - cityMap.put("tp3CornerE", "353"); - cityMap.put("tp3SideF", "503"); - cityMap.put("tp3CornerF", "453"); - cityMap.put("tpCurve1RightA", "006"); - cityMap.put("tpCurve2RightA", "007"); - cityMap.put("tpCurve2LeftA", "008"); - cityMap.put("tpCurve1LeftA", "009"); - cityMap.put("tpCurve1RightB", "106"); - cityMap.put("tpCurve2RightB", "107"); - cityMap.put("tpCurve2LeftB", "108"); - cityMap.put("tpCurve1LeftB", "109"); - cityMap.put("tpCurve1RightC", "206"); - cityMap.put("tpCurve2RightC", "207"); - cityMap.put("tpCurve2LeftC", "208"); - cityMap.put("tpCurve1LeftC", "209"); - cityMap.put("tpCurve1RightD", "306"); - cityMap.put("tpCurve2RightD", "307"); - cityMap.put("tpCurve2LeftD", "308"); - cityMap.put("tpCurve1LeftD", "309"); - cityMap.put("tpCurve1RightE", "406"); - cityMap.put("tpCurve2RightE", "407"); - cityMap.put("tpCurve2LeftE", "408"); - cityMap.put("tpCurve1LeftE", "409"); - cityMap.put("tpCurve1RightF", "506"); - cityMap.put("tpCurve2RightF", "507"); - cityMap.put("tpCurve2LeftF", "508"); - cityMap.put("tpCurve1LeftF", "509"); - - } - - public static void main(String[] args) { - - if (args != null) { - if (args.length > 0) inputFilePath = args[0]; - if (args.length > 1) outputFilePath = args[1]; - } - - try { - new ConvertTilesXML(); - } catch (ConfigurationException e) { - e.printStackTrace(); - } - - } - - private ConvertTilesXML() throws ConfigurationException { - - int tileId; - - directories.add("tiles"); - - Tag handmadeTopTag = - Tag.findTopTagInFile(handmadeFilePath, directories, "Tiles"); - for (Tag tag : handmadeTopTag.getChildren("Tile")) { - tileId = tag.getAttributeAsInteger("id"); - handmadeTiles.put(tileId, tag.getElement()); - } - - Tag inputTopElement = - Tag.findTopTagInFile(inputFilePath, directories, "tiles"); - - try { - DocumentBuilderFactory factory = - DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - DOMImplementation impl = builder.getDOMImplementation(); - outputDoc = impl.createDocument(null, "Tiles", null); - - convertXML(inputTopElement, outputDoc); - - TransformerFactory.newInstance().newTransformer().transform( - new DOMSource(outputDoc), - new StreamResult(new FileOutputStream(new File( - outputFilePath)))); - - } catch (Exception e) { - throw new ConfigurationException("Document build error", e); - } - - } - - private void convertXML(Tag inputTag, Document outputDoc) - throws ConfigurationException { - - for (Tag tag : inputTag.getChildren("tile")) { - int tileId = Integer.parseInt(tag.getChild("ID").getText()); - if (handmadeTiles.containsKey(tileId)) { - Element outputTile = handmadeTiles.get(tileId); - Node dup = outputDoc.importNode(outputTile, true); - outputDoc.getDocumentElement().appendChild(dup); - System.out.println("Copied handmade tile #"+tileId); - } else { - Element inputTile = tag.getElement(); - Element outputTile = outputDoc.createElement("Tile"); - outputDoc.getDocumentElement().appendChild(outputTile); - convertTile(inputTile, outputTile); - } - } - - } - - private void convertTile(Element inputTile, Element outputTile) - throws ConfigurationException { - - String id = - inputTile.getElementsByTagName("ID").item(0).getFirstChild().getNodeValue(); - System.out.println(id); - tileNo = id; - outputTile.setAttribute("id", id); - // int intId; - try { - Integer.parseInt(id); - } catch (NumberFormatException e) { - throw new ConfigurationException("Non-numeric ID: " + id, e); - } - - String level = - inputTile.getElementsByTagName("level").item(0).getFirstChild().getNodeValue(); - colour = colourMap.get(level); - if (colour == null) { - throw new ConfigurationException("Unknown level: " + level); - } else { - outputTile.setAttribute("colour", colour); - } - - String name = - inputTile.getElementsByTagName("name").item(0).getFirstChild().getNodeValue(); - Matcher m = namePattern.matcher(name); - if (m.matches()) { - outputTile.setAttribute("name", m.group(1)); - } else - outputTile.setAttribute("name", name); - // The below does not work for "B+" - /* - * if (intId > 0) { throw new ConfigurationException("Tile with ID=" + - * id + " has a name not starting with a number: " + name); } - */ - - /* - * Create map to hold the station 'identifiers', which are referred to - * in the track definitions. - */ - junctionPosition = new HashMap<String, String>(); - outputJunction = null; - - Element junctions = - (Element) inputTile.getElementsByTagName("junctions").item(0); - NodeList children = junctions.getElementsByTagName("junction"); - for (int i = 0; i < children.getLength(); i++) { - Element inputJunction = (Element) children.item(i); - outputJunction = outputDoc.createElement("Station"); - outputTile.appendChild(outputJunction); - - convertJunction(i, inputJunction, outputJunction); - } - - unresolvedTrack = new HashMap<String, List<Element>>(); - resolvedTrack = new HashMap<Element, String>(); - - Element connections = - (Element) inputTile.getElementsByTagName("connections").item(0); - children = connections.getElementsByTagName("connection"); - for (int i = 0; i < children.getLength(); i++) { - Element inputConnection = (Element) children.item(i); - convertConnection(inputConnection, outputTile); - } - - String end1, end2; - for (String key : unresolvedTrack.keySet()) { - List<Element> list = unresolvedTrack.get(key); - Element[] ends = list.toArray(new Element[0]); - if (ends.length <= 1) { - throw new ConfigurationException("Loose end " + ends[0] - + " in tile " + tileNo); - } - for (int i = 1; i < ends.length; i++) { - end1 = resolvedTrack.get(ends[i]); - if (end1 == null) { - throw new ConfigurationException("Loose end " + ends[i] - + " in tile " + tileNo); - } - for (int j = 0; j < i; j++) { - end2 = resolvedTrack.get(ends[j]); - if (end2 == null) { - throw new ConfigurationException("Loose end " + ends[j] - + " in tile " + tileNo); - } - Element outputConnection = outputDoc.createElement("Track"); - outputConnection.setAttribute("gauge", - ends[i].getAttribute("gauge")); - outputConnection.setAttribute("from", end1); - outputConnection.setAttribute("to", end2); - outputTile.appendChild(outputConnection); - - } - } - } - } - - private void convertJunction(int i, Element inputJunction, - Element outputJunction) throws ConfigurationException { - - String cityId = "city" + (i + 1); - outputJunction.setAttribute("id", cityId); - - String type = - inputJunction.getElementsByTagName("junType").item(0).getFirstChild().getNodeValue(); - - String[] station = (stationMap.get(type)); - if (station == null) { - throw new ConfigurationException("Unknown junction type: " + type); - } else { - station = station.clone(); - } - - /* - * Off-map cities have the special type "OffMapCity" which does not - * allow driving through. Original type "town" indicates that no token - * can be placed. - */ - if (colour.equals("red")) { - if (station[0].equals("Town")) station[1] = "0"; - station[0] = "OffMapCity"; - } - - outputJunction.setAttribute("type", station[0]); - if (!station[1].equals("0")) { - outputJunction.setAttribute("slots", station[1]); - } - - // Junction revenue - Element revenue = - (Element) inputJunction.getElementsByTagName("revenue").item(0); - if (revenue != null) { - String value = - revenue.getElementsByTagName("value").item(0).getFirstChild().getNodeValue(); - outputJunction.setAttribute("value", value); - } - - // Junction position - String junctionPos = - inputJunction.getElementsByTagName("position").item(0).getFirstChild().getNodeValue(); - junctionPosition.put(junctionPos, cityId); - String jName = cityMap.get(junctionPos); - if (Util.hasValue(jName)) { - outputJunction.setAttribute("position", jName); - } else { - throw new ConfigurationException("Unknown position: " + junctionPos); - } - } - - private void convertConnection(Element inputConnection, Element outputTile) - throws ConfigurationException { - - String type = - inputConnection.getElementsByTagName("conType").item(0).getFirstChild().getNodeValue(); - String gauge = gaugeMap.get(type); - Element outputConnection; - if (gauge == null) { - throw new ConfigurationException("Unknown gauge type: " + type); - } else { - outputConnection = outputDoc.createElement("Track"); - outputConnection.setAttribute("gauge", gauge); - } - - // 1841 special: A pass is not a track type but a station type. - if (type.equals("ctMountain")) - outputJunction.setAttribute("type", "pass"); - - boolean fromOK = - convertTrackEnd(inputConnection, outputConnection, "position1", - "from"); - boolean toOK = - convertTrackEnd(inputConnection, outputConnection, "position2", - "to"); - - if (fromOK && toOK) outputTile.appendChild(outputConnection); - - } - - private boolean convertTrackEnd(Element inputConnection, - Element outputConnection, String inputName, String outputName) - throws ConfigurationException { - - String position = - inputConnection.getElementsByTagName(inputName).item(0).getFirstChild().getNodeValue(); - - String end = sidesMap.get(position); - if (end == null) end = junctionPosition.get(position); - if (end != null) { - outputConnection.setAttribute(outputName, end); - resolvedTrack.put(outputConnection, end); - return true; - } else { - if (!unresolvedTrack.containsKey(position)) { - unresolvedTrack.put(position, new ArrayList<Element>()); - } - (unresolvedTrack.get(position)).add(outputConnection); - return false; - } - } - -} Deleted: trunk/18xx/rails/util/MakeGameTileSets.java =================================================================== --- trunk/18xx/rails/util/MakeGameTileSets.java 2011-05-06 19:27:33 UTC (rev 1546) +++ trunk/18xx/rails/util/MakeGameTileSets.java 2011-05-08 15:37:49 UTC (rev 1547) @@ -1,176 +0,0 @@ -/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/util/MakeGameTileSets.java,v 1.9 2010/01/31 22:22:37 macfreek Exp $*/ -package rails.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.util.*; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.*; - -import rails.game.ConfigurationException; - -/** - * Convert an XML tile dictionary, as created by Marco Rocci's Tile Designer, to - * an XML file for use in Rails 18xx. - */ -public class MakeGameTileSets { - - private static List<String> directories = new ArrayList<String>(); - private static String tilesFilePath = "Tiles.xml"; - - public static void main(String[] args) { - - try { - if (args.length == 0) { - - System.out.println("Provide rails.game name(s) for which to create" - + " tile sets as argument(s).\nALL implies all games below the data directory."); - - } else if (args[0].equalsIgnoreCase("ALL")) { - - List<String> games = new ArrayList<String>(); - - File gamesDir = new File("data"); - if (gamesDir.exists() && gamesDir.isDirectory()) { - File[] files = gamesDir.listFiles(); - for (int i = 0; i < files.length; i++) { - if (files[i].isDirectory() - && !files[i].getName().equalsIgnoreCase("CVS")) { - games.add(files[i].getName()); - } - } - } - - new MakeGameTileSets(games.toArray(new String[0])); - - } else { - - new MakeGameTileSets(args); - - } - - } catch (ConfigurationException e) { - e.printStackTrace(); - } - - } - - private MakeGameTileSets(String[] games) throws ConfigurationException { - - directories.add("tiles"); - Element inputTopElement = - Tag.findTopTagInFile(tilesFilePath, directories, "Tiles").getElement(); - - Map<String, Element> tileMap = new HashMap<String, Element>(); - Element tileSpec; - String tileName; - NodeList tList = inputTopElement.getElementsByTagName("Tile"); - for (int i = 0; i < tList.getLength(); i++) { - tileSpec = (Element) tList.item(i); - tileName = tileSpec.getAttribute("id"); - tileMap.put(tileName, tileSpec); - } - - for (int i = 0; i < games.length; i++) { - System.out.println("Preparing "+games[i]); - makeTileSet(games[i], tileMap); - - } - System.out.println("Done"); - } - - private void makeTileSet(String gameName, Map tileMap) - throws ConfigurationException { - - directories.clear(); - directories.add("data/" + gameName); - - // Open and read the tile set for this rails.game - String tileSetPath = "TileSet.xml"; - Element tileSet = - Tag.findTopTagInFile(tileSetPath, directories, "TileManager").getElement(); - if (tileSet == null) return; - NodeList tiles = tileSet.getElementsByTagName("Tile"); - Map<String, Object> tilesInSet = new HashMap<String, Object>(); - - // Also open and read the map tiles. - String mapPath = "Map.xml"; - Element mapHexes = - Tag.findTopTagInFile(mapPath, directories, "Map").getElement(); - NodeList hexes = mapHexes.getElementsByTagName("Hex"); - - String tilesPath = "data/" + gameName + "/Tiles.xml"; - Document outputDoc; - String tileName; - - try { - DocumentBuilderFactory factory = - DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - DOMImplementation impl = builder.getDOMImplementation(); - outputDoc = impl.createDocument(null, "Tiles", null); - - // Scan the TileSet - for (int i = 0; i < tiles.getLength(); i++) { - - tileName = ((Element) tiles.item(i)).getAttribute("id"); - // Save the tile in a Map so that we can check completeness - // later. - // If we already have it, skip - if (tilesInSet.containsKey(tileName)) continue; - tilesInSet.put(tileName, null); - - System.out.println("Tile "+tileName); - - // Get the Tile specification - Element tileSpec = (Element) tileMap.get(tileName); - if (tileSpec != null) { - // Copy it to the subset document - Element copy = - (Element) outputDoc.importNode( - ((Element) tileMap.get(tileName)), true); - outputDoc.getDocumentElement().appendChild(copy); - } else { - System.out.println("ERROR: specified " + gameName - + " tile " + tileName - + " not found in Tiles.xml."); - } - } - - // Scan the map, and add any missing tiles, with a warning. - for (int i = 0; i < hexes.getLength(); i++) { - - tileName = ((Element) hexes.item(i)).getAttribute("tile"); - // Does the preprinted tile occur in TileSet? - if (tilesInSet.containsKey(tileName)) continue; - - // No, warn and add it to the tiles document. - System.out.println("WARNING: " + gameName - + " preprinted map tile " + tileName - + " does not occur in TileSet!"); - - // Copy it to the subset document - Element copy = - (Element) outputDoc.importNode( - ((Element) tileMap.get(tileName)), true); - outputDoc.getDocumentElement().appendChild(copy); - - } - - TransformerFactory.newInstance().newTransformer().transform( - new DOMSource(outputDoc), - new StreamResult(new FileOutputStream(new File(tilesPath)))); - - } catch (Exception e) { - throw new ConfigurationException("Document build error", e); - } - - } - -} Modified: trunk/18xx/tiles/TileDictionary.xml =================================================================== --- trunk/18xx/tiles/TileDictionary.xml 2011-05-06 19:27:33 UTC (rev 1546) +++ trunk/18xx/tiles/TileDictionary.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -6576,7 +6576,7 @@ <name>121</name> <category> <value>Lon/Bar</value> - <position>tp3CornerF</position> + <position>tp2SideD</position> </category> <junctions> <junction> @@ -23623,4 +23623,169 @@ </connection> </connections> </tile> -</tiles> \ No newline at end of file + <tile> + <ID>-10004</ID> + <shape>tsHexagon</shape> + <level>tlMapUpgradableToGreen</level> + <name>Stockholm</name> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tp2CornerA</position> + <revenue> + <value>30</value> + <position>tp2CornerC</position> + </revenue> + </junction> + <junction> + <junType>jtCity</junType> + <position>tp2CornerE</position> + <revenue> + <value>30</value> + <position>tp2CornerC</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tp2CornerA</position1> + <position2>tp4SideF</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp2CornerE</position1> + <position2>tp4SideE</position2> + </connection> + </connections> + </tile> + <tile> + <ID>403</ID> + <shape>tsHexagon</shape> + <level>tlYellow</level> + <name>Copenhagen</name> + <category> + <value>COP</value> + <position>tp2CornerC</position> + </category> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tp1SideA</position> + <revenue> + <value>30</value> + <position>tp3CornerA</position> + </revenue> + </junction> + <junction> + <junType>jtWhistlestop</junType> + <position>tp3SideD</position> + <revenue> + <value>10</value> + <position>tp3CornerE</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tp1SideA</position1> + <position2>tp3SideD</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tp3SideD</position1> + <position2>tp4SideD</position2> + </connection> + </connections> + </tile> + <tile> + <ID>1121</ID> + <shape>tsHexagon</shape> + <level>tlGreen</level> + <name>Copenhagen</name> + <category> + <value>COP</value> + <position>tp2SideA</position> + </category> + <junctions> + <junction> + <junType>jtCity</junType> + <position>tpCenter</position> + <revenue> + <value>50</value> + <position>tp3CornerF</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideF</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideB</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideD</position2> + </connection> + </connections> + </tile> + <tile> + <ID>1584</ID> + <shape>tsHexagon</shape> + <level>tlBrown</level> + <name>Copenhagen</name> + <category> + <value>COP</value> + <position>tp3CornerB</position> + </category> + <junctions> + <junction> + <junType>jtTripleCity</junType> + <position>tpCenter</position> + <revenue> + <value>60</value> + <position>tp3CornerA</position> + </revenue> + </junction> + </junctions> + <connections> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideD</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideE</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideF</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideA</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideB</position2> + </connection> + <connection> + <conType>ctNormal</conType> + <position1>tpCenter</position1> + <position2>tp4SideC</position2> + </connection> + </connections> + </tile> +</tiles> Modified: trunk/18xx/tiles/Tiles.xml =================================================================== --- trunk/18xx/tiles/Tiles.xml 2011-05-06 19:27:33 UTC (rev 1546) +++ trunk/18xx/tiles/Tiles.xml 2011-05-08 15:37:49 UTC (rev 1547) @@ -3341,7 +3341,7 @@ <Track from="city1" gauge="normal" to="side4"/> <Track from="city1" gauge="normal" to="side2"/> </Tile> - <Tile colour="green" id="-89015" name="1889 Kouchi F9"> + <Tile colour="green" id="-89015" name="1889 Kouchi F9"> <Station id="city1" position="0" slots="2" type="City" value="30"/> <Track from="city1" gauge="normal" to="side0"/> <Track from="city1" gauge="normal" to="side5"/> @@ -4146,4 +4146,31 @@ <Track from="side1" gauge="normal" to="city1"/> <Track from="side2" gauge="normal" to="city1"/> </Tile> + <Tile colour="yellow" id="-10004" name="Stockholm"> + <Station id="city1" position="052" slots="1" type="City" value="30"/> + <Station id="city2" position="452" slots="1" type="City" value="30"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city2" gauge="normal" to="side4"/> + </Tile> + <Tile colour="yellow" id="403" name="Copenhagen"> + <Station id="city1" position="001" slots="1" type="City" value="30"/> + <Station id="city2" position="303" type="Town" value="10"/> + <Track from="city1" gauge="normal" to="city2"/> + <Track from="city2" gauge="normal" to="side3"/> + </Tile> + <Tile colour="green" id="1121" name="Copenhagen"> + <Station id="city1" position="0" slots="1" type="City" value="50"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> + <Tile colour="brown" id="1584" name="Copenhagen"> + <Station id="city1" position="0" slots="3" type="City" value="60"/> + <Track from="city1" gauge="normal" to="side3"/> + <Track from="city1" gauge="normal" to="side4"/> + <Track from="city1" gauge="normal" to="side5"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + </Tile> </Tiles> \ No newline at end of file Added: trunk/18xx/tiles/svg/tile-10004.svg =================================================================== --- trunk/18xx/tiles/svg/tile-10004.svg (rev 0) +++ trunk/18xx/tiles/svg/tile-10004.svg 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FFFF00" stroke="#FFFF00" stroke-width="1" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="147" cy="255" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 49,85 A 98,98 0 0,0 147,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 147,255 A 98,98 0 0,0 49,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 49,85 A 98,98 0 0,0 147,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 147,255 A 98,98 0 0,0 49,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="147" cy="85" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="294" cy="170" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="294" y="170" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">30</text><circle cx="147" cy="255" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="294" cy="170" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="294" y="170" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">30</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> Added: trunk/18xx/tiles/svg/tile1121.svg =================================================================== --- trunk/18xx/tiles/svg/tile1121.svg (rev 0) +++ trunk/18xx/tiles/svg/tile1121.svg 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#38AC00" stroke="#38AC00" stroke-width="1" stroke-linejoin="round"/><text x="245" y="318" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Arial" font-size="34">1121</text><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 49,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 49,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><ellipse rx="38" ry="34" cx="49" cy="170" fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-linejoin="round"/><text x="49" y="170" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Bookman Old Style" font-size="51">50</text><text x="196" y="85" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="TimpaniHeavy" font-size="51">COP</text><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg> Added: trunk/18xx/tiles/svg/tile1584.svg =================================================================== --- trunk/18xx/tiles/svg/tile1584.svg (rev 0) +++ trunk/18xx/tiles/svg/tile1584.svg 2011-05-08 15:37:49 UTC (rev 1547) @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#B46301" stroke="#B46301" stroke-width="1" stroke-linejoin="round"/><text x="245" y="318" dy="0.3em" fill="#000000" stroke="#000000" text-anchor="middle" font-family="Arial" font-size="34">1584</text><polygon points="145,90 247,90 291,167 240,255 152,255 101,167" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="145" cy="141" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="247" cy="141" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="196" cy="229" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 49,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 49,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,0" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340... [truncated message content] |
From: <ev...@us...> - 2011-05-08 19:08:51
|
Revision: 1551 http://rails.svn.sourceforge.net/rails/?rev=1551&view=rev Author: evos Date: 2011-05-08 19:08:40 +0000 (Sun, 08 May 2011) Log Message: ----------- 1880 changes Modified Paths: -------------- trunk/18xx/data/1880/CompanyManager.xml trunk/18xx/data/1880/Game.xml trunk/18xx/data/1880/StockMarket.xml trunk/18xx/rails/game/GameManager.java trunk/18xx/rails/game/GameManagerI.java trunk/18xx/rails/game/Player.java Added Paths: ----------- trunk/18xx/rails/game/specific/_1880/Investor_1880.java trunk/18xx/rails/game/specific/_1880/StartRound_1880.java Property Changed: ---------------- trunk/18xx/tiles/ Modified: trunk/18xx/data/1880/CompanyManager.xml =================================================================== --- trunk/18xx/data/1880/CompanyManager.xml 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/data/1880/CompanyManager.xml 2011-05-08 19:08:40 UTC (rev 1551) @@ -2,7 +2,7 @@ <!-- 1880 CompanyManager.xml --> <CompanyManager> - <CompanyType name="Investor" class="rails.game.PublicCompany"> + <CompanyType name="Investor" class="rails.game.specific._1880.Investor_1880"> <ShareUnit percentage="100" /> <Certificate type="President" shares="1" /> <StockPrice market="no" /> @@ -12,13 +12,24 @@ <Payout split="no" /> </CompanyType> +<CompanyType name="Minor" class="rails.game.PublicCompany"> + <ShareUnit percentage="100"/> + <Certificate type="President" shares="1"/> + <StockPrice market="no"/> + <BaseTokens> + <HomeBase lay="whenFloated"/> + </BaseTokens> + <Payout split="no"/> + <Trains number="1" mandatory="no"/> + </CompanyType> + <CompanyType name="Private" class="rails.game.PrivateCompany" /> <CompanyType name="Major" class="rails.game.PublicCompany" capitalisation="incremental" > <Capitalisation Type="incremental" /> <TileLays> - <Number colour="yellow" phase="2,3,4,5,6,7,8" number="2" /> + <Number colour="yellow" phase="A2,B1,B2,B3,C1,C2,C3,D1,D2,D3" number="2" /> </TileLays> <Float percentage="60" /> <StockPrice par="yes" /> @@ -29,32 +40,10 @@ <LayCost method="sequence" cost="0,40,100" /> </BaseTokens> <Capitalisation type="incremental" /> - <Trains number="4,4,3,3,3,3,2,2" /> + <Trains number="4,4,4,3,3,3,3,3,2,2,2" /> <CanUseSpecialProperties /> </CompanyType> - <Company Name="A1" longname="Chinese Eastern Railway" type="Investor" tokens="1" > - <Home hex="A3" city="1" /> - </Company> - <Company Name="A2" longname="South Manchuria Railway" type="Investor" tokens="1" > - <Home hex="E13" city="1" /> - </Company>> - <Company Name="A3" longname="Zeng Tai Railway" type="Investor" tokens="1" > - <Home hex="H6" city="1" /> - </Company> - <Company Name="A4" longname="Schantung-Eisenbahngesellschaft" - type="Investor" tokens="1" > - <Home hex="H14" city="1" /> - </Company> - <Company Name="A5" longname="Kowloon-Canton Railway" type="Investor" tokens="1" > - <Home hex="Q15" city="1" /> - </Company> - <Company Name="A6" longname="Macau Hafen" type="Investor" tokens="1" > - <Home hex="P12" city="1" /> - </Company> - <Company Name="A7" longname="Kunming-Hekou Railway" type="Investor" tokens="1" > - <Home hex="Q7" city="1" /> - </Company> <Company name="WR" longname="Woosong Railway" type="Private" basePrice="5" revenue="0"> <!--SpecialProperty condition="ifOwnedByPlayer" Phasenwechsel-Freie Lok --> @@ -114,20 +103,20 @@ </Company> <Company name="JHA" longname="Jingha Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="F8" /> + <Home hex="F8" city="1"/> </Company> <Company name="JHU" longname="Jinghu Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="F8" /> + <Home hex="F8" city="2"/> </Company> <Company name="JGG" longname="Jingguang Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="F8" /> + <Home hex="F8" city="3"/> </Company> <Company name="JLR" longname="Jinglan Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="F8" /> + <Home hex="F8" city="4"/> </Company> <Company name="BZU" longname="Binzhou Railway" type="Major" @@ -153,32 +142,63 @@ </Company> <Company name="HKR" longname="Hukun Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="K14" /> + <Home hex="K15" /> </Company> <Company name="NJR" longname="Najiang Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="K12" /> + <Home hex="K13" /> </Company> <Company name="QSR" longname="Qinshen Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> - <Home hex="D13" /> + <Home hex="D12" /> </Company> <Company name="WNR" longname="Wunan Railway" type="Major" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> <Home hex="L10" /> </Company> - <StartPacket roundClass="rails.game.StartRound_1880"> - <Bidding initial="5" minimum="5" increment="5" /> - <Item name="WR" type="Private" /> - <Item name="KR" type="Private" /> - <Item name="YC" type="Private" /> - <Item name="TL" type="Private" /> - <Item name="CC" type="Public" /> - <Item name="JO" type="Private" /> - <Item name="IG" type="Private"> - <SubItem name="BCR" type="Public" /> - <Item name="RC" type="Private" /> + <Company name="1" longname="Chinese Eastern Railway" type="Minor" price="0" tokens="1" > + <Home hex="A3" city="1" /> + </Company> + <Company name="2" longname="South Manchuria Railway" type="Minor" price="0" tokens="1" > + <Home hex="E13" city="1" /> + </Company>> + <Company name="3" longname="Zeng Tai Railway" type="Minor" price="0" tokens="1" > + <Home hex="H6" city="1" /> + </Company> + <Company name="4" longname="Schantung-Eisenbahngesellschaft" + type="Minor" price="0" tokens="1" > + <Home hex="H14" city="1" /> + </Company> + <Company name="5" longname="Kowloon-Canton Railway" type="Minor" price="0" tokens="1" > + <Home hex="Q15" city="1" /> + </Company> + <Company name="6" longname="Macau Hafen" type="Minor" price="0" tokens="1" > + <Home hex="P12" city="1" /> + </Company> + <Company name="7" longname="Kunming-Hekou Railway" type="Minor" price="0" tokens="1" > + <Home hex="Q7" city="1" /> + </Company> + + <StartPacket roundClass="rails.game.specific._1880.StartRound_1880"> + <Bidding initial="0" minimum="0" increment="5" /> + <Item name="WR" type="Private" basePrice="5"/> + <Item name="KR" type="Private" basePrice="10"/> + <Item name="YC" type="Private" basePrice="25"/> + <Item name="TL" type="Private" basePrice="45"/> + <Item name="CC" type="Private" basePrice="70"/> + <Item name="JO" type="Private" basePrice="100"/> + <Item name="IG" type="Private" basePrice="160"> + <SubItem name="BCR" type="Major" president="yes"/> </Item> + <Item name="RC" type="Private" basePrice="50"/> + <Item name="1" type="Minor" basePrice="0"/> + <Item name="2" type="Minor" basePrice="0"/> + <Item name="3" type="Minor" basePrice="0"/> + <Item name="4" type="Minor" basePrice="0"/> + <Item name="5" type="Minor" basePrice="0"/> + <Item name="6" type="Minor" basePrice="0"/> + <Item name="7" type="Minor" basePrice="0"/> </StartPacket> + </CompanyManager> \ No newline at end of file Modified: trunk/18xx/data/1880/Game.xml =================================================================== --- trunk/18xx/data/1880/Game.xml 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/data/1880/Game.xml 2011-05-08 19:08:40 UTC (rev 1551) @@ -55,46 +55,61 @@ <Train name="10" majorStops="10" cost="1000" amount="-1"/> </Component> <Component name="PhaseManager" class="rails.game.PhaseManager"> - <Phase name="1"> + <Phase name="A1"> <Tiles colour="yellow"/> <OperatingRounds number="-1"/> <Float percentage="20"/> <Trains tradingAllowed="yes"/> <Stocks avail="5"/> </Phase> - <Phase name="2"> + <Phase name="A2"> + <Tiles colour="yellow"/> + + </Phase> + <Phase name="B1"> <Tiles colour="yellow,green"/> - <OffBoardRevenue step="2"/> <Float percentage="30"/> <Stocks avail="10"/> + <OffBoardRevenue step="2"/> </Phase> - <Phase name="3"> + <Phase name="B2"> <Tiles colour="yellow,green"/> - + <OffBoardRevenue step="2"/> </Phase> - <Phase name="4"> + <Phase name="B3"> <Tiles colour="yellow,green"/> + <OffBoardRevenue step="2"/> <Privates close="yes"/> <Investors active="no"/> <Communists active="yes"/> <Float percentage="40"/> </Phase> - <Phase name="5"> + <Phase name="C1"> <Tiles colour="yellow,green,brown"/> <OffBoardRevenue step="3"/> </Phase> - <Phase name="6"> + <Phase name="C2"> <Tiles colour="yellow,green,brown"/> + <Comunists active="no"/> <Float percentage="60"/> - <Comunists active="no"/> + <OffBoardRevenue step="3"/> </Phase> - <Phase name="7"> + <Phase name="C3"> <Tiles colour="yellow,green,brown"/> + <OffBoardRevenue step="3"/> </Phase> - <Phase name="8"> + <Phase name="D1"> <Tiles colour="yellow,green,brown,grey"/> <OffBoardRevenue step="4"/> </Phase> + <Phase name="D2"> + <Tiles colour="yellow,green,brown,grey"/> + <OffBoardRevenue step="4"/> + </Phase> + <Phase name="D3"> + <Tiles colour="yellow,green,brown,grey"/> + <OffBoardRevenue step="4"/> + </Phase> <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> <Modifier class="rails.game.specific._1880.OffBoardRevenueModifier" /> <Modifier class="rails.game.specific._1880.ExpressTrainRevenueModifier" /> Modified: trunk/18xx/data/1880/StockMarket.xml =================================================================== --- trunk/18xx/data/1880/StockMarket.xml 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/data/1880/StockMarket.xml 2011-05-08 19:08:40 UTC (rev 1551) @@ -31,19 +31,19 @@ <StockSpace name="C9" price="60" /> <StockSpace name="D1" price="105" /> <StockSpace name="D2" price="100" > - <Startspace /> + <StartSpace /> </StockSpace> <StockSpace name="D3" price="95" /> <StockSpace name="D4" price="90" > - <Startspace /> + <StartSpace /> </StockSpace> <StockSpace name="D5" price="85" /> <StockSpace name="D6" price="80" > - <Startspace /> + <StartSpace /> </StockSpace> <StockSpace name="D7" price="75" /> <StockSpace name="D8" price="70" > - <Startspace /> + <StartSpace /> </StockSpace> <StockSpace name="D9" price="65" /> <StockSpace name="E1" price="110" /> Modified: trunk/18xx/rails/game/GameManager.java =================================================================== --- trunk/18xx/rails/game/GameManager.java 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/rails/game/GameManager.java 2011-05-08 19:08:40 UTC (rev 1551) @@ -1896,5 +1896,31 @@ skipNextDone = true; skippedStep = step; } + + /** + * + *@param ascending Boolean to determine if the playerlist will be sorted in ascending or descending order based on their cash + *@return Returns the player at index position 0 that is either the player with the most or least cash depending on sort order. + */ + public Player reorderPlayersByCash (boolean ascending) { + + final boolean _ascending = ascending; + Collections.sort (players, new Comparator<Player>() { + public int compare (Player p1, Player p2) { + return _ascending ? p1.getCash() - p2.getCash() : p2.getCash() - p1.getCash(); + } + }); + + Player player; + for (int i=0; i<players.size(); i++) { + player = players.get(i); + player.setIndex (i); + playerNames.set (i, player.getName()); + log.debug("New player "+i+" is "+player.getName() +" (cash="+Bank.format(player.getCash())+")"); + } + + return players.get(0); + } + } Modified: trunk/18xx/rails/game/GameManagerI.java =================================================================== --- trunk/18xx/rails/game/GameManagerI.java 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/rails/game/GameManagerI.java 2011-05-08 19:08:40 UTC (rev 1551) @@ -210,4 +210,7 @@ public boolean isReloading(); public void setReloading(boolean reloading); public void setSkipDone (GameDef.OrStep step); + + public Player reorderPlayersByCash(boolean high); + //public void reorderPlayersByCash(boolean high); } \ No newline at end of file Modified: trunk/18xx/rails/game/Player.java =================================================================== --- trunk/18xx/rails/game/Player.java 2011-05-08 15:55:50 UTC (rev 1550) +++ trunk/18xx/rails/game/Player.java 2011-05-08 19:08:40 UTC (rev 1551) @@ -200,6 +200,10 @@ return index; } + public void setIndex(int index) { + this.index = index; + } + public void setBankrupt () { bankrupt.set(true); } Added: trunk/18xx/rails/game/specific/_1880/Investor_1880.java =================================================================== --- trunk/18xx/rails/game/specific/_1880/Investor_1880.java (rev 0) +++ trunk/18xx/rails/game/specific/_1880/Investor_1880.java 2011-05-08 19:08:40 UTC (rev 1551) @@ -0,0 +1,69 @@ +/** + * + */ +package rails.game.specific._1880; + +import rails.game.PublicCompany; + +/** + * @author Martin 2011/04/11 + * + */ +public class Investor_1880 extends PublicCompany { +/* + * Investors in 1880 get chosen at start after the initial starting package is sold out. They get one share from a new company + * TODO: Make sure that dividends aren't accumulated on the investors + +*/ + protected boolean canOwnShare=true; + + protected int maxPercofShares=1; + + protected boolean hasStockPrice=false; + + protected boolean hasParPrice=false; + + protected PublicCompany linkedCompany; // An Investor is always linked to a (exactly one) Public Major Company.. + + /* Investors in 1880 operate with the newest train model on lease from the bank for zero costs. + */ + protected boolean canBorrowTrain=true; + + + /** + * + */ + public Investor_1880() { + super(); + } + + public boolean canOwnShare(){ + return canOwnShare; + } + + public int maxPercofShares(){ + return maxPercofShares; + } + public boolean hasStockPrice(){ + return hasStockPrice; + } + + public boolean hasParPrice(){ + return hasParPrice; + } + + public PublicCompany getLinkedCompany(){ + return linkedCompany; + } + + public boolean setLinkedCompany(PublicCompany linkedCompany){ + if (linkedCompany != null){ + //Check if Company is valid i.e. not Closed maybe check if theres already the President sold and just the president... + if(!linkedCompany.isClosed()){ + this.linkedCompany=linkedCompany; + return true;} + } + return false; + } + +} Property changes on: trunk/18xx/rails/game/specific/_1880/Investor_1880.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1880/StartRound_1880.java =================================================================== --- trunk/18xx/rails/game/specific/_1880/StartRound_1880.java (rev 0) +++ trunk/18xx/rails/game/specific/_1880/StartRound_1880.java 2011-05-08 19:08:40 UTC (rev 1551) @@ -0,0 +1,384 @@ +/** + * + */ +package rails.game.specific._1880; + +import rails.game.*; +import rails.game.action.*; +import rails.game.state.IntegerState; +import rails.game.state.State; +import rails.game.state.ArrayListState; +import rails.util.LocalText; + + + +/** + * @author Martin + * + */ +public class StartRound_1880 extends StartRound { + + private final State startingPlayer = + new State("StartingPlayer", Player.class); + + private final IntegerState currentBuyPrice = + new IntegerState("CurrentBuyPrice", 0); + + private final IntegerState initialItemRound = + new IntegerState("InitialItemRound",0); + + private final State currentItem = + new State("CurrentItem", StartItem.class); + + private final IntegerState currentStartRoundPhase = + new IntegerState("CurrentStartRoundPhase",0); + + private final IntegerState investorChosen = + new IntegerState("InvestorChosen",0); + + /** A company in need for a par price. */ + PublicCompanyI companyNeedingPrice = null; + + + /** + * @param gameManager + */ + public StartRound_1880(GameManagerI gameManager) { + super(gameManager); + hasBasePrices=true; + hasBidding=true; + + } + @Override + public void start() { + super.start(); + + // crude fix for StartItem hardcoded SetMinimumbid ignoring the initial value out of the XMLs.... + for (StartItem item : startPacket.getItems()) { + item.setMinimumBid(item.getBasePrice()); + } + startingPlayer.set(getCurrentPlayer()); + setPossibleActions(); + + } + + @Override + public boolean setPossibleActions() { + + possibleActions.clear(); + + StartItem item = startPacket.getFirstUnsoldItem(); + + + //Need Logic to check for all Type Minor/Investor Certificate + if ( (item.getType()!=null ) && (item.getType().equals("Private"))) { + + currentBuyPrice.set(item.getMinimumBid()); + + if (currentPlayer == startPlayer) ReportBuffer.add(""); + + if (currentItem == null || currentItem.get() != item ) { // we haven't seen this item before + numPasses.set(0); // new round so cancel all previous passes ! + currentItem.set(item); + item.setStatus(StartItem.BIDDABLE); + item.setStatus(StartItem.BUYABLE); + auctionItemState.set(item); + initialItemRound.set(0); + } else { + initialItemRound.add(1); + } + + + + Player currentPlayer = getCurrentPlayer(); + + if (item.getStatus() == StartItem.NEEDS_SHARE_PRICE) { //still necessary ?? + /* This status is set in buy() if a share price is missing */ + setPlayer(item.getBidder()); + possibleActions.add(new BuyStartItem(item, item.getBid(), false, true)); + return true; + // No more actions + } + if ((item.getBidder() == currentPlayer) && (numPasses.intValue() == getNumberOfPlayers()-1)){ // Current Player is highest Bidder & all others have passed + if (item.needsPriceSetting() != null ){ + BuyStartItem possibleAction = new BuyStartItem(item,item.getBid(), true, true); + possibleActions.add(possibleAction); + return true; + // No more actions// no further Actions possible + }else{ + BuyStartItem possibleAction = new BuyStartItem(item,item.getBid(),true); + possibleActions.add(possibleAction); + return true; + // No more actions// no further Actions possible + } + } + + if (currentPlayer.getCash() >= item.getMinimumBid()) { + //Kann bieten + if (item.getBid() == 0) { // erster Spieler noch keiner sonst geboten. + BidStartItem possibleAction = + new BidStartItem(item, item.getBasePrice(), + 0, true); + possibleActions.add(possibleAction); // Player can offer a bid + possibleActions.add(new NullAction(NullAction.PASS)); + return true; + } else { + BidStartItem possibleAction = + new BidStartItem(item, item.getMinimumBid(), + startPacket.getModulus(), true); + possibleActions.add(possibleAction); // Player can offer a bid + possibleActions.add(new NullAction(NullAction.PASS)); + return true; + } + } else { + // Can't bid: Autopass + numPasses.add(1); + return false; + } + } else { // Item is not a private ! should be a major or minor in 1880 special rules apply. + //Check if all players own a minor/investor already then declare Startinground over... + if (currentStartRoundPhase.intValue() == 0) { //first time a non Private gets called up; initialize the rest of items to BUYABLE + // Priority Deal goes to the player with the smallest wallet... + gameManager.setCurrentPlayer(gameManager.reorderPlayersByCash(true)); + //setCurrentPlayerIndex(0); //lowest or highest Player is always at the start of the player list after reordering ! + //Send Message that Playerorder has Changed !... + currentPlayer=getCurrentPlayer(); + currentStartRoundPhase.set(1); + startingPlayer.set(currentPlayer); + gameManager.setPriorityPlayer((Player) startingPlayer.get()); // Method doesn't exist in Startround ??? + } + if (investorChosen.intValue() == getNumberOfPlayers()) { + for ( StartItem item1 : itemsToSell) { + if (!item1.isSold()){ + item1.setStatus(StartItem.UNAVAILABLE); + item1.setStatus(StartItem.SOLD); + + } + } + finishRound(); + return false; + } else { + for ( StartItem item1 : itemsToSell) { + if (!item1.isSold()){ + item1.setStatus(StartItem.BUYABLE); + BuyStartItem possibleAction = new BuyStartItem(item1, 0, false); + possibleActions.add(possibleAction); + } + } + investorChosen.add(1); + return true; + } + + } + } + + /* (non-Javadoc) + * @see rails.game.StartRound#bid(java.lang.String, rails.game.action.BidStartItem) + */ + @Override + protected boolean bid(String playerName, BidStartItem bidItem) { + StartItem item = bidItem.getStartItem(); + String errMsg = null; + Player player = getCurrentPlayer(); + int bidAmount = bidItem.getActualBid(); + + while (true) { + + // Check player + if (!playerName.equals(player.getName())) { + errMsg = LocalText.getText("WrongPlayer", playerName, player.getName()); + break; + } + // Check item + boolean validItem = false; + for (StartItemAction activeItem : possibleActions.getType(StartItemAction.class)) { + if (bidItem.equalsAsOption(activeItem)) { + validItem = true; + break; + } + + } + if (!validItem) { + errMsg = LocalText.getText("ActionNotAllowed", + bidItem.toString()); + break; + } + + // Is the item buyable? + if (bidItem.getStatus() != StartItem.BUYABLE) { + errMsg = LocalText.getText("NotForSale"); + break; + } + + // Bid must be at least 5 above last bid + if (bidAmount < item.getMinimumBid()) { + errMsg = LocalText.getText("BidTooLow", "" + + item.getMinimumBid()); + break; + } + + // Bid must be a multiple of the modulus + if (bidAmount % startPacket.getModulus() != 0) { + errMsg = LocalText.getText("BidMustBeMultipleOf", + bidAmount, + startPacket.getMinimumIncrement()); + break; + } + + // Has the buyer enough cash? + if (bidAmount > player.getCash()) { + errMsg = LocalText.getText("BidTooHigh", Bank.format(bidAmount)); + break; + } + + break; + } + + if (errMsg != null) { + DisplayBuffer.add(LocalText.getText("InvalidBid", + playerName, + item.getName(), + errMsg )); + return false; + } + + moveStack.start(false); + + item.setBid(bidAmount, player); + ReportBuffer.add(LocalText.getText("BID_ITEM_LOG", + playerName, + Bank.format(bidAmount), + item.getName(), + Bank.format(player.getCash()) )); + setNextBiddingPlayer(item); + return true; + + } + + /* (non-Javadoc) + * @see rails.game.StartRound#pass(java.lang.String) + */ + @Override + protected boolean pass(String playerName) { + String errMsg = null; + Player player = getCurrentPlayer(); + StartItem auctionItem = (StartItem) auctionItemState.get(); + + while (true) { + + // Check player + if (!playerName.equals(player.getName())) { + errMsg = LocalText.getText("WrongPlayer", playerName, player.getName()); + break; + } + break; + } + + if (errMsg != null) { + DisplayBuffer.add(LocalText.getText("InvalidPass", + playerName, + errMsg )); + return false; + } + + ReportBuffer.add(LocalText.getText("PASSES", playerName)); + + moveStack.start(false); + + numPasses.add(1); + + if (numPasses.intValue() >= numPlayers) { + // All players have passed. + ReportBuffer.add(LocalText.getText("ALL_PASSED")); + // It the first item has not been sold yet, reduce its price by + // 5. + if (auctionItem.getIndex() < 2) { + auctionItem.reduceBasePriceBy(5); + auctionItem.setMinimumBid(auctionItem.getBasePrice()); + ReportBuffer.add(LocalText.getText( + "ITEM_PRICE_REDUCED", + auctionItem.getName(), + Bank.format(startPacket.getFirstItem().getBasePrice()) )); + numPasses.set(0); + if (auctionItem.getBasePrice() == 0) { + assignItem((Player)startingPlayer.get(), + auctionItem, 0, 0); + setNextStartingPlayer(); + // startPacket.getFirstItem().getName()); + return true; + } + } else { + numPasses.set(0); + //gameManager.nextRound(this); + finishRound(); + + } + } + // if ((numPasses.intValue() >= auctionItem.getBidders() - 1) && + if ((auctionItem.getBidders() >0) && (numPasses.intValue()== getNumberOfPlayers()-1)) { + // All but the highest bidder have passed. + int price = auctionItem.getBid(); + + log.debug("Highest bidder is " + + auctionItem.getBidder().getName()); + if (auctionItem.needsPriceSetting() != null) { + auctionItem.setStatus(StartItem.NEEDS_SHARE_PRICE); + } else { + assignItem(auctionItem.getBidder(), auctionItem, price, 0); + } + auctionItemState.set(null); + numPasses.set(0); + setNextStartingPlayer(); + return true; + } else { + // More than one left: find next bidder + + if (auctionItem.getIndex()>1){ + auctionItem.setBid(-1, player); + setNextBiddingPlayer(auctionItem, + getCurrentPlayerIndex()); + }else { + auctionItem.setBid(-1, player); + setNextPlayer(); + } + + + } + + + + return true; + + + } + + private void setNextBiddingPlayer(StartItem item, int currentIndex) { + for (int i = currentIndex + 1; i < currentIndex + + gameManager.getNumberOfPlayers(); i++) { + if (item.getBid(gameManager.getPlayerByIndex(i)) >=0) { + setCurrentPlayerIndex(i); + break; + } + } + } + + private void setNextBiddingPlayer(StartItem item) { + + setNextBiddingPlayer(item, getCurrentPlayerIndex()); + } + + @Override + public String getHelp() { + return "1880 Start Round help text"; + } + + private void setNextStartingPlayer(){ + int i; + Player player; + player = (Player) startingPlayer.get(); + i= player.getIndex(); + startingPlayer.set(gameManager.getPlayerByIndex(i+1)); + setCurrentPlayerIndex(i+1 % getNumberOfPlayers()); + } + +} Property changes on: trunk/18xx/rails/game/specific/_1880/StartRound_1880.java ___________________________________________________________________ Added: svn:mime-type + text/plain Property changes on: trunk/18xx/tiles ___________________________________________________________________ Modified: svn:ignore - Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt TileDictionary - kopie.xml TileDictionary - kopie.18t + Copy of TileDictionary.18t handmade TDwithID TDwoID xml tileimages.xml Copy (2) of TileDictionary.18t Copy (3) of TileDictionary.18t Rails18xx.ini UserGridStyle.ini UserTileStyle.ini *.exe o TDindex.pl TDindex.txt TileDictionary - kopie.xml TileDictionary - kopie.18t fix.bat tilexml.bat tileset.bat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-05-11 16:20:14
|
Revision: 1556 http://rails.svn.sourceforge.net/rails/?rev=1556&view=rev Author: evos Date: 2011-05-11 16:20:08 +0000 (Wed, 11 May 2011) Log Message: ----------- Added 1830 Wabash variant Modified Paths: -------------- trunk/18xx/data/1830/CompanyManager.xml trunk/18xx/data/1830/Game.xml trunk/18xx/data/1830/Map.xml trunk/18xx/data/1830/TileSet.xml trunk/18xx/data/1830/Tiles.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/game/MapHex.java trunk/18xx/rails/game/MapManager.java trunk/18xx/rails/game/StartRound.java Modified: trunk/18xx/data/1830/CompanyManager.xml =================================================================== --- trunk/18xx/data/1830/CompanyManager.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/1830/CompanyManager.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -82,7 +82,7 @@ </Company> <Company name="C&O" type="Public" tokens="3" fgColour="000000" bgColour="A0E0FF" longname="Chesapeake & Ohio"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Wabash"> <Home hex="F6"/> </IfOption> <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> @@ -131,6 +131,14 @@ <Certificate shares="1" number="7"/> </Company> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Company name="WR" type="Public" tokens="2" fgColour="000000" bgColour="FFFFFF" + longname="Wabash Railroad"> + <Home hex="H2"/> + <Certificate type="President" shares="2"/> + <Certificate shares="1" number="8"/> + </Company> + </IfOption> <StartPacket roundClass="rails.game.StartRound_1830"> <Bidding initial="5" minimum="5" increment="1"/> Modified: trunk/18xx/data/1830/Game.xml =================================================================== --- trunk/18xx/data/1830/Game.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/1830/Game.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -15,7 +15,7 @@ <!-- The options in Game.xml are not currently used. See GamesList.xml for the real ones. --> - <GameOption name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading,Coalfields&Reading" default="Basegame" /> + <GameOption name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading,Coalfields&Reading,Wabash" 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" /> @@ -87,6 +87,13 @@ <Players number="5" cash="480" certLimit="15"/> <Players number="6" cash="400" certLimit="13"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Players number="2" cash="1200" certLimit="29"/> + <Players number="3" cash="800" certLimit="22"/> + <Players number="4" cash="600" certLimit="17"/> + <Players number="5" cash="480" certLimit="15"/> + <Players number="6" cash="400" certLimit="13"/> + </IfOption> </Component> <Component name="Bank" class="rails.game.Bank"> <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields,Reading"> @@ -95,6 +102,9 @@ <IfOption name="Variant" value="Coalfields&Reading"> <Bank amount="20000"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Bank amount="14000"/> + </IfOption> <Money format="$@"/> </Component> <Component name="TileManager" class="rails.game.TileManager" @@ -124,11 +134,17 @@ <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> <Attributes obsoleting="yes"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Attributes amount="7"/> + </IfOption> </Train> <Train name="3" majorStops="3" cost="180" amount="5" startPhase="3"> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> <Attributes obsoleting="yes"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Attributes amount="6"/> + </IfOption> </Train> <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4" rustedTrain="2"> @@ -138,8 +154,15 @@ <IfOption name="Variant" value="Coalfields&Reading"> <Attributes obsoleting="yes" amount="6"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Attributes amount="5"/> + </IfOption> </Train> - <Train name="5" majorStops="5" cost="450" amount="3" startPhase="5"/> + <Train name="5" majorStops="5" cost="450" amount="3" startPhase="5"> + <IfOption name="Variant" value="Wabash"> + <Attributes amount="4"/> + </IfOption> + </Train> <Train name="6" majorStops="6" cost="630" startPhase="6" rustedTrain="3" releasedTrain="D"> <IfOption name="WithOptional6Train" value="yes"> @@ -154,27 +177,35 @@ <IfOption name="Variant" value="Coalfields&Reading"> <Attributes amount="4" releasedTrain="7,D"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Attributes amount="3"/> + </IfOption> </Train> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> <Train name="7" majorStops="7" cost="710" amount="2"/> </IfOption> - <Train name="D" majorStops="99" startPhase="D" rustedTrain="4"> - <IfOption name="Variant" value="Basegame,Pere Marquette"> - <Attributes cost="1100"/> + <IfOption name="Variant" value="Wabash"> + <Train name="7" majorStops="7" cost="830" amount="-1"/> + </IfOption> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading,Coalfields,Coalfields&Reading"> + <Train name="D" majorStops="99" startPhase="D" rustedTrain="4"> + <IfOption name="Variant" value="Basegame,Pere Marquette"> + <Attributes cost="1100"/> + <Exchange cost="800"/> + </IfOption> + <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> + <Attributes cost="900"/> + <Exchange cost="750"/> + </IfOption> + <IfOption name="UnlimitedTopTrains" value="yes"> + <Attributes amount="-1"/> + </IfOption> + <IfOption name="UnlimitedTopTrains" value="no"> + <Attributes amount="6"/> + </IfOption> <Exchange cost="800"/> - </IfOption> - <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> - <Attributes cost="900"/> - <Exchange cost="750"/> - </IfOption> - <IfOption name="UnlimitedTopTrains" value="yes"> - <Attributes amount="-1"/> - </IfOption> - <IfOption name="UnlimitedTopTrains" value="no"> - <Attributes amount="6"/> - </IfOption> - <Exchange cost="800"/> - </Train> + </Train> + </IfOption> </Component> <Component name="PhaseManager" class="rails.game.PhaseManager"> <!-- Note: released and rusted trains are now specified per Train Modified: trunk/18xx/data/1830/Map.xml =================================================================== --- trunk/18xx/data/1830/Map.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/1830/Map.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -30,9 +30,14 @@ <Hex name="D14" tile="-102" value="20"/> <Hex name="D16" tile="0"/> <Hex name="D18" tile="0"/> - <Hex name="D20" tile="0"/> + <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields,Reading,Coalfields&Reading"> + <Hex name="D20" tile="0"/> + </IfOption> + <IfOption name="Variant" value="Wabash"> + <Hex name="D20" tile="-25007" orientation="3"/> + </IfOption> <Hex name="D22" tile="0" cost="120"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Wabash"> <Hex name="D24" tile="-7" orientation="2"/> </IfOption> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> @@ -55,6 +60,9 @@ <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> <Hex name="F2" tile="-939" orientation="5" value="40,70" city="Chicago"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Hex name="F2" tile="0"/> + </IfOption> <Hex name="F4" tile="-10" cost="80"/> <Hex name="F6" tile="-105" city="Cleveland"/> <Hex name="F8" tile="0"/> @@ -63,7 +71,7 @@ <Hex name="F14" tile="0"/> <Hex name="F16" tile="-10" cost="120"/> <Hex name="F18" tile="0"/> - <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading,Wabash"> <Hex name="F20" tile="-2"/> </IfOption> <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> @@ -71,6 +79,10 @@ </IfOption> <Hex name="F22" tile="-10" cost="80"/> <Hex name="F24" tile="-3" orientation="2"/> + <IfOption name="Variant" value="Wabash"> + <Hex name="G-1" tile="-903" value="40,70" city="Chicago"/> + <Hex name="G1" tile="0"/> + </IfOption> <Hex name="G3" tile="0"/> <Hex name="G5" tile="0"/> <Hex name="G7" tile="-2"/> @@ -80,26 +92,37 @@ <Hex name="G15" tile="0" cost="120"/> <Hex name="G17" tile="-2"/> <Hex name="G19" tile="-21" orientation="1" cost="80" city="New York"/> - <Hex name="H2" tile="0"/> + <IfOption name="Variant" value="Wabash"> + <Hex name="H-2" tile="0"/> + <Hex name="H0" tile="0"/> + <Hex name="H2" tile="-10"/> + </IfOption> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading,Coalfields,Coalfields&Reading"> + <Hex name="H2" tile="0"/> + </IfOption> <Hex name="H4" tile="-10"/> <Hex name="H6" tile="0"/> <Hex name="H8" tile="0"/> <Hex name="H10" tile="-10"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Wabash"> <Hex name="H12" tile="-101" city="Altoona" runThrough="tokenOnly"/> </IfOption> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> <Hex name="H12" tile="-30003" pic="-30002" city="Altoona" runThrough="tokenOnly"/> </IfOption> - <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields,Wabash"> <Hex name="H14" tile="0"/> </IfOption> <IfOption name="Variant" value="Reading,Coalfields&Reading"> <Hex name="H14" tile="-30007" pic="-30006" city="Reading" runThrough="tokenOnly"/> </IfOption> - <Hex name="H16" tile="-10"/> <Hex name="H18" tile="-20" label="OO"/> + <IfOption name="Variant" value="Wabash"> + <Hex name="I-3" tile="-902" orientation="5" value="30,60" city="West"/> + <Hex name="I-1" tile="0"/> + <Hex name="I1" tile="0"/> + </IfOption> <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="I1" tile="-901" orientation="5" value="30,60" city="Gulf"/> </IfOption> @@ -115,6 +138,11 @@ <Hex name="I15" tile="-11" label="B" city="Baltimore"/> <Hex name="I17" tile="0" cost="80"/> <Hex name="I19" tile="-3" orientation="2"/> + <IfOption name="Variant" value="Wabash"> + <Hex name="J-2" tile="-902" orientation="5" value="30,60" city="West"/> + <Hex name="J0" tile="0"/> + <Hex name="J2" tile="-10" city="Cincinnati"/> + </IfOption> <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Hex name="J2" tile="-902" orientation="5" value="30,60" city="Gulf"/> </IfOption> @@ -127,7 +155,7 @@ <Hex name="J10" tile="0" cost="120"/> <Hex name="J12" tile="0" cost="120"/> <Hex name="J14" tile="-10" cost="80" city="Washington"/> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Wabash"> <Hex name="K13" tile="-902" orientation="4" value="30,40" city="Deep South"/> <Hex name="K15" tile="-104" orientation="3"/> </IfOption> Modified: trunk/18xx/data/1830/TileSet.xml =================================================================== --- trunk/18xx/data/1830/TileSet.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/1830/TileSet.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -16,7 +16,7 @@ <Upgrade id="57"/> </Tile> <Tile id="-11"><!-- B yellow --> - <IfOption name="Variant" value="Basegame,Pere Marquette"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Wabash"> <Upgrade id="53"/> </IfOption> <IfOption name="Variant" value="Coalfields,Reading,Coalfields&Reading"> @@ -40,6 +40,7 @@ <Tile id="-903"/> <Tile id="-908"/><!-- Coalfields: K1 --> <Tile id="-939"/><!-- Coalfields: Chicago --> + <Tile id="-25007"/><!-- Wabash: D20--> <Tile id="-30001"/><!-- Coalfields: N of Boston --> <Tile id="-30003" pic="-30002"/><!-- Coalfields: Altoona --> <Tile id="-30004"/><!-- Coalfields: Coalfields --> @@ -82,6 +83,9 @@ <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> <Attributes quantity="4"/> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Attributes quantity="5"/> + </IfOption> <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> <Attributes quantity="6"/> </IfOption> @@ -96,7 +100,7 @@ <!-- Green tiles --> <Tile id="14"> - <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> + <IfOption name="Variant" value="Basegame,Pere Marquette,Reading,Wabash"> <Attributes quantity="3"/> </IfOption> <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> @@ -105,13 +109,15 @@ <Upgrade id="63" /> </Tile> <Tile id="15" quantity="2"> - <IfOption name="Variant" value="Basegame,Pere Marquette,Reading"> - <Attributes quantity="2"/> - </IfOption> - <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> + <IfOption name="Variant" value="Coalfields,Coalfields&Reading,Wabash"> <Attributes quantity="3"/> </IfOption> - <Upgrade id="63" /> + <IfOption name="Variant" value="Wabash"> + <Upgrade id="63,448"/> + </IfOption> + <IfOption name="Variant" value="Basegame,Pere Marquette,Coalfields,Coalfields&Reading"> + <Upgrade id="63" /> + </IfOption> </Tile> <Tile id="16" quantity="1"> <Upgrade id="43,70" /> @@ -217,4 +223,7 @@ <IfOption name="Variant" value="Coalfields,Coalfields&Reading"> <Tile id="1717" extId="G17" quantity="1" /> </IfOption> + <IfOption name="Variant" value="Wabash"> + <Tile id="448" quantity="2" /> + </IfOption> </TileManager> \ No newline at end of file Modified: trunk/18xx/data/1830/Tiles.xml =================================================================== --- trunk/18xx/data/1830/Tiles.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/1830/Tiles.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -93,6 +93,13 @@ <Track from="side3" gauge="normal" to="side2"/> <Track from="side2" gauge="normal" to="side1"/> </Tile> + <Tile colour="fixed" id="-25007" name="Bournemouth"> + <Station id="city1" position="0" slots="1" type="City" value="20"/> + <Station id="city2" position="0" slots="1" type="City" value="20"/> + <Track from="side4" gauge="normal" to="city2"/> + <Track from="side5" gauge="normal" to="city2"/> + <Track from="side0" gauge="normal" to="city2"/> + </Tile> <Tile colour="fixed" id="-30001" name="N of Boston"> <Track from="side3" gauge="normal" to="side5"/> <Track from="side3" gauge="normal" to="side4"/> @@ -433,4 +440,11 @@ <Track from="city1" gauge="normal" to="side3"/> <Track from="city1" gauge="normal" to="side4"/> </Tile> + <Tile colour="brown" id="448" name="1889 dc K brown"> + <Station id="city1" position="0" slots="2" type="City" value="40"/> + <Track from="city1" gauge="normal" to="side0"/> + <Track from="city1" gauge="normal" to="side1"/> + <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/> + </Tile> </Tiles> \ No newline at end of file Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/data/GamesList.xml 2011-05-11 16:20:08 UTC (rev 1556) @@ -28,7 +28,7 @@ - optionally, a default value (only affects a toggle; in a dropdown the first item is always the default). --> - <Option name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading,Coalfields&Reading" default="Basegame" /> + <Option name="Variant" values="Basegame,Pere Marquette,Coalfields,Reading,Coalfields&Reading,Wabash" 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" /> Modified: trunk/18xx/rails/game/MapHex.java =================================================================== --- trunk/18xx/rails/game/MapHex.java 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/rails/game/MapHex.java 2011-05-11 16:20:08 UTC (rev 1556) @@ -205,8 +205,8 @@ if (getTileOrientation() == MapHex.EW) { // Tiles with flat EW sides, letters go vertically. // Most common case. - // Tested for 1830 and 1870. - x = (column + (letterAHasEvenNumbers() ? 1 : 0)) / 2; + // Tested for 1830 and 1870. OK with 1830 Wabash and 1825R2 (negative column numbers) + x = (column + 8 + (letterAHasEvenNumbers() ? 1 : 0)) / 2 - 4; // Divisor must be >0 y = row; } else { // Tiles with flat NS sides, letters go vertically. @@ -389,6 +389,16 @@ public int getY() { return y; } + + /** Add an X offset. Required to avoid negative coordinate values, as arise in 1830 Wabash. */ + public void addX (int offset) { + x += offset; + } + + /** Add an Y offset. Required to avoid negative coordinate values. */ + public void addY (int offset) { + y += offset; + } /** * @return Returns the preprintedTileId. Modified: trunk/18xx/rails/game/MapManager.java =================================================================== --- trunk/18xx/rails/game/MapManager.java 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/rails/game/MapManager.java 2011-05-11 16:20:08 UTC (rev 1556) @@ -97,18 +97,35 @@ minRow = Math.min(minRow, hex.getRow()); maxCol = Math.max(maxCol, hex.getColumn()); maxRow = Math.max(maxRow, hex.getRow()); + //log.debug("+++ Hex "+hex.getName()+" x="+hex.getX()+" y="+hex.getY()+" row="+hex.getRow()+" col="+hex.getColumn()); int[] tileCosts = hex.getTileCostAsArray(); for (int i=0; i<tileCosts.length; i++){ possibleTileCosts.add(tileCosts[i]); } } log.debug("Possible tileCosts on map are "+possibleTileCosts); + + int xOffset = 0; + int yOffset = 0; + if (minX < 0) { + xOffset = -minX; + maxX += xOffset; + minX = 0; + } + if (minY < 0) { + yOffset = -minY; + maxY += yOffset; + minY = 0; + } hexes = new MapHex[1 + maxX][1 + maxY]; for (String hexName : mHexes.keySet()) { hex = mHexes.get(hexName); + if (xOffset > 0) hex.addX(xOffset); + if (yOffset > 0) hex.addY(yOffset); hexes[hex.getX()][hex.getY()] = hex; + //log.debug("--- Hex "+hex.getName()+" x="+hex.getX()+" y="+hex.getY()+" row="+hex.getRow()+" col="+hex.getColumn()); } } Modified: trunk/18xx/rails/game/StartRound.java =================================================================== --- trunk/18xx/rails/game/StartRound.java 2011-05-10 10:25:59 UTC (rev 1555) +++ trunk/18xx/rails/game/StartRound.java 2011-05-11 16:20:08 UTC (rev 1556) @@ -150,7 +150,7 @@ return result; } - /** Stub to allow start packets cleanups in subclasses */ + /** Stub to allow start packet cleanups in subclasses */ protected void startPacketChecks() { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |