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. |