From: <wak...@us...> - 2010-09-15 15:44:21
|
Revision: 1420 http://rails.svn.sourceforge.net/rails/?rev=1420&view=rev Author: wakko666 Date: 2010-09-15 15:44:14 +0000 (Wed, 15 Sep 2010) Log Message: ----------- Apply 1825 patch from Phil Davies <de...@gm...> Modified Paths: -------------- trunk/18xx/data/1825/CompanyManager.xml trunk/18xx/data/1825/Game.xml trunk/18xx/data/1825/Map.xml trunk/18xx/data/1825/StockMarket.xml trunk/18xx/data/1825/TileSet.xml trunk/18xx/data/1825/Tiles.xml trunk/18xx/data/GamesList.xml trunk/18xx/rails/game/PublicCompany.java trunk/18xx/rails/game/PublicCompanyI.java Added Paths: ----------- trunk/18xx/rails/game/specific/_1825/ trunk/18xx/rails/game/specific/_1825/OperatingRound_1825.java trunk/18xx/rails/game/specific/_1825/PublicCompany_1825.java trunk/18xx/rails/game/specific/_1825/StartRound_1825.java trunk/18xx/rails/game/specific/_1825/StockRound_1825.java Modified: trunk/18xx/data/1825/CompanyManager.xml =================================================================== --- trunk/18xx/data/1825/CompanyManager.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/CompanyManager.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -2,10 +2,10 @@ <CompanyManager> <CompanyType name="Private" class="rails.game.PrivateCompany"> </CompanyType> - <CompanyType name="Public" class="rails.game.PublicCompany"> - <PoolPaysOut/> + + <CompanyType name="Public" class="rails.game.specific._1825.PublicCompany_1825"> <Float percentage="60"/> - <ShareUnit percentage="10"/> + <StockPrice par="yes"></StockPrice><ShareUnit percentage="10"/> <BaseTokens> <!-- HomeBase lay options: "whenStarted", "whenFloated", "firstOR" (default) --> ` <HomeBase lay="firstOR"/> @@ -14,8 +14,9 @@ </BaseTokens> <Certificate type="President" shares="2"/> <Certificate shares="1" number="8"/> - <Trains number="4,4,3,-1,-1"/> - </CompanyType> + <Trains number="4,4,3"/> + <TileLays> + <Number colour="yellow" number="2" phase="1,2,3,4,5"></Number></TileLays></CompanyType> <Company name="S&M" type="Private" basePrice="30" revenue="5" longname="Swansea and Mumbles"> </Company> <Company name="CHP" type="Private" basePrice="75" revenue="12" @@ -31,39 +32,47 @@ <!-- Note two supported colour specification formats: RGB decimal with commas and RGB hexadecimal without commas --> <Company name="LNWR" type="Public" tokens="6" fgColour="FFFFFF" - bgColour="000000" longname="London & North Western Railway"> + bgColour="000000" longname="London & North Western Railway" startspace="P1"> <Home hex="T16" /> </Company> <Company name="GWR" type="Public" tokens="6" fgColour="FFFFFF" - bgColour="006600" longname="Great Western Railway"> + bgColour="006600" longname="Great Western Railway" available="no" + startspace="O1"> <Home hex="V14" /> </Company> - - + + <Company name="LSWR" type="Public" tokens="5" fgColour="000000" - bgColour="99FF66" longname="London & South Western Railway"> - <Home hex="V20" city="1"/> + bgColour="99FF66" longname="London & South Western Railway" + available="no" startspace="M1"> + <Home hex="V20" city="6" /> </Company> <Company name="GER" type="Public" tokens="5" fgColour="FFFFFF" - bgColour="000066" longname="Great Eastern"> - <Home hex="V20" city="5" /> + bgColour="000066" longname="Great Eastern" available="no" + startspace="M1"> + <Home hex="V20" city="4" /> </Company> - <Company name="SECR" type="Public" tokens="5" fgColour="000000" bgColour="FFFF00" - longname="South Eastern & Chatham Railway"> + <Company name="SECR" type="Public" tokens="5" fgColour="000000" + bgColour="FFFF00" longname="South Eastern & Chatham Railway" + available="no" startspace="L1"> <Home hex="W23"></Home> </Company> <Company name="LBSC" type="Public" tokens="4" fgColour="000000" - bgColour="FF9900" longname="London, Brighton & South Coast Railway"> + bgColour="FF9900" + longname="London, Brighton & South Coast Railway" available="no" + startspace="K1"> <Home hex="X20"></Home> </Company> - - <StartPacket roundClass="rails.game.specific._1851.StartRound_1851"> + + <StartPacket roundClass="rails.game.specific._1825.StartRound_1825"> <Item name="S&M" type="Private" basePrice="30"/> <Item name="CHP" type="Private" basePrice="75"/> <Item name="C&W" type="Private" basePrice="130"/> <Item name="L&M" type="Private" basePrice="210"/> <IfOption name="NumberOfPlayers" value="5"> - <Item name="LNWR" type="Public" president="yes"></Item></IfOption></StartPacket> + <Item name="LNWR" type="Public" president="yes" + basePrice="200"> + </Item></IfOption></StartPacket> <StockRoundRules> <!-- Will probably move later to a GameManager XML--> <NoSaleInFirstSR/> Modified: trunk/18xx/data/1825/Game.xml =================================================================== --- trunk/18xx/data/1825/Game.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/Game.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -15,18 +15,20 @@ <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" /> <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" /> <GameOption name="SeparateSalesAtSamePrice" type="toggle" default="yes"/> - <PlayerShareLimit percentage="100"/> - <BankPoolLimit percentage="100"></BankPoolLimit> <EndOfGame> <Bankruptcy/> - <BankBreaks limit="0" finish="setOfORs"/> + <BankBreaks limit="0" finish="CurrentOR"/> <!-- "Runs out"; when "broken", -1 is the limit --> </EndOfGame> - </Component> + <GameParameters><PlayerShareLimit percentage="100" /><BankPoolShareLimit percentage="100"></BankPoolShareLimit> + <StockRound sequence="SellBuySell" class="rails.game.specific._1825.StockRound_1825"> + <NoSaleInFirstSR></NoSaleInFirstSR></StockRound> + <OperatingRound class="rails.game.specific._1825.OperatingRound_1825"></OperatingRound></GameParameters></Component> <Component name="PlayerManager" class="rails.game.PlayerManager"> - <Players number="3" cash="800" certLimit="20"/> - <Players number="4" cash="630" certLimit="16"/> - <Players number="5" cash="504" certLimit="13"/> + <Players number="2" cash="1200" certLimit="24"/> + <Players number="3" cash="830" certLimit="16"/> + <Players number="4" cash="630" certLimit="12"/> + <Players number="5" cash="504" certLimit="10"/> </Component> <Component name="Bank" class="rails.game.Bank"> <Bank amount="12000"/> @@ -80,10 +82,7 @@ number="3"> </OperatingRounds> </Phase> - <Phase name="4"> - <Tiles colour="yellow,green,brown,grey"/> - </Phase> - <Phase name="5"> - </Phase> </Component> + <Component name="RevenueManager" class="rails.algorithms.RevenueManager"> + </Component> </ComponentManager> Modified: trunk/18xx/data/1825/Map.xml =================================================================== --- trunk/18xx/data/1825/Map.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/Map.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -1,4 +1,16 @@ <Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="vertical" even="R"> + <!-- The Q row doesn't exist on the board - it is there to facilitate edge tile placement--> + <Hex name="Q9" tile="0"/> + <Hex name="Q11" tile="0"/> + <Hex name="Q13" tile="0"/> + <Hex name="Q15" tile="0"/> + <Hex name="Q17" tile="0"/> + <Hex name="Q19" tile="0"/> + <Hex name="Q21" tile="0"/> + <Hex name="Q23" tile="0"/> + <Hex name="Q25" tile="0"/> + <Hex name="Q27" tile="0"/> + <!-- End of nonexistent Q row --> <Hex name="R8" tile="0"/> <Hex name="R10" tile="-1" city="Shrewsbury" orientation="3" /> <Hex name="R12" tile="-20" orientation="1" city="Wolverhampton, Walsall"/> Modified: trunk/18xx/data/1825/StockMarket.xml =================================================================== --- trunk/18xx/data/1825/StockMarket.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/StockMarket.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -1,38 +1,39 @@ <StockMarket type="linear"> <!-- Note two supported colour specification formats: RGB decimal with commas and RGB hexadecimal without commas --> - - <StockSpace name="A1" price="0"/> - <StockSpace name="B1" price="5"/> - <StockSpace name="C1" price="10"/> - <StockSpace name="D1" price="16"/> - <StockSpace name="E1" price="24"></StockSpace> - <StockSpace name="F1" price="34"/> - <StockSpace name="G1" price="42"/> - <StockSpace name="H1" price="49"/> - <StockSpace name="I1" price="55" /> - <StockSpace name="J1" price="61"></StockSpace> - <StockSpace name="A2" price="67"> - <StartSpace></StartSpace></StockSpace> - <StockSpace name="B2" price="71"> - <StartSpace></StartSpace></StockSpace> - <StockSpace name="C2" price="76"> - <StartSpace></StartSpace></StockSpace> - <StockSpace name="D2" price="82"/> - <StockSpace name="E2" price="90"> - <StartSpace></StartSpace></StockSpace> - <StockSpace name="F2" price="100"> - <StartSpace></StartSpace></StockSpace> - <StockSpace name="G2" price="112"/> - <StockSpace name="H2" price="126" /> - <StockSpace name="I2" price="142" /> - <StockSpace name="A3" price="160"/> - <StockSpace name="B3" price="180"/> - <StockSpace name="C3" price="205"></StockSpace> - <StockSpace name="D3" price="230"/> - <StockSpace name="E3" price="255"/> - <StockSpace name="F3" price="280"/> - <StockSpace name="G3" price="300"/> - <StockSpace name="H3" price="320"/> - <StockSpace name="I3" price="340" /> + <StockSpaceType name="yellow" colour="255,255,0"> + <NoCertLimit/> + </StockSpaceType> + <StockSpace name="A1" price="0" type="yellow"> + <ClosesCompany/> + </StockSpace> + <StockSpace name="B1" price="5" type="yellow"/> + <StockSpace name="C1" price="10" type="yellow"/> + <StockSpace name="D1" price="16" type="yellow"/> + <StockSpace name="E1" price="24" type="yellow"/> + <StockSpace name="F1" price="34" type="yellow"/> + <StockSpace name="G1" price="42" type="yellow"/> + <StockSpace name="H1" price="49" type="yellow"/> + <StockSpace name="I1" price="55"/> + <StockSpace name="J1" price="61"/> + <StockSpace name="K1" price="67"/> + <StockSpace name="L1" price="71"/> + <StockSpace name="M1" price="76"/> + <StockSpace name="N1" price="82"/> + <StockSpace name="O1" price="90"/> + <StockSpace name="P1" price="100"/> + <StockSpace name="Q1" price="112"/> + <StockSpace name="R1" price="126"/> + <StockSpace name="S1" price="142"/> + <StockSpace name="T1" price="160"/> + <StockSpace name="U1" price="180"/> + <StockSpace name="V1" price="205"/> + <StockSpace name="W1" price="230"/> + <StockSpace name="X1" price="255"/> + <StockSpace name="Y1" price="280"/> + <StockSpace name="Z1" price="300"/> + <StockSpace name="[1" price="320"/> + <StockSpace name="\1" price="340"> + <GameOver/> + </StockSpace> </StockMarket> Modified: trunk/18xx/data/1825/TileSet.xml =================================================================== --- trunk/18xx/data/1825/TileSet.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/TileSet.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -13,7 +13,7 @@ <Upgrade id="5,6"/> </Tile> <Tile id="-20"><!-- 2 OO cities --> - <Upgrade id="52" relayBaseTokens="yes"/> + <Upgrade id="1052" relayBaseTokens="yes"/> </Tile> <Tile id="-5"><!--Dover--></Tile> <Tile id="-7"><!--Preprinted tight bend--></Tile> @@ -47,7 +47,7 @@ <Tile id="8" quantity="8" > <Upgrade id="16,19,23,24,25,28,29"></Upgrade></Tile> <Tile id="9" quantity="7" > - <Upgrade id="19,23,24,25,28,29"></Upgrade></Tile> + <Upgrade id="19,20,23,24,26,27"></Upgrade></Tile> <Tile id="55" quantity="1"> <Upgrade id="14"></Upgrade> </Tile> @@ -94,8 +94,8 @@ <Tile id="29" quantity="1"> <Upgrade id="45"></Upgrade> </Tile> - <Tile id="52" quantity="2"> - <Upgrade id="34"></Upgrade> + <Tile id="1052" quantity="2"> + <Upgrade id="64,65,66,67,68"></Upgrade> </Tile> <Tile id="87" quantity="1"> </Tile> Modified: trunk/18xx/data/1825/Tiles.xml =================================================================== --- trunk/18xx/data/1825/Tiles.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/1825/Tiles.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -1,38 +1,27 @@ -<?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"> +<?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"> + </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"> + </Tile><Tile colour="white" id="-10" name="1 city"> <Station id="city1" position="302" slots="1" type="City"/> - </Tile> - <Tile colour="yellow" id="-20" name="2 cities"> + </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="fixed" id="-5" name="MF 5"> + </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"> + </Tile><Tile colour="fixed" id="-7" name="MF 7"> <Track from="side2" gauge="normal" to="side1"/> - </Tile> - <Tile colour="fixed" id="-41" name="-41"> + </Tile><Tile colour="fixed" id="-41" name="-41"> <Track from="side0" gauge="normal" to="side3"/> <Track from="side4" gauge="normal" to="side0"/> <Track from="side4" gauge="normal" to="side3"/> - </Tile> - <Tile colour="fixed" id="-104" name="MF 104"> + </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="green" id="-25001" name="London"> + </Tile><Tile colour="green" id="-25001" name="London"> <Station id="city1" position="403" slots="1" type="City" value="50"/> <Station id="city2" position="503" slots="1" type="City" value="50"/> <Station id="city3" position="003" slots="1" type="City" value="50"/> @@ -45,196 +34,160 @@ <Track from="side2" gauge="normal" to="city5"/> <Track from="side1" gauge="normal" to="city4"/> <Track from="side0" gauge="normal" to="city3"/> - </Tile> - <Tile colour="green" id="-25002" name="Birmingham"> + </Tile><Tile colour="green" id="-25002" name="Birmingham"> <Station id="city1" position="402" slots="1" type="City" value="40"/> <Station id="city2" position="002" slots="1" type="City" value="40"/> <Station id="city3" position="202" slots="1" type="City" value="40"/> <Track from="city1" gauge="normal" to="side4"/> <Track from="city3" gauge="normal" to="side2"/> <Track from="side0" gauge="normal" to="city2"/> - </Tile> - <Tile colour="green" id="-25003" name="Bristol"> + </Tile><Tile colour="green" id="-25003" name="Bristol"> <Station id="city1" position="0" slots="1" type="City" value="30"/> <Track from="side3" gauge="normal" to="city1"/> <Track from="city1" gauge="normal" to="side1"/> - </Tile> - <Tile colour="fixed" id="-25004" name="Wolverton"> + </Tile><Tile colour="fixed" id="-25004" name="Wolverton"> <Station id="city1" position="0" slots="1" type="City" value="10"/> <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="side2"/> - </Tile> - <Tile colour="fixed" id="-25005" name="Swindon"> + </Tile><Tile colour="fixed" id="-25005" name="Swindon"> <Station id="city1" position="0" slots="1" type="City" value="10"/> <Track from="side4" gauge="normal" to="city1"/> <Track from="side5" gauge="normal" to="city1"/> <Track from="city1" gauge="normal" to="side1"/> <Track from="city1" gauge="normal" to="side2"/> - </Tile> - <Tile colour="fixed" id="-25006" name="Southend"> + </Tile><Tile colour="fixed" id="-25006" name="Southend"> <Station id="city1" position="102" slots="1" type="City" value="20"/> <Track from="side4" gauge="normal" to="side0"/> <Track from="side4" gauge="normal" to="city1"/> <Track from="side3" gauge="normal" to="side2"/> - </Tile> - <Tile colour="fixed" id="-25007" name="Bournemouth"> + </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="yellow" id="1" name="1"> + </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"> + </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"> + </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"> + </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"> + </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"> + </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"> + </Tile><Tile colour="yellow" id="7" name="7"> <Track from="side3" gauge="normal" to="side4"/> - </Tile> - <Tile colour="yellow" id="8" name="8"> + </Tile><Tile colour="yellow" id="8" name="8"> <Track from="side3" gauge="normal" to="side5"/> - </Tile> - <Tile colour="yellow" id="9" name="9"> + </Tile><Tile colour="yellow" id="9" name="9"> <Track from="side3" gauge="normal" to="side0"/> - </Tile> - <Tile colour="yellow" id="55" name="55"> + </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"> + </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="green" id="12" name="12"> + </Tile><Tile colour="green" id="12" name="12"> <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="green" id="13" name="13"> + </Tile><Tile colour="green" id="13" name="13"> <Station id="city1" position="0" slots="1" 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"/> - </Tile> - <Tile colour="green" id="14" name="14"> + </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"> + </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"> + </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="19" name="19"> + </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"> + </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"> + </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"> + </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"> + </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"> + </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"> + </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"> + </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"> + </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="52" name="52"> - <Station id="city1" position="0" slots="2" type="City" value="30"/> - <Track from="city1" gauge="normal" to="side5"/> - <Track from="city1" gauge="normal" to="side0"/> + </Tile><Tile colour="green" id="1052" name="52"> + <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="side2"/> - <Track from="city1" gauge="normal" to="side4"/> - </Tile> - <Tile colour="green" id="87" name="87"> + <Track from="city2" gauge="normal" to="side4"/> + </Tile><Tile colour="green" id="87" name="87"> <Station id="city1" position="0" type="Town" value="10"/> <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="88" name="88"> + </Tile><Tile colour="green" id="88" name="88"> <Station id="city1" position="0" type="Town" value="10"/> <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="32" name="32"> + </Tile><Tile colour="brown" id="32" name="32"> <Station id="city1" position="303" slots="1" type="City" value="70"/> <Station id="city2" position="403" slots="1" type="City" value="70"/> <Station id="city3" position="503" slots="1" type="City" value="70"/> @@ -247,8 +200,7 @@ <Track from="city3" gauge="normal" to="side5"/> <Track from="city2" gauge="normal" to="side4"/> <Track from="city1" gauge="normal" to="side3"/> - </Tile> - <Tile colour="brown" id="34" name="34"> + </Tile><Tile colour="brown" id="34" name="34"> <Station id="city1" position="352" slots="1" type="City" value="50"/> <Station id="city2" position="052" slots="1" type="City" value="50"/> <Station id="city3" position="502" slots="1" type="City" value="50"/> @@ -256,80 +208,68 @@ <Track from="city1" gauge="normal" to="side4"/> <Track from="city3" gauge="normal" to="side2"/> <Track from="city3" gauge="normal" to="side5"/> - </Tile> - <Tile colour="brown" id="38" name="38"> + </Tile><Tile colour="brown" id="38" name="38"> <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="41" name="41"> + </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"> + </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="45" name="45"> + </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"> + </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"> + </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="64" name="64"> + </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"> + </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"> + </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"> + </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"> + </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> -</Tiles> \ No newline at end of file + </Tile></Tiles> \ No newline at end of file Modified: trunk/18xx/data/GamesList.xml =================================================================== --- trunk/18xx/data/GamesList.xml 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/data/GamesList.xml 2010-09-15 15:44:14 UTC (rev 1420) @@ -201,9 +201,31 @@ (c) 1994 Hartland Trefoil Ltd. Designed by Francis Tresham -Limitation: -- No random assignment of private companies (players should do this off-line and enter the result) - </Description> +Known Issues: +- BUG: prompt on placing GWR token when upgrading London, needs investigation +- BUG: Trains do not have to own a train and directors cannot fund the purchase of one +- Tile lays that send track off the board are legal in 1825 as long as they don't run into the + sea or the edge of a pre-placed tile with no track on. Currently Rails will not allow some + of these edge placements. The workaround is to use map correction mode to place the tile you want. + ADDITIONAL NOTE: Map correction might still not work, I think route awareness is confused by track going out of the board... + We might need a different fix +- Upgrades to pre-printed tiles are lays, not promotions so you are allowed two of these in a turn. + Rails currently only allows you to lay 2 yellow tiles in a turn. Again, use map correction + for a workaround +- The rule about the two tiles place on your turn not being adjacent is currently not enforced by rails + and must be enforced manually by players +- Revenue Calc: Routes BEGIN and END with large stations, this is currently not checked +- Revenue Calc: Trains may not visit two stations on the same tile, this is currently not checked +- Revenue Calc: 2 2T's can be double headed as a 3T +- The minimum £10 for a train purchase between companies is not enforced +- Money: The boardgame uses company credits, rails does not, as such the bank will potentially break slightly earlier +- Game currently doesn't end when a company reaches the top of the stock market + It needs to end at the end of that companies turn. +- Hexags reserved for certain companies (currently not enforced in EU either) +- Corps that reach the top of the market should end the game at the end of that corps turn +- Not implemented: selling privates back to the bank +- Not implemented: receivership +</Description> <Players minimum="3" maximum="5" /> <Option name="RouteAwareness" values="Highlight,Deactivate" default="Highlight" /> <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Suggest" /> Modified: trunk/18xx/rails/game/PublicCompany.java =================================================================== --- trunk/18xx/rails/game/PublicCompany.java 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/rails/game/PublicCompany.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -269,6 +269,8 @@ protected StockMarketI stockMarket; protected MapManager mapManager; + //PD: used to track floatation order for games that need this (1825) + protected int formationOrderIndex = 0; /** * The constructor. The way this class is instantiated does not allow * arguments. @@ -2007,5 +2009,13 @@ public String getExtraShareMarks () { return ""; } + + public int getFormationOrderIndex() { + return formationOrderIndex; + } + public void setFormationOrderIndex(int formationOrderIndex) { + this.formationOrderIndex = formationOrderIndex; + } + } Modified: trunk/18xx/rails/game/PublicCompanyI.java =================================================================== --- trunk/18xx/rails/game/PublicCompanyI.java 2010-09-10 21:57:19 UTC (rev 1419) +++ trunk/18xx/rails/game/PublicCompanyI.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -358,7 +358,7 @@ public ModelObject getInGameModel (); public ModelObject getIsClosedModel (); - - + public int getFormationOrderIndex (); + public void setFormationOrderIndex (int formationOrderIndex); } Added: trunk/18xx/rails/game/specific/_1825/OperatingRound_1825.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/OperatingRound_1825.java (rev 0) +++ trunk/18xx/rails/game/specific/_1825/OperatingRound_1825.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -0,0 +1,40 @@ +package rails.game.specific._1825; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import rails.game.GameManagerI; +import rails.game.OperatingRound; +import rails.game.PublicCompanyI; + +public class OperatingRound_1825 extends OperatingRound { + + public OperatingRound_1825(GameManagerI gameManager) { + super(gameManager); + } + + @Override + public List<PublicCompanyI> setOperatingCompanies() { + Map<Integer, PublicCompanyI> operatingCompanies = new TreeMap<Integer, PublicCompanyI>(); + int space; + int key; + for (PublicCompanyI company : companyManager.getAllPublicCompanies()) { + if (!canCompanyOperateThisRound(company)) continue; + // Key must put companies in reverse operating order, because sort + // is ascending. + space = company.getIPOPrice(); + //Corps operate in descending IPO price + //Corps with the same IPO price operate in the order they were floated + //IPO price will inherently be in the right order + //subtracting the formation order index will put it at the right point to operate + //This wouldn't work if there are lots of corps at the same price + //there are not too many corps in each banding for this to be an issue in 1825 even with all 3 units + key = 1000000 - (space - company.getFormationOrderIndex()); + operatingCompanies.put(new Integer(key), company); + } + return new ArrayList<PublicCompanyI>(operatingCompanies.values()); + } + +} \ No newline at end of file Property changes on: trunk/18xx/rails/game/specific/_1825/OperatingRound_1825.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1825/PublicCompany_1825.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/PublicCompany_1825.java (rev 0) +++ trunk/18xx/rails/game/specific/_1825/PublicCompany_1825.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -0,0 +1,48 @@ +package rails.game.specific._1825; + +import rails.game.PublicCompany; +import rails.game.PublicCompanyI; + +public class PublicCompany_1825 extends PublicCompany { + + + @Override + public void payout(int amount) { + if (amount == 0) return; + //Get current price + int curSharePrice = currentPrice.getPrice().getPrice(); + // Move the token + // Work out number of spaces to move by dividing amount by current share price and rounding + // Move stock token a number of times equal to this multiplier + if (hasStockPrice){ + float shareMultiplier = amount/(float)curSharePrice; + if(shareMultiplier<1){ + shareMultiplier = Math.round(shareMultiplier); + }else{ + shareMultiplier = (float)Math.floor(shareMultiplier); + } + + for (int i = 0; i < shareMultiplier && i < 4; i++) { + stockMarket.payOut(this); + } + } + } + + @Override + public void setFloated() { + super.setFloated(); + + //Need to find out if other corps exist at this IPO price + //If so increment formationOrderIndex to control Operating sequence + for (PublicCompanyI company : gameManager.getAllPublicCompanies()) { + if (this.getIPOPrice() == company.getIPOPrice() && (this.getName() != company.getName())){ + //Yes, we share IPO prices, has this other company been launched yet? + if (company.hasFloated()){ + //it has, we need to skip ahead of this corp + formationOrderIndex++; + } + } + + } + } +} Property changes on: trunk/18xx/rails/game/specific/_1825/PublicCompany_1825.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1825/StartRound_1825.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/StartRound_1825.java (rev 0) +++ trunk/18xx/rails/game/specific/_1825/StartRound_1825.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -0,0 +1,133 @@ +package rails.game.specific._1825; + +import java.util.List; + +import rails.game.*; +import rails.game.action.*; +import rails.util.LocalText; + +public class StartRound_1825 extends StartRound { + + /** + * Constructor, only to be used in dynamic instantiation. + */ + public StartRound_1825(GameManagerI gameManager) { + super(gameManager); + hasBidding = false; + } + + /** + * Start the 1825-style start round. + * + * @param startPacket The startpacket to be sold in this start round. + */ + @Override + public void start() { + super.start(); + + if (!setPossibleActions()) { + /* + * If nobody can do anything, keep executing Operating and Start + * rounds until someone has got enough money to buy one of the + * remaining items. The game mechanism ensures that this will + * ultimately be possible. + */ + finishRound(); + } + + } + + /** + * Get a list + * + * @return An array of start items that can be bought. + */ + + @Override + public boolean setPossibleActions() { + + StartItemAction action; + List<StartItem> startItems = startPacket.getItems(); + boolean itemAvailable = false; + int soldShares = 0; + possibleActions.clear(); + + for (StartItem item : startItems) { + //Do we already have an item available for sale? + if (itemAvailable == false){ + //If not, check whether this has already been sold + if (!item.isSold()){ + item.setStatus(StartItem.BUYABLE); + possibleActions.add(action = + new BuyStartItem(item, item.getBasePrice(), false)); + log.debug(getCurrentPlayer().getName() + " may: " + + action.toString()); + //Found one, no need to find any others + itemAvailable = true; + } + } + } + //Does everyone have at least one private? + //If so, then we're officially into the first share round so passing is allowed + for (StartItem item : startItems) { + if (item.isSold()){ + soldShares++; + } + if (soldShares == playerManager.getPlayers().size()){ + //Enable passing + possibleActions.add(new NullAction(NullAction.PASS)); + } + } + return true; + } + + @Override + public List<StartItem> getStartItems() { + Player currentPlayer = getCurrentPlayer(); + int cashToSpend = currentPlayer.getCash(); + List<StartItem> startItems = startPacket.getItems(); + + for (StartItem item : startItems) { + if (item.isSold()) { + item.setStatus(StartItem.SOLD); + } else if (item.getBasePrice() > cashToSpend) { + item.setStatus(StartItem.UNAVAILABLE); + } else { + item.setStatus(StartItem.BUYABLE); + } + } + return startItems; + } + + @Override + public boolean bid(String playerName, BidStartItem item) { + + DisplayBuffer.add(LocalText.getText("InvalidAction")); + return false; + } + + /** + * Process a player's pass. + * + * @param playerName The name of the current player (for checking purposes). + */ + @Override + public boolean pass(String playerName) { + ReportBuffer.add(LocalText.getText("PASSES", playerName)); + numPasses.add(1); + if (numPasses.intValue() >= numPlayers) { + //Everyone has passed + ReportBuffer.add(LocalText.getText("ALL_PASSED")); + numPasses.set(0); + finishRound(); + } + setNextPlayer(); + return true; + } + + @Override + public String getHelp() { + return "1825 Start Round help text"; + } + +} Property changes on: trunk/18xx/rails/game/specific/_1825/StartRound_1825.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: trunk/18xx/rails/game/specific/_1825/StockRound_1825.java =================================================================== --- trunk/18xx/rails/game/specific/_1825/StockRound_1825.java (rev 0) +++ trunk/18xx/rails/game/specific/_1825/StockRound_1825.java 2010-09-15 15:44:14 UTC (rev 1420) @@ -0,0 +1,82 @@ +/** + * This class implements the 1835 rules for making new companies + * being available in the IPO after buying shares of another company. + */ +package rails.game.specific._1825; + +import java.util.ArrayList; +import java.util.List; + +import rails.game.*; + +public class StockRound_1825 extends StockRound { + + protected int[] priceBands = {100,90,82,76,71,67}; + private List<PublicCompanyI> lPublicCompanies = companyManager.getAllPublicCompanies(); + /** + * 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_1825 (GameManagerI aGameManager) { + super (aGameManager); + } + + protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { + // Sales do not affect share price, do nothing + } + + /** + * In 1825, whenever a company is sold out, the block of companies with the next lowest price become available. + * + * Hopefully this logic is generic enough to withstand any combination of units for future implementation + * + * @param boughtfrom The portfolio from which a certificate has been bought. + * @param company The company of which a share has been traded. + */ + @Override + protected void gameSpecificChecks (Portfolio boughtFrom, PublicCompanyI company) { + if (boughtFrom != ipo) return; + + int sharesInIPO = ipo.getShare(company); + + // Check for group releases + if (sharesInIPO == 0) { + //Need to release the next block of companies + + //First find out what price band we were just in + //then find out what the next price band is + //then cycle through companies to find ones at that price + //then set them buyable + for (int i = 0; i < priceBands.length; i++) { + if (priceBands[i] == company.getParPriceModel().getPrice().getPrice()) { + //Found the price band we were in + //We had better break out now if it was the last price band or the next loop + //will run infinitely + if (priceBands[i] == priceBands[priceBands.length - 1]) return; + List<PublicCompanyI> lCompaniesToRelease = new ArrayList<PublicCompanyI>(); + while (lCompaniesToRelease.isEmpty()) { + //while loop needed in case we have no corps at the next valid price band + for (int k = 0; k < companyManager.getAllPublicCompanies().size(); k++){ + //for each public company + if (lPublicCompanies.get(k).getIPOPrice() == priceBands[i+1]){ + //this companies IPO matches the next price band value, add it to the list + lCompaniesToRelease.add(lPublicCompanies.get(k)); + } + } + //If we found corps the loop won't repeat, if we didn't we need the next price band + i++; + } + //We should have found some companies to release now, so do that + for (int j = 0; j < lCompaniesToRelease.size(); j++) { + releaseCompanyShares(lCompaniesToRelease.get(j)); + lCompaniesToRelease.get(j).setBuyable(true); + } + } + } + } + + } + +} Property changes on: trunk/18xx/rails/game/specific/_1825/StockRound_1825.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. |