You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(46) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
|
Apr
|
May
(14) |
Jun
|
Jul
(13) |
Aug
(30) |
Sep
(83) |
Oct
(56) |
Nov
(148) |
Dec
(107) |
2010 |
Jan
(260) |
Feb
(164) |
Mar
(183) |
Apr
(99) |
May
(160) |
Jun
(40) |
Jul
(33) |
Aug
(48) |
Sep
(22) |
Oct
(24) |
Nov
(1) |
Dec
(12) |
2011 |
Jan
(6) |
Feb
(15) |
Mar
(13) |
Apr
(37) |
May
(27) |
Jun
(29) |
Jul
(33) |
Aug
(20) |
Sep
(17) |
Oct
(20) |
Nov
(33) |
Dec
(17) |
2012 |
Jan
(39) |
Feb
(38) |
Mar
(20) |
Apr
(21) |
May
(17) |
Jun
(22) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
From: Erik V. <ev...@us...> - 2010-03-02 22:16:10
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10261/rails/game/special Modified Files: SpecialPropertyI.java Log Message: Cleanups Index: SpecialPropertyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialPropertyI.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SpecialPropertyI.java 28 Feb 2010 21:38:05 -0000 1.10 --- SpecialPropertyI.java 2 Mar 2010 22:15:13 -0000 1.11 *************** *** 4,8 **** import rails.game.CompanyI; import rails.game.ConfigurableComponentI; - import rails.game.PrivateCompanyI; import rails.game.move.Moveable; import rails.game.move.MoveableHolder; --- 4,7 ---- |
From: Erik V. <ev...@us...> - 2010-03-02 22:16:02
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10261/rails/ui/swing Modified Files: ORPanel.java Log Message: Cleanups Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ORPanel.java 14 Feb 2010 20:48:21 -0000 1.46 --- ORPanel.java 2 Mar 2010 22:15:40 -0000 1.47 *************** *** 13,17 **** import rails.game.*; import rails.game.action.*; - import rails.game.special.SpecialPropertyI; import rails.ui.swing.elements.*; import rails.util.LocalText; --- 13,16 ---- *************** *** 47,51 **** private JMenu infoMenu; private JMenuItem remainingTilesMenuItem; - private JMenu privatesInfoMenu; private JMenu trainsInfoMenu; private JMenu phasesInfoMenu; --- 46,49 ---- |
From: Erik V. <ev...@us...> - 2010-03-02 21:14:57
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820/data/18AL Modified Files: CompanyManager.xml Log Message: Improved 18AL Info (by Phil Davies) Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/CompanyManager.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** CompanyManager.xml 22 Feb 2010 23:19:09 -0000 1.28 --- CompanyManager.xml 2 Mar 2010 21:14:11 -0000 1.29 *************** *** 50,57 **** class="rails.game.specific._18AL.NamedTrainToken"> <NamedTrainToken name="RELee" ! longName=""Robert E. Lee" (Bir-Atl)" value="20" ifRouteIncludes="G4,G8" /> <NamedTrainToken name="PanAm" ! longName=""Pan American" (Nas-Mob)" value="40" ifRouteIncludes="A4,Q2" /> </NameTrains> --- 50,57 ---- class="rails.game.specific._18AL.NamedTrainToken"> <NamedTrainToken name="RELee" ! longName='"Robert E. Lee" (Birmingham - Atlanta)' value="20" ifRouteIncludes="G4,G8" /> <NamedTrainToken name="PanAm" ! longName='"Pan American" (Nashville - Mobile)' value="40" ifRouteIncludes="A4,Q2" /> </NameTrains> |
From: Erik V. <ev...@us...> - 2010-03-02 21:14:56
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820/rails/game/specific/_18AL Modified Files: NameTrains.java Log Message: Improved 18AL Info (by Phil Davies) Index: NameTrains.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18AL/NameTrains.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NameTrains.java 31 Jan 2010 22:22:33 -0000 1.6 --- NameTrains.java 2 Mar 2010 21:14:16 -0000 1.7 *************** *** 4,11 **** --- 4,13 ---- import java.util.List; + import rails.game.Bank; import rails.game.ConfigurationException; import rails.game.GameManagerI; import rails.game.move.Moveable; import rails.game.special.SpecialProperty; + import rails.util.LocalText; import rails.util.Tag; *************** *** 56,60 **** tokens.add(token); token.configureFromXML(tokenTag); ! description += token.getLongName() + ", "; } catch (Exception e) { throw new ConfigurationException("Cannot instantiate class " --- 58,62 ---- tokens.add(token); token.configureFromXML(tokenTag); ! description += token.getLongName() + ": " + Bank.format(token.getValue()) + ", "; } catch (Exception e) { throw new ConfigurationException("Cannot instantiate class " *************** *** 102,105 **** return description; } ! } --- 104,115 ---- return description; } ! ! @Override ! public String getInfo() { ! String infoText = LocalText.getText("SpecialNameTrains", ! tokens.size()); ! infoText += "<br>" + description; ! infoText.replaceFirst("NameTrains: ", ""); ! return infoText; ! } } |
From: Erik V. <ev...@us...> - 2010-03-02 21:14:56
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820/rails/game/special Modified Files: SpecialTrainBuy.java Log Message: Improved 18AL Info (by Phil Davies) Index: SpecialTrainBuy.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialTrainBuy.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SpecialTrainBuy.java 28 Feb 2010 21:38:05 -0000 1.4 --- SpecialTrainBuy.java 2 Mar 2010 21:14:16 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- import rails.game.*; + import rails.util.LocalText; import rails.util.Tag; import rails.util.Util; *************** *** 113,116 **** + extra + " deduction=" + deductionString; } ! } --- 114,135 ---- + extra + " deduction=" + deductionString; } ! ! @Override ! public String toMenu() { ! if (trainTypeName.equals("")) { ! return LocalText.getText("SpecialTrainBuyAny", ! deductionString, ! originalCompany.getName()); ! } ! else { ! return LocalText.getText("SpecialTrainBuy", ! trainTypeName, ! deductionString, ! originalCompany.getName()); ! } ! } ! ! public String getInfo() { ! return toMenu(); ! } } |
From: Erik V. <ev...@us...> - 2010-03-02 21:14:52
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820/rails/ui/swing Modified Files: ORUIManager.java Log Message: Improved 18AL Info (by Phil Davies) Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ORUIManager.java 28 Feb 2010 21:38:04 -0000 1.59 --- ORUIManager.java 2 Mar 2010 21:14:04 -0000 1.60 *************** *** 1383,1387 **** for (UseSpecialProperty usp : possibleActions.getType(UseSpecialProperty.class)) { SpecialPropertyI sp = usp.getSpecialProperty(); ! orPanel.addSpecialAction(usp, sp.getInfo()); } } --- 1383,1387 ---- for (UseSpecialProperty usp : possibleActions.getType(UseSpecialProperty.class)) { SpecialPropertyI sp = usp.getSpecialProperty(); ! orPanel.addSpecialAction(usp, sp.toMenu()); } } |
From: Erik V. <ev...@us...> - 2010-03-02 21:14:40
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3820 Modified Files: LocalisedText.properties Log Message: Improved 18AL Info (by Phil Davies) Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** LocalisedText.properties 28 Feb 2010 21:38:05 -0000 1.113 --- LocalisedText.properties 2 Mar 2010 21:14:19 -0000 1.114 *************** *** 429,433 **** --- 429,436 ---- SharesReleased={0} "{1}" shares are now available for purchase SoldEnough=May not sell anymore in this turn + SpecialNameTrains=Has {0} train name tokens which increase revenue for specific routes SpecialTile= You can lay an unconnected tile {0} on {1}. + SpecialTrainBuy=Purchase {0} train with a discount of {1}, closing {2} + SpecialTrainBuyAny=Purchase any train with a discount of {0}, closing {1} SplitNotAllowed=Splitting is not allowed in this game. StartCompany={0} (buy {1}% share for {2}) |
From: Erik V. <ev...@us...> - 2010-03-01 22:27:40
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16112/rails/game Modified Files: Company.java PublicCompany.java PrivateCompany.java Log Message: Add SP info text at the end of other info Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** PublicCompany.java 28 Feb 2010 21:38:04 -0000 1.88 --- PublicCompany.java 1 Mar 2010 22:27:31 -0000 1.89 *************** *** 270,275 **** public void configureFromXML(Tag tag) throws ConfigurationException { - super.configureFromXML(tag); - longName = tag.getAttributeAsString("longname", name); infoText = "<html>"+longName; --- 270,273 ---- *************** *** 342,345 **** --- 340,346 ---- } + // Special properties (as in the 1835 black minors) + super.configureFromXML(tag); + // TODO Normally set in the default train type. May be wrong place. // Ridiculous to reparse with each train type. *************** *** 725,728 **** --- 726,731 ---- } + infoText += parentInfoText; + parentInfoText = ""; } Index: Company.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Company.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Company.java 28 Feb 2010 21:38:04 -0000 1.14 --- Company.java 1 Mar 2010 22:27:30 -0000 1.15 *************** *** 22,25 **** --- 22,26 ---- protected Portfolio portfolio = null; protected String infoText = ""; + protected String parentInfoText = ""; /** *************** *** 76,80 **** specialProperties.add(sp); sp.configureFromXML(spTag); ! infoText += "<br>" + sp.getInfo(); } } --- 77,81 ---- specialProperties.add(sp); sp.configureFromXML(spTag); ! parentInfoText += "<br>" + sp.getInfo(); } } Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PrivateCompany.java 28 Feb 2010 21:38:05 -0000 1.37 --- PrivateCompany.java 1 Mar 2010 22:27:32 -0000 1.38 *************** *** 44,50 **** try { - // For special properties (now included in Company). - super.configureFromXML(tag); - longName= tag.getAttributeAsString("longname", name); infoText = "<html>"+longName; --- 44,47 ---- *************** *** 71,74 **** --- 68,75 ---- } + + // For special properties (now included in Company). + super.configureFromXML(tag); + // Closing conditions // Currently only used to handle closure following laying *************** *** 129,133 **** } } ! } /** Initialisation, to be called directly after instantiation (cloning) */ --- 130,137 ---- } } ! ! infoText += parentInfoText; ! parentInfoText = ""; ! } /** Initialisation, to be called directly after instantiation (cloning) */ |
From: Erik V. <ev...@us...> - 2010-03-01 22:27:20
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15980/data/1835 Modified Files: CompanyManager.xml Log Message: Removed <Info> - now redundant Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/CompanyManager.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.27 --- CompanyManager.xml 1 Mar 2010 22:27:08 -0000 1.28 *************** *** 87,91 **** as Public Companies normally have no special properties. PLEASE no not use these until further notice. --> ! <Info key="SwapPrivateForCertificate" parm="M1,5,Pr"/> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 87,91 ---- as Public Companies normally have no special properties. PLEASE no not use these until further notice. --> ! <!--Info key="SwapPrivateForCertificate" parm="M1,5,Pr"/--> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> *************** *** 96,100 **** <Company name="M2" longname="Berlin-Potsdamer Bahn" type="Minor" price="170" tokens="1"> <Home hex="E19" city="1"/> ! <Info key="SwapPrivateForCertificate" parm="M2,10,Pr"/> <SpecialProperties> <SpecialProperty condition="phase=4" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 96,100 ---- <Company name="M2" longname="Berlin-Potsdamer Bahn" type="Minor" price="170" tokens="1"> <Home hex="E19" city="1"/> ! <!--Info key="SwapPrivateForCertificate" parm="M2,10,Pr"/--> <SpecialProperties> <SpecialProperty condition="phase=4" when="exchangeRound" class="rails.game.special.ExchangeForShare"> *************** *** 105,109 **** <Company name="M3" longname="Magdeburger Bahn" type="Minor" price="80" tokens="1"> <Home hex="F14"/> ! <Info key="SwapPrivateForCertificate" parm="M3,5,Pr"/> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 105,109 ---- <Company name="M3" longname="Magdeburger Bahn" type="Minor" price="80" tokens="1"> <Home hex="F14"/> ! <!--Info key="SwapPrivateForCertificate" parm="M3,5,Pr"/--> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> *************** *** 114,118 **** <Company name="M4" longname="Köln-Mindener Bahn" type="Minor" price="160" tokens="1"> <Home hex="G5"/> ! <Info key="SwapPrivateForCertificate" parm="M4,10,Pr"/> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 114,118 ---- <Company name="M4" longname="Köln-Mindener Bahn" type="Minor" price="160" tokens="1"> <Home hex="G5"/> ! <!--Info key="SwapPrivateForCertificate" parm="M4,10,Pr"/--> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> *************** *** 123,127 **** <Company name="M5" longname="Berlin-Stettiner Bahn" type="Minor" price="80" tokens="1"> <Home hex="E19" city="2"/> ! <Info key="SwapPrivateForCertificate" parm="M5,5,Pr"/> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 123,127 ---- <Company name="M5" longname="Berlin-Stettiner Bahn" type="Minor" price="80" tokens="1"> <Home hex="E19" city="2"/> ! <!--Info key="SwapPrivateForCertificate" parm="M5,5,Pr"/--> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> *************** *** 132,136 **** <Company name="M6" longname="Altona-Kiel Bahn" type="Minor" price="80" tokens="1"> <Home hex="C11" city="1"/> ! <Info key="SwapPrivateForCertificate" parm="M6,5,Pr"/> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> --- 132,136 ---- <Company name="M6" longname="Altona-Kiel Bahn" type="Minor" price="80" tokens="1"> <Home hex="C11" city="1"/> ! <!--Info key="SwapPrivateForCertificate" parm="M6,5,Pr"/--> <SpecialProperties> <SpecialProperty condition="ifStarted" when="exchangeRound" class="rails.game.special.ExchangeForShare"> |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:16
|
Update of /cvsroot/rails/18xx/rails/game/action In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/game/action Modified Files: BuyTrain.java BuyBonusToken.java MergeCompanies.java Log Message: 1835 Prussian start & side effects Index: BuyBonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BuyBonusToken.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BuyBonusToken.java 31 Jan 2010 22:22:28 -0000 1.4 --- BuyBonusToken.java 28 Feb 2010 21:38:06 -0000 1.5 *************** *** 41,45 **** this.specialProperty = specialProperty; this.specialPropertyId = specialProperty.getUniqueId(); ! this.privateCompany = specialProperty.getCompany(); this.privateCompanyName = privateCompany.getName(); this.seller = specialProperty.getSeller(); --- 41,45 ---- this.specialProperty = specialProperty; this.specialPropertyId = specialProperty.getUniqueId(); ! this.privateCompany = (PrivateCompanyI) specialProperty.getOriginalCompany(); this.privateCompanyName = privateCompany.getName(); this.seller = specialProperty.getSeller(); Index: BuyTrain.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BuyTrain.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BuyTrain.java 31 Jan 2010 22:22:28 -0000 1.17 --- BuyTrain.java 28 Feb 2010 21:38:06 -0000 1.18 *************** *** 216,220 **** } if (specialProperty != null) { ! b.append(" using ").append(specialProperty.getCompany().getName()); } if (isForExchange()) { --- 216,220 ---- } if (specialProperty != null) { ! b.append(" using ").append(specialProperty.getOriginalCompany().getName()); } if (isForExchange()) { Index: MergeCompanies.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/MergeCompanies.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MergeCompanies.java 16 Feb 2010 20:16:07 -0000 1.7 --- MergeCompanies.java 28 Feb 2010 21:38:06 -0000 1.8 *************** *** 13,16 **** --- 13,17 ---- import rails.game.*; + import rails.game.action.PossibleAction; /** |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:14
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/ui/swing/elements Added Files: ConfirmationDialog.java Log Message: 1835 Prussian start & side effects --- NEW FILE: ConfirmationDialog.java --- /* $Header: /cvsroot/rails/18xx/rails/ui/swing/elements/ConfirmationDialog.java,v 1.1 2010/02/28 21:38:06 evos Exp $*/ package rails.ui.swing.elements; import java.awt.*; import java.awt.event.*; import javax.swing.*; import org.apache.log4j.Logger; import rails.util.LocalText; /** * A generic YES/NO dialog */ public class ConfirmationDialog extends JDialog implements ActionListener { private static final long serialVersionUID = 1L; GridBagConstraints gc; JPanel messagePane, buttonPane; JButton okButton, cancelButton; Dimension size, optSize; DialogOwner owner; String message; boolean answer = false; protected static Logger log = Logger.getLogger(ConfirmationDialog.class.getPackage().getName()); public ConfirmationDialog(DialogOwner owner, String title, String message, String okText, String cancelText) { super((Frame) null, title, false); // Non-modal this.owner = owner; this.message = message; initialize(okText, cancelText); pack(); // Center on owner /* int x = (int) owner.getLocationOnScreen().getX() + (owner.getWidth() - getWidth()) / 2; int y = (int) owner.getLocationOnScreen().getY() + (owner.getHeight() - getHeight()) / 2; */ int x = 400; int y = 400; setLocation(x, y); setVisible(true); setAlwaysOnTop(true); } private void initialize(String okText, String cancelText) { gc = new GridBagConstraints(); getContentPane().setLayout(new GridBagLayout()); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); messagePane = new JPanel(); messagePane.add(new JLabel(message)); buttonPane = new JPanel(); okButton = new JButton(LocalText.getText(okText)); // We only expect Yes/No or OK/Cancel if (okText.startsWith("O")) okButton.setMnemonic(KeyEvent.VK_O); else if (okText.startsWith("Y")) okButton.setMnemonic(KeyEvent.VK_Y); okButton.addActionListener(this); buttonPane.add(okButton); cancelButton = new JButton(LocalText.getText(cancelText)); // We only expect Yes/No or OK/Cancel if (cancelText.startsWith("C")) cancelButton.setMnemonic(KeyEvent.VK_C); else if (cancelText.startsWith("N")) cancelButton.setMnemonic(KeyEvent.VK_N); cancelButton.addActionListener(this); buttonPane.add(cancelButton); getContentPane().add(messagePane, 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)) { answer = true; } else if (arg0.getSource().equals(cancelButton)) { answer = false; } this.setVisible(false); this.dispose(); owner.dialogActionPerformed(); } public synchronized boolean getAnswer() { return answer; } } |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:14
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/ui/swing/gamespecific/_1835 Added Files: GameUIManager_1835.java StatusWindow_1835.java Log Message: 1835 Prussian start & side effects --- NEW FILE: StatusWindow_1835.java --- package rails.ui.swing.gamespecific._1835; import java.util.List; import javax.swing.JDialog; import rails.game.*; import rails.game.specific._1835.FoldIntoPrussian; import rails.game.specific._1835.PrussianFormationRound; import rails.game.specific._1835.StockRound_1835; import rails.ui.swing.GameUIManager; import rails.ui.swing.StatusWindow; import rails.ui.swing.elements.CheckBoxDialog; import rails.ui.swing.elements.ConfirmationDialog; import rails.util.LocalText; public class StatusWindow_1835 extends StatusWindow { PublicCompanyI prussian; private static final long serialVersionUID = 1L; public StatusWindow_1835() { super(); } public void init (GameUIManager gameUIManager) { super.init(gameUIManager); prussian = gameUIManager.getGameManager().getCompanyManager().getCompanyByName(StockRound_1835.PR_ID); } @Override public void updateStatus() { RoundI currentRound = gameUIManager.getCurrentRound(); if (!(currentRound instanceof PrussianFormationRound)) { super.updateStatus(); } else if (possibleActions.contains(FoldIntoPrussian.class)) { immediateAction = possibleActions.getType(FoldIntoPrussian.class).get(0); } } @Override public boolean processImmediateAction() { if (immediateAction == null) { return false; } else if (immediateAction instanceof FoldIntoPrussian) { // Make a local copy and discard the original, // so that it's not going to loop. FoldIntoPrussian nextAction = (FoldIntoPrussian) immediateAction; immediateAction = null; fold (nextAction); return true; } else { return super.processImmediateAction(); } } // Code partly copied from ORUIManager protected void fold (FoldIntoPrussian action) { List<CompanyI> foldables = action.getFoldableCompanies(); JDialog currentDialog; if (foldables.get(0).getName().equals("M2")) { // Ask if the Prussian should be started currentDialog = new ConfirmationDialog (gameUIManager, LocalText.getText("Select"), LocalText.getText("MergeMinorConfirm", "M2", StockRound_1835.PR_ID), "Yes", "No" ); } else { // Ask if any other prePrussians should be folded String[] options = new String[foldables.size()]; for (int i=0; i<=options.length; i++) { options[i] = foldables.get(i).getName(); } currentDialog = new CheckBoxDialog (gameUIManager, LocalText.getText("Select"), LocalText.getText("SelectCompaniesToFold", prussian.getLongName()), options); } gameUIManager.setCurrentDialog (currentDialog, action); } } --- NEW FILE: GameUIManager_1835.java --- package rails.ui.swing.gamespecific._1835; import java.util.ArrayList; import java.util.List; import rails.game.CompanyI; import rails.game.action.ExchangeTokens; import rails.game.specific._1835.FoldIntoPrussian; import rails.ui.swing.GameUIManager; import rails.ui.swing.elements.CheckBoxDialog; import rails.ui.swing.elements.ConfirmationDialog; public class GameUIManager_1835 extends GameUIManager { protected boolean checkGameSpecificDialogAction() { if (currentDialog instanceof ConfirmationDialog && currentDialogAction instanceof FoldIntoPrussian) { ConfirmationDialog dialog = (ConfirmationDialog) currentDialog; FoldIntoPrussian action = (FoldIntoPrussian) currentDialogAction; if (dialog.getAnswer()) { action.setFoldedCompanies(action.getFoldableCompanies()); } return true; } else if (currentDialog instanceof CheckBoxDialog && currentDialogAction instanceof FoldIntoPrussian) { CheckBoxDialog dialog = (CheckBoxDialog) currentDialog; FoldIntoPrussian action = (FoldIntoPrussian) currentDialogAction; boolean[] exchanged = dialog.getSelectedOptions(); String[] options = dialog.getOptions(); List<CompanyI> foldedCompanies = new ArrayList<CompanyI>(); for (int index=0; index < options.length; index++) { if (exchanged[index]) { foldedCompanies.add(action.getFoldableCompanies().get(index)); } } action.setFoldedCompanies(foldedCompanies); return true; } else { return false; } } } |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:14
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/util Modified Files: Util.java Log Message: 1835 Prussian start & side effects Index: Util.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Util.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Util.java 31 Jan 2010 22:22:37 -0000 1.20 --- Util.java 28 Feb 2010 21:38:06 -0000 1.21 *************** *** 35,39 **** public static String joinWithDelimiter (String[] sa, String delimiter) { ! StringBuffer b = new StringBuffer(); for (String s : sa) { if (b.length() > 0) b.append(delimiter); --- 35,39 ---- public static String joinWithDelimiter (String[] sa, String delimiter) { ! StringBuilder b = new StringBuilder(); for (String s : sa) { if (b.length() > 0) b.append(delimiter); |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:14
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/game/specific/_18EU Modified Files: FinalMinorExchangeRound.java Log Message: 1835 Prussian start & side effects Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FinalMinorExchangeRound.java 18 Jan 2010 18:49:30 -0000 1.11 --- FinalMinorExchangeRound.java 28 Feb 2010 21:38:06 -0000 1.12 *************** *** 10,13 **** --- 10,14 ---- import rails.util.LocalText; + /** * Implements a basic Stock Round. <p> A new instance must be created for each |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:14
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/game/specific/_1835 Modified Files: PrussianFormationRound.java Added Files: FoldIntoPrussian.java Log Message: 1835 Prussian start & side effects Index: PrussianFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/PrussianFormationRound.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PrussianFormationRound.java 16 Feb 2010 20:25:38 -0000 1.1 --- PrussianFormationRound.java 28 Feb 2010 21:38:06 -0000 1.2 *************** *** 5,11 **** import rails.common.GuiDef; import rails.game.*; - import rails.game.action.MergeCompanies; import rails.game.action.NullAction; ! import rails.game.action.StartCompany; import rails.util.LocalText; --- 5,14 ---- import rails.common.GuiDef; import rails.game.*; import rails.game.action.NullAction; ! import rails.game.action.PossibleAction; ! import rails.game.move.MoveSet; ! import rails.game.special.ExchangeForShare; ! import rails.game.special.SpecialPropertyI; ! import rails.game.specific._1856.PublicCompany_CGR; import rails.util.LocalText; *************** *** 64,71 **** getCurrentPlayer().getName())); ! possibleActions.add(new MergeCompanies(m2, prussian)); ! if (!forcedStart) { ! possibleActions.add(new NullAction(NullAction.PASS)); } } --- 67,89 ---- getCurrentPlayer().getName())); ! possibleActions.add(new FoldIntoPrussian(m2)); ! } else if (step == Step.MERGE) { ! SpecialPropertyI sp; ! for (PrivateCompanyI company : currentPlayer.getPortfolio().getPrivateCompanies()) { ! sp = company.getSpecialProperties().get(0); ! if (sp instanceof ExchangeForShare) { ! possibleActions.add(new FoldIntoPrussian(company)); ! } ! } ! PublicCompanyI company; ! List<SpecialPropertyI> sps; ! for (PublicCertificateI cert : currentPlayer.getPortfolio().getCertificates()) { ! if (!cert.isPresidentShare()) continue; ! company = cert.getCompany(); ! sps = company.getSpecialProperties(); ! if (sps != null && !sps.isEmpty() && sps.get(0) instanceof ExchangeForShare) { ! possibleActions.add(new FoldIntoPrussian(company)); ! } } } *************** *** 75,78 **** --- 93,209 ---- } + protected boolean processGameSpecificAction(PossibleAction action) { + + if (action instanceof FoldIntoPrussian) { + + FoldIntoPrussian a = (FoldIntoPrussian) action; + List<CompanyI> folded = a.getFoldedCompanies(); + + if (step == Step.START) { + if (folded.isEmpty() || !startPrussian(a)) { + finishRound(); + } else { + step = Step.MERGE; + } + } else if (step == Step.MERGE) { + if (!folded.isEmpty()) mergeIntoPrussian (a); + } + + return true; + } else { + return false; + } + } + + private boolean startPrussian (FoldIntoPrussian action) { + + // Validate + String errMsg = null; + + while (true) { + if (!(M2_ID.equals(action.getFoldedCompanyNames()))) { + errMsg = LocalText.getText("WrongCompany", + action.getFoldedCompanyNames(), + M2_ID); + break; + } + break; + } + + if (errMsg != null) { + DisplayBuffer.add(LocalText.getText("CannotMerge", + action.getFoldedCompanyNames(), + PR_ID, + errMsg)); + return false; + } + + moveStack.start(false); + + // Execute + prussian.start(); + String message = LocalText.getText("START_MERGED_COMPANY", + PR_ID, + Bank.format(prussian.getIPOPrice()), + prussian.getStartSpace()); + ReportBuffer.add(message); + + executeExchange (action.getFoldedCompanies(), true); + + return true; + } + + private boolean mergeIntoPrussian (FoldIntoPrussian action) { + + // Validate + String errMsg = null; + + while (true) { + break; + } + + if (errMsg != null) { + DisplayBuffer.add(LocalText.getText("CannotMerge", + action.getFoldedCompanyNames(), + PR_ID, + errMsg)); + return false; + } + + moveStack.start(false); + + // Execute + executeExchange (action.getFoldedCompanies(), true); + + return true; + } + + private void executeExchange (List<CompanyI> companies, boolean president) { + + ExchangeForShare efs; + PublicCertificateI cert; + for (CompanyI company : companies) { + // Shortcut, sp should be checked + efs = (ExchangeForShare) company.getSpecialProperties().get(0); + cert = unavailable.findCertificate(prussian, efs.getShare(), president); + cert.moveTo(currentPlayer.getPortfolio()); + company.setClosed(); + ReportBuffer.add(LocalText.getText("MERGE_MINOR_LOG", + currentPlayer.getName(), + company.getName(), + PR_ID, + company instanceof PrivateCompanyI ? "no" + : Bank.format(((PublicCompanyI)company).getCash()), + company instanceof PrivateCompanyI ? "no" + : ((PublicCompanyI)company).getPortfolio().getTrainList().size())); + ReportBuffer.add(LocalText.getText("GetShareForMinor", + currentPlayer.getName(), + cert.getShare(), + PR_ID, + ipo.getName(), + company.getName() )); + } + } + public static boolean prussianIsComplete(GameManagerI gameManager) { List<PublicCertificateI> unissued --- NEW FILE: FoldIntoPrussian.java --- package rails.game.specific._1835; import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import rails.game.*; import rails.game.action.PossibleAction; public class FoldIntoPrussian extends PossibleAction { // Server settings protected transient List<CompanyI> foldableCompanies = null; protected String foldableCompanyNames = null; // Client settings protected transient List<CompanyI> foldedCompanies = null; protected String foldedCompanyNames = null; public static final long serialVersionUID = 1L; public FoldIntoPrussian(List<CompanyI> companies) { this.foldableCompanies = companies; foldableCompanyNames = Company.joinNamesWithDelimiter (foldableCompanies, ","); } public FoldIntoPrussian(CompanyI company) { this (Arrays.asList(new CompanyI[] {company})); } public List<CompanyI> getFoldedCompanies() { return foldedCompanies; } public void setFoldedCompanies(List<CompanyI> foldedCompanies) { this.foldedCompanies = foldedCompanies; foldedCompanyNames = Company.joinNamesWithDelimiter (foldedCompanies, ","); } public List<CompanyI> getFoldableCompanies() { return foldableCompanies; } public String getFoldableCompanyNames() { return foldableCompanyNames; } public String getFoldedCompanyNames() { return foldedCompanyNames; } @Override public String toString() { StringBuilder text = new StringBuilder("Fold into Prussian:"); if (foldableCompanyNames != null) { text.append(" foldable=").append(foldableCompanyNames); } if (foldedCompanyNames != null) { text.append(" folded=").append(foldedCompanyNames); } return text.toString(); } @Override public boolean equals(PossibleAction action) { if (!(action instanceof FoldIntoPrussian)) return false; FoldIntoPrussian a = (FoldIntoPrussian) action; return a.foldableCompanyNames.equals(foldableCompanyNames); } /** Deserialize */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); CompanyManagerI cmgr = getCompanyManager(); if (foldableCompanyNames != null) { foldableCompanies = new ArrayList<CompanyI>(); for (String name : foldableCompanyNames.split(",")) { foldableCompanies.add(cmgr.getPublicCompany(name)); } } if (foldedCompanyNames != null) { foldedCompanies = new ArrayList<CompanyI>(); for (String name : foldedCompanyNames.split(",")) { foldedCompanies.add(cmgr.getPublicCompany(name)); } } } } |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:13
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/game Modified Files: Company.java PublicCompany.java StockRound.java PublicCompanyI.java OperatingRound.java CompanyI.java PrivateCompanyI.java PrivateCompany.java Log Message: 1835 Prussian start & side effects Index: CompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/CompanyI.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompanyI.java 4 Feb 2010 21:27:58 -0000 1.7 --- CompanyI.java 28 Feb 2010 21:38:05 -0000 1.8 *************** *** 2,9 **** package rails.game; /** * To be implemented by any Company object. */ ! public interface CompanyI extends ConfigurableComponentI { /** The name of the XML tag used to configure a company. */ --- 2,14 ---- package rails.game; + import java.util.List; + + import rails.game.move.MoveableHolder; + import rails.game.special.SpecialPropertyI; + /** * To be implemented by any Company object. */ ! public interface CompanyI extends ConfigurableComponentI, MoveableHolder { /** The name of the XML tag used to configure a company. */ *************** *** 18,22 **** void init(String name, CompanyTypeI type); ! // void configureFromXML (Element element) throws ConfigurationException; /** --- 23,45 ---- void init(String name, CompanyTypeI type); ! /** ! * @return ArrayList of all special properties we have. ! */ ! public List<SpecialPropertyI> getSpecialProperties(); ! ! /** ! * Do we have any special properties? ! * ! * @return Boolean ! */ ! public boolean hasSpecialProperties(); ! ! /** ! * Get the Portfolio of this company, containing all privates and ! * certificates owned.. ! * ! * @return The Portfolio of this company. ! */ ! public Portfolio getPortfolio(); /** Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** PublicCompany.java 20 Feb 2010 12:34:50 -0000 1.87 --- PublicCompany.java 28 Feb 2010 21:38:04 -0000 1.88 *************** *** 187,191 **** /** Privates and Certificates owned by the public company */ ! protected Portfolio portfolio; /** What percentage of ownership constitutes "one share" */ --- 187,191 ---- /** Privates and Certificates owned by the public company */ ! //protected Portfolio portfolio; /** What percentage of ownership constitutes "one share" */ *************** *** 270,273 **** --- 270,275 ---- public void configureFromXML(Tag tag) throws ConfigurationException { + super.configureFromXML(tag); + longName = tag.getAttributeAsString("longname", name); infoText = "<html>"+longName; *************** *** 1172,1185 **** /** - * Get the Portfolio of this company, containing all privates and - * certificates owned.. - * - * @return The Portfolio of this company. - */ - public Portfolio getPortfolio() { - return portfolio; - } - - /** * Get the percentage of shares that must be sold to float the company. * --- 1174,1177 ---- Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** PrivateCompany.java 17 Feb 2010 22:02:52 -0000 1.36 --- PrivateCompany.java 28 Feb 2010 21:38:05 -0000 1.37 *************** *** 11,15 **** public class PrivateCompany extends Company implements PrivateCompanyI { ! protected static int numberOfPrivateCompanies = 0; protected int privateNumber; // For internal use --- 11,15 ---- public class PrivateCompany extends Company implements PrivateCompanyI { ! protected static int numberOfPrivateCompanies = 0; protected int privateNumber; // For internal use *************** *** 18,22 **** // list of revenue sfy 1889 protected int[] revenue; - protected List<SpecialPropertyI> specialProperties = null; protected String auctionType; --- 18,21 ---- *************** *** 44,47 **** --- 43,50 ---- /* Configure private company features */ try { + + // For special properties (now included in Company). + super.configureFromXML(tag); + longName= tag.getAttributeAsString("longname", name); infoText = "<html>"+longName; *************** *** 60,83 **** // Special properties - Tag spsTag = tag.getChild("SpecialProperties"); - if (spsTag != null) { - - List<Tag> spTags = spsTag.getChildren("SpecialProperty"); - String className; - for (Tag spTag : spTags) { - className = spTag.getAttributeAsString("class"); - if (!Util.hasValue(className)) - throw new ConfigurationException( - "Missing class in private special property"); - - SpecialPropertyI sp = - (SpecialPropertyI) Class.forName(className).newInstance(); - sp.setCompany(this); - specialProperties.add(sp); - sp.configureFromXML(spTag); - infoText += "<br>" + sp.getInfo(); - } - } - // Extra info text(usually related to extra-share special properties) Tag infoTag = tag.getChild("Info"); --- 63,66 ---- *************** *** 334,353 **** } - /** - * @return ArrayList of all special properties we have. - */ - public List<SpecialPropertyI> getSpecialProperties() { - return specialProperties; - } - - /** - * Do we have any special properties? - * - * @return Boolean - */ - public boolean hasSpecialProperties() { - return specialProperties != null && !specialProperties.isEmpty(); - } - public List<MapHex> getBlockedHexes() { return blockedHexes; --- 317,320 ---- Index: Company.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Company.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Company.java 4 Feb 2010 21:27:58 -0000 1.13 --- Company.java 28 Feb 2010 21:38:04 -0000 1.14 *************** *** 2,9 **** --- 2,15 ---- package rails.game; + import java.util.ArrayList; + import java.util.List; + import org.apache.log4j.Logger; import rails.game.move.MoveableHolder; + import rails.game.special.SpecialPropertyI; import rails.game.state.BooleanState; + import rails.util.Tag; + import rails.util.Util; public abstract class Company implements CompanyI, ConfigurableComponentI, *************** *** 29,33 **** protected BooleanState closedObject; ! protected static Logger log = Logger.getLogger(Company.class.getPackage().getName()); --- 35,42 ---- protected BooleanState closedObject; ! ! // Moved here from PrivayeCOmpany on behalf of 1835 ! protected List<SpecialPropertyI> specialProperties = null; ! protected static Logger log = Logger.getLogger(Company.class.getPackage().getName()); *************** *** 42,45 **** --- 51,110 ---- } + /** Only to be called from subclasses */ + public void configureFromXML(Tag tag) throws ConfigurationException { + + // Special properties + Tag spsTag = tag.getChild("SpecialProperties"); + if (spsTag != null) { + + List<Tag> spTags = spsTag.getChildren("SpecialProperty"); + String className; + for (Tag spTag : spTags) { + className = spTag.getAttributeAsString("class"); + if (!Util.hasValue(className)) + throw new ConfigurationException( + "Missing class in private special property"); + SpecialPropertyI sp = null; + try { + sp = (SpecialPropertyI) Class.forName(className).newInstance(); + } catch (Exception e) { + log.fatal ("Cannot instantiate "+className, e); + System.exit(-1); + } + sp.setCompany(this); + if (specialProperties == null) specialProperties = new ArrayList<SpecialPropertyI>(2); + specialProperties.add(sp); + sp.configureFromXML(spTag); + infoText += "<br>" + sp.getInfo(); + } + } + } + + /** + * @return ArrayList of all special properties we have. + */ + public List<SpecialPropertyI> getSpecialProperties() { + return specialProperties; + } + + /** + * Do we have any special properties? + * + * @return Boolean + */ + public boolean hasSpecialProperties() { + return specialProperties != null && !specialProperties.isEmpty(); + } + + /** + * Get the Portfolio of this company, containing all privates and + * certificates owned.. + * + * @return The Portfolio of this company. + */ + public Portfolio getPortfolio() { + return portfolio; + } + /** * @return This company's number *************** *** 160,162 **** --- 225,237 ---- } + public static String joinNamesWithDelimiter (List<CompanyI> companies, String delimiter) { + StringBuilder b = new StringBuilder(""); + if (companies != null) { + for (CompanyI company : companies) { + if (b.length() > 0) b.append(delimiter); + b.append(company.getName()); + } + } + return b.toString(); + } } Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** PublicCompanyI.java 20 Feb 2010 12:34:46 -0000 1.48 --- PublicCompanyI.java 28 Feb 2010 21:38:05 -0000 1.49 *************** *** 216,220 **** public int getFloatPercentage(); ! public Portfolio getPortfolio(); public void payout(int amount); --- 216,220 ---- public int getFloatPercentage(); ! //public Portfolio getPortfolio(); public void payout(int amount); Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** OperatingRound.java 26 Feb 2010 08:51:08 -0000 1.109 --- OperatingRound.java 28 Feb 2010 21:38:05 -0000 1.110 *************** *** 1641,1645 **** oldHolder.getName(), Bank.format(price), ! stb.getCompany().getName() )); } --- 1641,1645 ---- oldHolder.getName(), Bank.format(price), ! stb.getOriginalCompany().getName() )); } Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** StockRound.java 24 Feb 2010 18:08:36 -0000 1.64 --- StockRound.java 28 Feb 2010 21:38:05 -0000 1.65 *************** *** 1097,1101 **** PublicCompanyI publicCompany = companyManager.getPublicCompany(sp.getPublicCompanyName()); ! PrivateCompanyI privateCompany = sp.getCompany(); Portfolio portfolio = privateCompany.getPortfolio(); Player player = null; --- 1097,1101 ---- PublicCompanyI publicCompany = companyManager.getPublicCompany(sp.getPublicCompanyName()); ! CompanyI privateCompany = sp.getOriginalCompany(); Portfolio portfolio = privateCompany.getPortfolio(); Player player = null; Index: PrivateCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PrivateCompanyI.java 3 Feb 2010 05:37:54 -0000 1.9 --- PrivateCompanyI.java 28 Feb 2010 21:38:05 -0000 1.10 *************** *** 5,9 **** import rails.game.move.MoveableHolder; - import rails.game.special.SpecialPropertyI; public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder { --- 5,8 ---- *************** *** 29,37 **** public int getRevenueByPhase(PhaseI phase); - /** - * @return ArrayList of all special properties we have. - */ - public List<SpecialPropertyI> getSpecialProperties(); - public List<MapHex> getBlockedHexes(); --- 28,31 ---- |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:13
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856 Modified Files: LocalisedText.properties .classpath Log Message: 1835 Prussian start & side effects Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** LocalisedText.properties 23 Feb 2010 22:21:40 -0000 1.112 --- LocalisedText.properties 28 Feb 2010 21:38:05 -0000 1.113 *************** *** 73,76 **** --- 73,77 ---- CannotLayBaseTokenOn={0} cannot lay a base token on {1} for {2}: {3} CannotLayTileOn={0} cannot lay tile {1} on {2} for {3}: {4} + CannotMerge={0} cannot merge into {1}: {2} CannotPayOutRevenue={0} cannot pay out revenue of {1}: {2} CannotProcessRevenue=Cannot process revenue {0} of {1}: {2} *************** *** 187,191 **** GameReportTitle=Rails: Game Report GameSetupFailed=Game setup from file {0} failed ! GetShareForMinor={0} gets a {1}% share of {2} from {3} in exchange for Minor {4} GetNoShareForMinor={0} does not get a share for Minor {1}, which closes Has={0} has {1} --- 188,192 ---- GameReportTitle=Rails: Game Report GameSetupFailed=Game setup from file {0} failed ! GetShareForMinor={0} gets a {1}% share of {2} from {3} in exchange for {4} GetNoShareForMinor={0} does not get a share for Minor {1}, which closes Has={0} has {1} *************** *** 273,276 **** --- 274,278 ---- NEW=New NewGame=New Game + No=No NoBaseTokenExchange={0} does not exchange the {1} base token on {2} noCost=no cost *************** *** 389,392 **** --- 391,395 ---- SelectLoansToRepay=Select number of loans of {0} to repay SelectMinorToMerge=Select the minor to merge to start company {0} + SelectCompaniesToFold=Select any companies to fold into {0} SelectNoBid=Select, No Bid SelectTrain=Select a train and press OK, or press Done. *************** *** 525,528 **** --- 528,532 ---- WrongPlayer=Wrong player {0} - {1} has the turn WrongStartItem=Wrong start item {0}, expected {1} + Yes=Yes YOU_MAY_ADD_CASH=(you may add up to {0}) YOU_MUST_ADD_CASH=(you must add {0}) Index: .classpath =================================================================== RCS file: /cvsroot/rails/18xx/.classpath,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** .classpath 9 Oct 2007 21:45:38 -0000 1.13 --- .classpath 28 Feb 2010 21:38:05 -0000 1.14 *************** *** 1,34 **** <?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/batik-transcoder.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-dom.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-bridge.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-util.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-gvt.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-script.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-ext.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-awt-util.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/extensions/batik-squiggle-ext.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-css.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-extension.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-gui-util.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-parser.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-svg-dom.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-svggen.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-swing.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/lib/batik-xml.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/batik-1.6/batik-rasterizer.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/batik-slideshow.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/batik-squiggle.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/batik-svgpp.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/batik-1.6/batik-ttf2svg.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/log4j-1.2/log4j-1.2.14.jar"/> ! <classpathentry kind="output" path="classes"/> </classpath> --- 1,34 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry path="" kind="src"/> ! <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true" kind="con"/> ! <classpathentry path="lib/batik-1.6/batik.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-transcoder.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-dom.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-bridge.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-util.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-gvt.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-script.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-ext.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-awt-util.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/extensions/batik-squiggle-ext.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-css.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-extension.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-gui-util.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-parser.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-svg-dom.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-svggen.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-swing.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/batik-xml.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/js.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/pdf-transcoder.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/xerces_2_5_0.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/lib/xml-apis.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/batik-rasterizer.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/batik-slideshow.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/batik-squiggle.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/batik-svgpp.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/batik-1.6/batik-ttf2svg.jar" exported="true" kind="lib"/> ! <classpathentry path="lib/log4j-1.2/log4j-1.2.14.jar" exported="true" kind="lib"/> ! <classpathentry path="classes" kind="output"/> </classpath> |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:13
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/data/1835 Modified Files: Game.xml Log Message: 1835 Prussian start & side effects Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Game.xml 20 Feb 2010 23:06:58 -0000 1.27 --- Game.xml 28 Feb 2010 21:38:05 -0000 1.28 *************** *** 1,6 **** <?xml version="1.0"?> <ComponentManager> ! <Component name="GameManager" class="rails.game.GameManager"> ! <!--Component name="GameManager" class="rails.game.specific._1835.GameManager_1835"--> <Game name="1835"/> <GameOption name="Variant" values="Standard,Clemens,Snake"/> --- 1,6 ---- <?xml version="1.0"?> <ComponentManager> ! <!--Component name="GameManager" class="rails.game.GameManager"--> ! <Component name="GameManager" class="rails.game.specific._1835.GameManager_1835"> <Game name="1835"/> <GameOption name="Variant" values="Standard,Clemens,Snake"/> *************** *** 16,19 **** --- 16,23 ---- </StockRound> </GameParameters> + <GuiClasses> + <StatusWindow class="rails.ui.swing.gamespecific._1835.StatusWindow_1835"/> + <GameUIManager class="rails.ui.swing.gamespecific._1835.GameUIManager_1835"/> + </GuiClasses> <EndOfGame> <BankBreaks limit="0" finish="currentOR"/> |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:13
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/game/special Modified Files: SpecialTileLay.java SellBonusToken.java SpecialTrainBuy.java LocatedBonus.java SpecialProperty.java ExchangeForShare.java SpecialPropertyI.java SpecialTokenLay.java Log Message: 1835 Prussian start & side effects Index: LocatedBonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/LocatedBonus.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LocatedBonus.java 31 Jan 2010 22:22:30 -0000 1.3 --- LocatedBonus.java 28 Feb 2010 21:38:05 -0000 1.4 *************** *** 72,76 **** @Override public String toString() { ! return "LocatedBonus "+name+" comp=" + privateCompany.getName() + " hex=" + locationCodes + " value=" + value; } --- 72,76 ---- @Override public String toString() { ! return "LocatedBonus "+name+" comp=" + originalCompany.getName() + " hex=" + locationCodes + " value=" + value; } Index: SpecialTokenLay.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialTokenLay.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SpecialTokenLay.java 31 Jan 2010 22:22:30 -0000 1.13 --- SpecialTokenLay.java 28 Feb 2010 21:38:05 -0000 1.14 *************** *** 129,133 **** @Override public String toString() { ! return "SpecialTokenLay comp=" + privateCompany.getName() + " type=" + tokenClass.getSimpleName() + ": " + (token != null ? token.toString() : "") + " hex=" --- 129,133 ---- @Override public String toString() { ! return "SpecialTokenLay comp=" + originalCompany.getName() + " type=" + tokenClass.getSimpleName() + ": " + (token != null ? token.toString() : "") + " hex=" Index: SpecialPropertyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialPropertyI.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SpecialPropertyI.java 6 Feb 2010 23:48:26 -0000 1.9 --- SpecialPropertyI.java 28 Feb 2010 21:38:05 -0000 1.10 *************** *** 2,5 **** --- 2,6 ---- package rails.game.special; + import rails.game.CompanyI; import rails.game.ConfigurableComponentI; import rails.game.PrivateCompanyI; *************** *** 9,15 **** public interface SpecialPropertyI extends ConfigurableComponentI, Moveable { ! public void setCompany(PrivateCompanyI company); ! public PrivateCompanyI getCompany(); public boolean isExecutionable(); --- 10,16 ---- public interface SpecialPropertyI extends ConfigurableComponentI, Moveable { ! public void setCompany(CompanyI company); ! public CompanyI getOriginalCompany(); public boolean isExecutionable(); Index: SpecialTileLay.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialTileLay.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SpecialTileLay.java 3 Feb 2010 05:37:55 -0000 1.11 --- SpecialTileLay.java 28 Feb 2010 21:38:05 -0000 1.12 *************** *** 125,129 **** @Override public String toString() { ! return "SpecialTileLay comp=" + privateCompany.getName() + " hex=" + locationCodes + " extra=" + extra + " cost=" + free + " connected=" + connected; } --- 125,129 ---- @Override public String toString() { ! return "SpecialTileLay comp=" + originalCompany.getName() + " hex=" + locationCodes + " extra=" + extra + " cost=" + free + " connected=" + connected; } Index: SpecialProperty.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialProperty.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SpecialProperty.java 6 Feb 2010 23:48:26 -0000 1.24 --- SpecialProperty.java 28 Feb 2010 21:38:05 -0000 1.25 *************** *** 15,19 **** public abstract class SpecialProperty implements SpecialPropertyI { ! protected PrivateCompanyI privateCompany; protected MoveableHolder holder = null; protected int closingValue = 0; --- 15,19 ---- public abstract class SpecialProperty implements SpecialPropertyI { ! protected CompanyI originalCompany; protected MoveableHolder holder = null; protected int closingValue = 0; *************** *** 97,102 **** } ! public void setCompany(PrivateCompanyI company) { ! privateCompany = company; holder = company; exercised = --- 97,102 ---- } ! public void setCompany(CompanyI company) { ! originalCompany = company; holder = company; exercised = *************** *** 105,110 **** } ! public PrivateCompanyI getCompany() { ! return privateCompany; } --- 105,110 ---- } ! public CompanyI getOriginalCompany() { ! return originalCompany; } *************** *** 181,185 **** if (permanent) return; // sfy 1889 exercised.set(value); ! if (value) privateCompany.checkClosingIfExercised(false); } --- 181,187 ---- if (permanent) return; // sfy 1889 exercised.set(value); ! if (value && originalCompany instanceof PrivateCompanyI) { ! ((PrivateCompanyI)originalCompany).checkClosingIfExercised(false); ! } } *************** *** 218,222 **** public String toString() { return getClass().getSimpleName() + " of private " ! + privateCompany.getName(); } --- 220,224 ---- public String toString() { return getClass().getSimpleName() + " of private " ! + originalCompany.getName(); } Index: SpecialTrainBuy.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialTrainBuy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpecialTrainBuy.java 3 Oct 2009 14:00:06 -0000 1.3 --- SpecialTrainBuy.java 28 Feb 2010 21:38:05 -0000 1.4 *************** *** 110,114 **** public String toString() { ! return "SpecialTrainBuy comp=" + privateCompany.getName() + " extra=" + extra + " deduction=" + deductionString; } --- 110,114 ---- public String toString() { ! return "SpecialTrainBuy comp=" + originalCompany.getName() + " extra=" + extra + " deduction=" + deductionString; } Index: ExchangeForShare.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/ExchangeForShare.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ExchangeForShare.java 4 Feb 2010 21:27:59 -0000 1.16 --- ExchangeForShare.java 28 Feb 2010 21:38:05 -0000 1.17 *************** *** 32,43 **** public boolean isExecutionable() { ! return privateCompany.getPortfolio().getOwner() instanceof Player; ! } ! ! /** ! * @return Returns the privateCompany. ! */ ! public PrivateCompanyI getPrivateCompany() { ! return privateCompany; } --- 32,36 ---- public boolean isExecutionable() { ! return holder instanceof Player; } *************** *** 62,66 **** @Override public String toString() { ! return "Swap " + privateCompany.getName() + " for " + share + "% share of " + publicCompanyName; } --- 55,59 ---- @Override public String toString() { ! return "Swap " + originalCompany.getName() + " for " + share + "% share of " + publicCompanyName; } *************** *** 69,73 **** public String toMenu() { return LocalText.getText("SwapPrivateForCertificate", ! privateCompany.getName(), share, publicCompanyName ); --- 62,66 ---- public String toMenu() { return LocalText.getText("SwapPrivateForCertificate", ! originalCompany.getName(), share, publicCompanyName ); Index: SellBonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SellBonusToken.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SellBonusToken.java 31 Jan 2010 22:22:30 -0000 1.6 --- SellBonusToken.java 28 Feb 2010 21:38:05 -0000 1.7 *************** *** 107,111 **** @Override public String toString() { ! return "SellBonusToken comp=" + privateCompany.getName() + " hex=" + locationCodes + " value=" + value + " price=" + price + " max="+maxNumberToSell+" sold="+numberSold.intValue(); --- 107,111 ---- @Override public String toString() { ! return "SellBonusToken comp=" + originalCompany.getName() + " hex=" + locationCodes + " value=" + value + " price=" + price + " max="+maxNumberToSell+" sold="+numberSold.intValue(); |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:12
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7856/rails/ui/swing Modified Files: ORUIManager.java UpgradesPanel.java GameUIManager.java Log Message: 1835 Prussian start & side effects Index: UpgradesPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/UpgradesPanel.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** UpgradesPanel.java 31 Jan 2010 22:22:34 -0000 1.23 --- UpgradesPanel.java 28 Feb 2010 21:38:04 -0000 1.24 *************** *** 120,124 **** description = text = comp.getName(); if (action.getSpecialProperty() != null) { ! description += " (" + action.getSpecialProperty().getCompany().getName()+")"; } } else if (action instanceof LayBonusToken) { --- 120,124 ---- description = text = comp.getName(); if (action.getSpecialProperty() != null) { ! description += " (" + action.getSpecialProperty().getOriginalCompany().getName()+")"; } } else if (action instanceof LayBonusToken) { Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** ORUIManager.java 24 Feb 2010 21:09:33 -0000 1.58 --- ORUIManager.java 28 Feb 2010 21:38:04 -0000 1.59 *************** *** 851,855 **** if (bTrain.hasSpecialProperty()) { String priv = ! (bTrain.getSpecialProperty()).getCompany().getName(); b.append(" ").append(LocalText.getText("USING_SP", priv)); usingPrivates += ", " + priv; --- 851,855 ---- if (bTrain.hasSpecialProperty()) { String priv = ! (bTrain.getSpecialProperty()).getOriginalCompany().getName(); b.append(" ").append(LocalText.getText("USING_SP", priv)); usingPrivates += ", " + priv; Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** GameUIManager.java 31 Jan 2010 22:22:34 -0000 1.39 --- GameUIManager.java 28 Feb 2010 21:38:04 -0000 1.40 *************** *** 499,504 **** if (!ready) { ! ! if (currentDialog instanceof RadioButtonDialog && currentDialogAction instanceof StartCompany) { --- 499,506 ---- if (!ready) { ! ! if (checkGameSpecificDialogAction()) { ! ; ! } else if (currentDialog instanceof RadioButtonDialog && currentDialogAction instanceof StartCompany) { *************** *** 570,573 **** --- 572,580 ---- } + /** Stub, can be overridden by subclasses */ + protected boolean checkGameSpecificDialogAction() { + return false; + } + public JDialog getCurrentDialog() { return currentDialog; |
From: Erik V. <ev...@us...> - 2010-02-28 21:38:00
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7839/rails/ui/swing/gamespecific/_1835 Log Message: Directory /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1835 added to the repository |
From: Stefan F. <ste...@us...> - 2010-02-26 08:51:26
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15189/rails/game Modified Files: OperatingRound.java Log Message: Fix of 2954654: Missing default value of doneAllowed in setPossibleActions of OperatingRound. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** OperatingRound.java 26 Feb 2010 08:04:14 -0000 1.108 --- OperatingRound.java 26 Feb 2010 08:51:08 -0000 1.109 *************** *** 2042,2046 **** if (repayment > 0) executeRepayLoans (action); ! doneAllowed = true; return true; --- 2042,2047 ---- if (repayment > 0) executeRepayLoans (action); ! // doneAllowed = true; ! // has no effect, overwritten in setPossibleActions(), fix of bug 2954654 return true; *************** *** 2144,2147 **** --- 2145,2149 ---- public boolean setPossibleActions() { + int operatingCompanyIndex = operatingCompanyIndexObject.intValue(); operatingCompany = operatingCompanyArray[operatingCompanyIndex]; *************** *** 2152,2155 **** --- 2154,2158 ---- boolean forced = false; + doneAllowed = false; // set default (fix of bug 2954654) if (getStep() == GameDef.OrStep.INITIAL) { |
From: Stefan F. <ste...@us...> - 2010-02-26 08:04:27
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4652/rails/game Modified Files: OperatingRound.java Log Message: Fix of the undo tile lay bug (ID : 2954642, 2954984) After undo the number of tile lays is not updated correctly. TileLaysPerColour is state variable. Adds GenericState class. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** OperatingRound.java 24 Feb 2010 21:09:23 -0000 1.107 --- OperatingRound.java 26 Feb 2010 08:04:14 -0000 1.108 *************** *** 12,16 **** import rails.game.state.EnumState; import rails.game.state.IntegerState; ! import rails.game.state.State; import rails.util.LocalText; --- 12,16 ---- import rails.game.state.EnumState; import rails.game.state.IntegerState; ! import rails.game.state.GenericState; import rails.util.LocalText; *************** *** 47,52 **** protected List<LayTile> currentNormalTileLays = new ArrayList<LayTile>(); ! protected Map<String, Integer> tileLaysPerColour = ! new HashMap<String, Integer>(); protected List<LayBaseToken> currentNormalTokenLays = --- 47,53 ---- protected List<LayTile> currentNormalTileLays = new ArrayList<LayTile>(); ! // protected Map<String, Integer> tileLaysPerColour = ! // new HashMap<String, Integer>(); ! protected GenericState<Map<String,Integer>> tileLaysPerColourState = null; protected List<LayBaseToken> currentNormalTokenLays = *************** *** 446,450 **** protected boolean checkNormalTileLay(TileI tile, boolean update) { ! if (tileLaysPerColour.isEmpty()) return false; String colour = tile.getColourName(); --- 447,453 ---- protected boolean checkNormalTileLay(TileI tile, boolean update) { ! ! Map<String,Integer> tileLaysPerColour = tileLaysPerColourState.getObject(); ! if (tileLaysPerColour.isEmpty()) return false; String colour = tile.getColourName(); *************** *** 463,476 **** * different colours may be laid. THIS MAY NOT BE TRUE FOR ALL GAMES! */ if (oldAllowedNumber <= 1) { ! tileLaysPerColour.clear(); log.debug("No more normal tile lays allowed"); currentNormalTileLays.clear(); } else { ! tileLaysPerColour.clear(); // Remove all other colours ! tileLaysPerColour.put(colour, new Integer(oldAllowedNumber - 1)); log.debug((oldAllowedNumber - 1) + " more " + colour + " tile lays allowed"); } return true; --- 466,484 ---- * different colours may be laid. THIS MAY NOT BE TRUE FOR ALL GAMES! */ + + Map<String,Integer> tileLaysPerColourUpdated = new HashMap<String, Integer>(); // new (empty) map + if (oldAllowedNumber <= 1) { ! // tileLaysPerColour.clear(); log.debug("No more normal tile lays allowed"); currentNormalTileLays.clear(); } else { ! // tileLaysPerColour.clear(); // Remove all other colours ! tileLaysPerColourUpdated.put(colour, new Integer(oldAllowedNumber - 1)); log.debug((oldAllowedNumber - 1) + " more " + colour + " tile lays allowed"); } + + tileLaysPerColourState.set(tileLaysPerColourUpdated); return true; *************** *** 1230,1234 **** if (step == GameDef.OrStep.LAY_TRACK) { ! getNormalTileLays(); } else if (step == GameDef.OrStep.LAY_TOKEN) { --- 1238,1242 ---- if (step == GameDef.OrStep.LAY_TRACK) { ! // getNormalTileLays(); } else if (step == GameDef.OrStep.LAY_TOKEN) { *************** *** 1256,1262 **** protected void getNormalTileLays() { ! tileLaysPerColour = new HashMap<String, Integer>(getCurrentPhase().getTileColours()); // Clone ! // it. int allowedNumber; for (String colour : tileLaysPerColour.keySet()) { --- 1264,1270 ---- protected void getNormalTileLays() { ! Map<String,Integer> tileLaysPerColour = new HashMap<String, Integer>(getCurrentPhase().getTileColours()); // Clone ! int allowedNumber; for (String colour : tileLaysPerColour.keySet()) { *************** *** 1265,1268 **** --- 1273,1279 ---- tileLaysPerColour.put(colour, new Integer(allowedNumber)); } + + // store state + tileLaysPerColourState = new GenericState<Map<String,Integer>>("tileLaysPerColour", tileLaysPerColour); } *************** *** 1271,1274 **** --- 1282,1288 ---- /* Normal tile lays */ currentNormalTileLays.clear(); + + Map<String,Integer> tileLaysPerColour = (Map<String,Integer>)(tileLaysPerColourState.getObject()); + if (!tileLaysPerColour.isEmpty()) { currentNormalTileLays.add(new LayTile(tileLaysPerColour)); *************** *** 2144,2147 **** --- 2158,2162 ---- nextStep (GameDef.OrStep.LAY_TOKEN); } else { + getNormalTileLays(); // new: only called once per turn ? setStep (GameDef.OrStep.LAY_TRACK); } |
From: Stefan F. <ste...@us...> - 2010-02-26 08:04:26
|
Update of /cvsroot/rails/18xx/rails/game/state In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4652/rails/game/state Added Files: GenericState.java Log Message: Fix of the undo tile lay bug (ID : 2954642, 2954984) After undo the number of tile lays is not updated correctly. TileLaysPerColour is state variable. Adds GenericState class. --- NEW FILE: GenericState.java --- /* $Header: /cvsroot/rails/18xx/rails/game/state/GenericState.java,v 1.1 2010/02/26 08:04:17 stefanfrey Exp $*/ package rails.game.state; import rails.game.model.ModelObject; import rails.game.move.StateChange; public final class GenericState<E> extends ModelObject implements StateI { private String stateName; private E stateObject; public GenericState(String name, E object) { stateName = name; if (object == null) { new Exception("NULL object not allowed in creating State wrapper").printStackTrace(); } else { stateObject = object; } } public void set(E object, boolean forced) { if (object == null) { if (stateObject != null) new StateChange(this, object); } else if (!object.equals(stateObject) || forced) new StateChange(this, object); } public void set(E object) { set(object, false); } public void setForced(E object) { set(object, true); } public E getObject() { return stateObject; } /** Must only be called by the Move execute() and undo() methods */ public void setState(Object object) { @SuppressWarnings("unchecked") E objE = (E)object; stateObject = objE; update(); } public String getName() { return stateName; } @Override public String getText() { if (stateObject != null) { return stateObject.toString(); } else { return ""; } } @Override public String toString() { return stateName; } } |
From: Stefan F. <ste...@us...> - 2010-02-24 22:11:00
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13909/rails/game Modified Files: MapHex.java Log Message: Fixes undo bug for blocked home hex (bug #2954645) Changed isBlocked attribute of MapHex to BooleanState Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** MapHex.java 16 Feb 2010 20:16:07 -0000 1.38 --- MapHex.java 24 Feb 2010 22:10:45 -0000 1.39 *************** *** 12,15 **** --- 12,16 ---- import rails.game.move.Moveable; import rails.game.move.TileMove; + import rails.game.state.BooleanState; import rails.util.*; *************** *** 84,88 **** protected Map<Integer, City> mCities; ! protected boolean isBlocked = false; protected Map<PublicCompanyI, City> homes; --- 85,93 ---- protected Map<Integer, City> mCities; ! /* ! * changed to state variable to fix undo bug #2954645 ! * null as default implies false - see isBlocked() ! */ ! private BooleanState isBlockedState = null; protected Map<PublicCompanyI, City> homes; *************** *** 884,899 **** */ public boolean isBlocked() { ! return isBlocked; } /** ! * @param isBlocked The isBlocked to set. */ public void setBlocked(boolean isBlocked) { ! this.isBlocked = isBlocked; } public boolean isUpgradeableNow() { ! if (isBlocked) { log.debug("Hex " + name + " is blocked"); return false; --- 889,910 ---- */ public boolean isBlocked() { ! if (isBlockedState == null) ! return false; ! else ! return isBlockedState.booleanValue(); } /** ! * @param isBlocked The isBlocked to set (state variable) */ public void setBlocked(boolean isBlocked) { ! if (isBlockedState == null) ! isBlockedState = new BooleanState("isBlocked", isBlocked); ! else ! isBlockedState.set(isBlocked); } public boolean isUpgradeableNow() { ! if (isBlocked()) { log.debug("Hex " + name + " is blocked"); return false; |