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...> - 2009-12-28 14:53:10
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27496/rails/game Modified Files: OperatingRound.java Log Message: 1856: allowing unlimited Bridge/Tunnel bonus tokens as a game option Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** OperatingRound.java 27 Dec 2009 18:30:11 -0000 1.85 --- OperatingRound.java 28 Dec 2009 14:53:00 -0000 1.86 *************** *** 2013,2017 **** // i.e. properties that are available to everyone? List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { SellBonusToken sbt; loop: for (SpecialPropertyI sp : commonSP) { --- 2013,2017 ---- // i.e. properties that are available to everyone? List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { SellBonusToken sbt; loop: for (SpecialPropertyI sp : commonSP) { |
From: Erik V. <ev...@us...> - 2009-12-28 14:53:10
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27496 Modified Files: LocalisedText.properties Log Message: 1856: allowing unlimited Bridge/Tunnel bonus tokens as a game option Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** LocalisedText.properties 7 Dec 2009 17:48:53 -0000 1.86 --- LocalisedText.properties 28 Dec 2009 14:53:00 -0000 1.87 *************** *** 420,423 **** --- 420,424 ---- UnexpectedAction=Unexpected action: {0} UNDO=Undo + UnlimitedBonusTokens=Unlimited bonus tokens UnlimitedTopTrains=Unlimited {0}-trains UnnamedCompany=Unnamed company found. |
From: Erik V. <ev...@us...> - 2009-12-28 14:53:09
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27496/rails/util Modified Files: Tag.java Util.java Log Message: 1856: allowing unlimited Bridge/Tunnel bonus tokens as a game option Index: Util.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Util.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Util.java 13 Dec 2009 16:39:49 -0000 1.16 --- Util.java 28 Dec 2009 14:53:00 -0000 1.17 *************** *** 115,119 **** } } - //getLogger().debug("+++ String:"+s+" Color:"+c); return c; } --- 115,118 ---- Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Tag.java 30 Oct 2009 21:53:04 -0000 1.11 --- Tag.java 28 Dec 2009 14:53:00 -0000 1.12 *************** *** 299,307 **** String optionValue = gameOptions.get(name); if (optionValue == null) { - log.warn("GameOption " + name + "=" + value - + " but no assigned value found"); // Take the default value ! optionValue = ! GameOption.getByName(name).getDefaultValue(); } --- 299,307 ---- String optionValue = gameOptions.get(name); if (optionValue == null) { // Take the default value ! optionValue = ! GameOption.getByName(name).getDefaultValue(); ! log.warn("GameOption " + name + "=" + value ! + " but no assigned value found, assumed "+optionValue); } |
From: Erik V. <ev...@us...> - 2009-12-28 14:53:09
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27496/data Modified Files: GamesList.xml Log Message: 1856: allowing unlimited Bridge/Tunnel bonus tokens as a game option Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GamesList.xml 26 Dec 2009 10:08:31 -0000 1.16 --- GamesList.xml 28 Dec 2009 14:53:00 -0000 1.17 *************** *** 59,62 **** --- 59,63 ---- </Description> <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> + <Option name="UnlimitedBonusTokens" type="toggle" default="no"/> <Players minimum="3" maximum="6"/> </Game> |
From: Erik V. <ev...@us...> - 2009-12-28 14:52:14
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27440/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Minor cleanup Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** GUIHex.java 20 Dec 2009 15:03:11 -0000 1.31 --- GUIHex.java 28 Dec 2009 14:52:05 -0000 1.32 *************** *** 343,348 **** p = getTokenCenter (1, 0, getHexModel().getCities().size(), city.getNumber()-1); - //log.debug("+++ Home of "+company.getName()+" hex"+getName()+" city"+city.getName() - // + " x="+(p.x)+" y="+(p.y)); drawHome (g2, company, p); } --- 343,346 ---- *************** *** 358,369 **** if (getHexModel().equals(hex)) { g2.drawString( ! "(" + p.getName() + ")", ! rectBound.x ! + (rectBound.width - fontMetrics.stringWidth("(" ! + p.getName() ! + ")")) ! * 1 / 2, ! rectBound.y ! + ((fontMetrics.getHeight() + rectBound.height) * 5 / 15)); } } --- 356,367 ---- if (getHexModel().equals(hex)) { g2.drawString( ! "(" + p.getName() + ")", ! rectBound.x ! + (rectBound.width - fontMetrics.stringWidth("(" ! + p.getName() ! + ")")) ! * 1 / 2, ! rectBound.y ! + ((fontMetrics.getHeight() + rectBound.height) * 5 / 15)); } } |
From: Erik V. <ev...@us...> - 2009-12-28 14:50:14
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27289/rails/game Modified Files: GameManager.java Log Message: Clear display buffer after reload Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** GameManager.java 28 Dec 2009 13:19:21 -0000 1.72 --- GameManager.java 28 Dec 2009 14:50:04 -0000 1.73 *************** *** 784,787 **** --- 784,789 ---- if (moveStack.isOpen()) moveStack.finish(); } + + DisplayBuffer.clear(); return true; } |
From: Erik V. <ev...@us...> - 2009-12-28 13:21:25
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21015/rails/game Modified Files: PublicCompany.java Log Message: Fixed bookkeeping on sold bonus tokens, in particular in relation to dropping duplicate tokens acquired by the CGR Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** PublicCompany.java 13 Dec 2009 16:39:48 -0000 1.74 --- PublicCompany.java 28 Dec 2009 13:21:13 -0000 1.75 *************** *** 1533,1536 **** --- 1533,1538 ---- if (sp instanceof SellBonusToken) { ((SellBonusToken)sp).setSeller(this); + // Also note 1 has been used + ((SellBonusToken)sp).setExercised(); } spsToMoveToGM.add(sp); *************** *** 1542,1545 **** --- 1544,1548 ---- for (SpecialPropertyI sp : spsToMoveToGM) { sp.moveTo(gameManager); + log.debug("SP "+sp.getName()+" is now a common property"); } } |
From: Erik V. <ev...@us...> - 2009-12-28 13:21:23
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21015/rails/game/special Modified Files: SellBonusToken.java Log Message: Fixed bookkeeping on sold bonus tokens, in particular in relation to dropping duplicate tokens acquired by the CGR Index: SellBonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SellBonusToken.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SellBonusToken.java 26 Dec 2009 13:53:01 -0000 1.3 --- SellBonusToken.java 28 Dec 2009 13:21:12 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- import rails.game.*; + import rails.game.state.IntegerState; import rails.game.state.State; import rails.util.Tag; *************** *** 18,22 **** private int value; private int maxNumberToSell; ! private int numberSold = 0; @Override --- 19,23 ---- private int value; private int maxNumberToSell; ! private IntegerState numberSold; @Override *************** *** 46,49 **** --- 47,52 ---- seller = new State ("SellerOf_"+name+"_Bonus", CashHolder.class); + + numberSold = new IntegerState ("Bonus_"+name+"_sold", 0); } *************** *** 56,64 **** @Override public void setExercised () { ! numberSold++; ! if (maxNumberToSell >= 0 && numberSold >= maxNumberToSell) { ! super.setExercised(); ! } } public boolean isExecutionable() { return true; --- 59,73 ---- @Override public void setExercised () { ! numberSold.add(1); ! } ! ! public void makeResellable () { ! numberSold.add(-1); } + + public boolean isExercised () { + return maxNumberToSell >= 0 && numberSold.intValue() >= maxNumberToSell; + } + public boolean isExecutionable() { return true; *************** *** 96,100 **** public String toString() { return "SellBonusToken comp=" + privateCompany.getName() + " hex=" ! + locationCodes + " value=" + value + " price=" + price; } --- 105,110 ---- public String toString() { return "SellBonusToken comp=" + privateCompany.getName() + " hex=" ! + locationCodes + " value=" + value + " price=" + price ! + " sold="+numberSold.intValue(); } |
From: Erik V. <ev...@us...> - 2009-12-28 13:21:22
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21015/rails/game/specific/_1856 Modified Files: CGRFormationRound.java Log Message: Fixed bookkeeping on sold bonus tokens, in particular in relation to dropping duplicate tokens acquired by the CGR Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CGRFormationRound.java 27 Dec 2009 23:17:19 -0000 1.26 --- CGRFormationRound.java 28 Dec 2009 13:21:12 -0000 1.27 *************** *** 6,9 **** --- 6,11 ---- import rails.game.action.*; import rails.game.move.CashMove; + import rails.game.special.SellBonusToken; + import rails.game.special.SpecialPropertyI; import rails.game.state.BooleanState; import rails.game.state.IntegerState; *************** *** 544,548 **** if (cgr.getBonuses() != null) { for (Bonus b : cgr.getBonuses()) { ! if (b.equals(bonus)) continue bonuses; } } --- 546,565 ---- if (cgr.getBonuses() != null) { for (Bonus b : cgr.getBonuses()) { ! if (b.equals(bonus)) { ! // Remove this duplicate bonus token. ! // Check if it should be made available again. ! List<SellBonusToken> commonSP = gameManager.getSpecialProperties(SellBonusToken.class, true); ! if (commonSP != null) { ! for (SellBonusToken sp : commonSP) { ! if (sp.getName().equalsIgnoreCase(b.getName())) { ! sp.makeResellable(); ! log.debug("BonusToken "+b.getName()+" made sellable again"); ! break; ! } ! } ! } ! log.debug("Duplicate BonusToken "+b.getName()+" not added to "+cgrName); ! continue bonuses; ! } } } |
From: Erik V. <ev...@us...> - 2009-12-28 13:19:31
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20879/rails/game Modified Files: GameManager.java Log Message: Added log message related to Bonus tokens Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** GameManager.java 27 Nov 2009 20:35:18 -0000 1.71 --- GameManager.java 28 Dec 2009 13:19:21 -0000 1.72 *************** *** 1226,1230 **** && sp.isExecutionable() && (!sp.isExercised() || includeExercised)) { - log.debug("Adding common SP: " + sp); result.add((T) sp); } --- 1226,1229 ---- |
From: Erik V. <ev...@us...> - 2009-12-28 13:17:24
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv20656/rails/game/special Modified Files: SpecialProperty.java Log Message: Added option to undo setting to exercised (this is not actually used now) Index: SpecialProperty.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SpecialProperty.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SpecialProperty.java 31 Oct 2009 17:08:26 -0000 1.18 --- SpecialProperty.java 28 Dec 2009 13:17:12 -0000 1.19 *************** *** 123,128 **** public void setExercised() { ! exercised.set(true); ! privateCompany.checkClosingIfExercised(false); } --- 123,132 ---- public void setExercised() { ! setExercised(true); ! } ! ! public void setExercised (boolean value) { ! exercised.set(value); ! if (value) privateCompany.checkClosingIfExercised(false); } |
From: Erik V. <ev...@us...> - 2009-12-27 23:17:31
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19059/rails/game/specific/_1856 Modified Files: CGRFormationRound.java Log Message: Prevent CGR getting more than 1 bonus of the same type (e.g. Bridge) Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CGRFormationRound.java 27 Dec 2009 18:30:11 -0000 1.25 --- CGRFormationRound.java 27 Dec 2009 23:17:19 -0000 1.26 *************** *** 539,546 **** if (comp.getBonuses() != null) { List<Bonus> bonuses = new ArrayList<Bonus> (comp.getBonuses()); ! for (Bonus bonus : bonuses) { cgr.addBonus(new Bonus(cgr, bonus.getName(), bonus.getValue(), bonus.getLocations())); - comp.removeBonus(bonus); } } --- 539,552 ---- if (comp.getBonuses() != null) { List<Bonus> bonuses = new ArrayList<Bonus> (comp.getBonuses()); ! bonuses: for (Bonus bonus : bonuses) { ! comp.removeBonus(bonus); ! // Only add if the CGR does not already have the same bonus ! if (cgr.getBonuses() != null) { ! for (Bonus b : cgr.getBonuses()) { ! if (b.equals(bonus)) continue bonuses; ! } ! } cgr.addBonus(new Bonus(cgr, bonus.getName(), bonus.getValue(), bonus.getLocations())); } } |
From: Erik V. <ev...@us...> - 2009-12-27 23:16:49
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18903/rails/game Modified Files: Bonus.java Log Message: Added equals() Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bonus.java 26 Dec 2009 12:46:52 -0000 1.3 --- Bonus.java 27 Dec 2009 23:16:35 -0000 1.4 *************** *** 4,7 **** --- 4,9 ---- import java.util.List; + import rails.game.action.LayTile; + /** * An object of class Bonus represent extra income for the owning company, *************** *** 98,101 **** --- 100,108 ---- } } + + public boolean equals (Bonus b) { + return (b.name.equals(name)) + && b.value == value; + } @Override |
From: Erik V. <ev...@us...> - 2009-12-27 23:06:13
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17986/rails/util Modified Files: ListAndFixSavedFiles.java Log Message: Added Save, Load and Trim menu items Index: ListAndFixSavedFiles.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/ListAndFixSavedFiles.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ListAndFixSavedFiles.java 27 Dec 2009 18:30:53 -0000 1.1 --- ListAndFixSavedFiles.java 27 Dec 2009 23:06:03 -0000 1.2 *************** *** 12,16 **** --- 12,24 ---- import java.io.File; import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.FileWriter; + import java.io.IOException; import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.io.PrintWriter; + import java.text.SimpleDateFormat; + import java.util.ArrayList; + import java.util.Date; import java.util.List; import java.util.Map; *************** *** 34,37 **** --- 42,46 ---- import rails.game.ConfigurationException; + import rails.game.DisplayBuffer; import rails.game.Game; import rails.game.GameManager; *************** *** 50,55 **** private JMenuBar menuBar; private JMenu fileMenu, editMenu; ! private JMenuItem saveItem, loadItem, printItem; ! private JMenuItem findItem, findBackItem, findNextItem, findPrevItem; protected static Logger log = --- 59,70 ---- private JMenuBar menuBar; private JMenu fileMenu, editMenu; ! private JMenuItem saveItem, loadItem; ! private JMenuItem trimItem; ! ! private List<Object> savedObjects = new ArrayList<Object>(512); ! private List<PossibleAction> executedActions; ! ! private static String saveDirectory; ! private String filepath; protected static Logger log = *************** *** 78,82 **** Config.setConfigFile(myConfigFile); System.out.println("Configuration file = " + myConfigFile); ! System.out.println("Save directory = " + Config.get("save.directory")); new ListAndFixSavedFiles (); --- 93,98 ---- Config.setConfigFile(myConfigFile); System.out.println("Configuration file = " + myConfigFile); ! saveDirectory = Config.get("save.directory"); ! System.out.println("Save directory = " + saveDirectory); new ListAndFixSavedFiles (); *************** *** 133,146 **** fileMenu.add(saveItem); ! printItem = new ActionMenuItem(LocalText.getText("PRINT")); ! printItem.setActionCommand("PRINT"); ! printItem.setMnemonic(KeyEvent.VK_P); ! printItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK)); ! printItem.addActionListener(this); ! printItem.setEnabled(false); ! fileMenu.add(printItem); menuBar.add(fileMenu); setJMenuBar(menuBar); --- 149,163 ---- fileMenu.add(saveItem); ! trimItem = new ActionMenuItem("Trim"); ! trimItem.setActionCommand("TRIM"); ! trimItem.setMnemonic(KeyEvent.VK_T); ! trimItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.ALT_MASK)); ! trimItem.addActionListener(this); ! trimItem.setEnabled(true); ! editMenu.add(trimItem); menuBar.add(fileMenu); + menuBar.add(editMenu); setJMenuBar(menuBar); *************** *** 150,156 **** setSize(400, 400); setLocation(600, 400); ! setTitle(LocalText.getText("GameReportTitle")); - final JFrame frame = this; addKeyListener(this); --- 167,172 ---- setSize(400, 400); setLocation(600, 400); ! setTitle("List and fix saved files"); addKeyListener(this); *************** *** 158,162 **** setVisible(true); ! String saveDirectory = Config.get("save.directory"); JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File(saveDirectory)); --- 174,184 ---- setVisible(true); ! saveDirectory = Config.get("save.directory"); ! load(); ! ! } ! ! private void load() { ! JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File(saveDirectory)); *************** *** 165,169 **** File selectedFile = jfc.getSelectedFile(); ! String filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); --- 187,191 ---- File selectedFile = jfc.getSelectedFile(); ! filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); *************** *** 180,186 **** --- 202,210 ---- Object object = ois.readObject(); + savedObjects.add(object); if (object instanceof String) { add((String)object+" saved file "+filename); object = ois.readObject(); + savedObjects.add(object); } else { add("Reading Rails (pre-1.0.7) saved file "+filename); *************** *** 189,192 **** --- 213,217 ---- add("File was saved at "+(String)object); object = ois.readObject(); + savedObjects.add(object); } *************** *** 195,205 **** --- 220,235 ---- long saveFileVersionID = GameManager.saveFileVersionID; String name = (String) ois.readObject(); + savedObjects.add(name); add("Saved game="+name); + Map<String, String> selectedGameOptions = (Map<String, String>) ois.readObject(); + savedObjects.add(selectedGameOptions); for (String key : selectedGameOptions.keySet()) { add("Option "+key+"="+selectedGameOptions.get(key)); } + List<String> playerNames = (List<String>) ois.readObject(); + savedObjects.add(playerNames); int i=1; for (String player : playerNames) { *************** *** 213,218 **** } ! List<PossibleAction> executedActions = (List<PossibleAction>) ois.readObject(); i=1; for (PossibleAction action : executedActions) { --- 243,249 ---- } ! executedActions = (List<PossibleAction>) ois.readObject(); + savedObjects.add(executedActions); i=1; for (PossibleAction action : executedActions) { *************** *** 248,254 **** public void actionPerformed(ActionEvent actor) { String command = actor.getActionCommand(); ! if ("LOAD".equalsIgnoreCase(command)) { ! } } public void keyPressed(KeyEvent e) { } --- 279,335 ---- public void actionPerformed(ActionEvent actor) { String command = actor.getActionCommand(); ! if ("TRIM".equalsIgnoreCase(command)) { ! String result = JOptionPane.showInputDialog("Enter last action number to be retained"); ! if (Util.hasValue(result)) { ! try { ! int index = Integer.parseInt(result); ! List<PossibleAction> toRemove = executedActions.subList(index, executedActions.size()); ! toRemove.clear(); ! ! } catch (NumberFormatException e) { ! ! } ! } ! } else if ("SAVE".equalsIgnoreCase(command)) { ! save(); ! } else if ("LOAD".equalsIgnoreCase(command)) { ! load(); ! } } + + private void save() { + JFileChooser jfc = new JFileChooser(); + if (Util.hasValue(saveDirectory)) { + jfc.setCurrentDirectory(new File(saveDirectory)); + } + if (Util.hasValue(filepath)) { + jfc.setSelectedFile(new File(filepath)); + } + if (jfc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { + File selectedFile = jfc.getSelectedFile(); + filepath = selectedFile.getPath(); + saveDirectory = selectedFile.getParent(); + + try { + try { + ObjectOutputStream oos = + new ObjectOutputStream(new FileOutputStream(new File( + filepath))); + for (Object object : savedObjects) { + oos.writeObject(object); + } + oos.close(); + } catch (IOException e) { + log.error("Save failed", e); + DisplayBuffer.add(LocalText.getText("SaveFailed", e.getMessage())); + } + } catch (Exception e) { + System.out.println ("Error whilst writing file "+filepath); + e.printStackTrace(); + } + } + + } + public void keyPressed(KeyEvent e) { } |
From: Erik V. <ev...@us...> - 2009-12-27 18:31:04
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31035/rails/util Added Files: ListAndFixSavedFiles.java Log Message: New tool (unfinished) --- NEW FILE: ListAndFixSavedFiles.java --- package rails.util; import java.awt.Color; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.List; import java.util.Map; import javax.swing.BorderFactory; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.KeyStroke; import javax.swing.ScrollPaneConstants; import javax.swing.SwingUtilities; import org.apache.log4j.Logger; import rails.game.ConfigurationException; import rails.game.Game; import rails.game.GameManager; import rails.game.action.PossibleAction; import rails.ui.swing.elements.ActionMenuItem; public class ListAndFixSavedFiles extends JFrame implements ActionListener, KeyListener { private static final long serialVersionUID = 1L; private JTextArea reportText; private JScrollPane messageScroller; private JScrollBar vbar; private JPanel messagePanel; private ListAndFixSavedFiles messageWindow; private JMenuBar menuBar; private JMenu fileMenu, editMenu; private JMenuItem saveItem, loadItem, printItem; private JMenuItem findItem, findBackItem, findNextItem, findPrevItem; protected static Logger log = Logger.getLogger(ListAndFixSavedFiles.class.getPackage().getName()); /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String myConfigFile = System.getProperty("configfile"); System.out.println("Cmdline configfile setting = " + myConfigFile); /* If not, use the default configuration file name */ if (!Util.hasValue(myConfigFile)) { myConfigFile = "my.properties"; } /* * Set the system property that tells log4j to use this file. (Note: * this MUST be done before updating Config) */ System.setProperty("log4j.configuration", myConfigFile); /* Tell the properties loader to read this file. */ Config.setConfigFile(myConfigFile); System.out.println("Configuration file = " + myConfigFile); System.out.println("Save directory = " + Config.get("save.directory")); new ListAndFixSavedFiles (); } public ListAndFixSavedFiles () { super(); messageWindow = this; reportText = new JTextArea(); reportText.setEditable(false); reportText.setLineWrap(false); reportText.setBackground(Color.WHITE); reportText.setOpaque(true); reportText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); messagePanel = new JPanel(new GridBagLayout()); messageScroller = new JScrollPane(reportText, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); vbar = messageScroller.getVerticalScrollBar(); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; gbc.weightx = gbc.weighty = 1.0; gbc.fill = GridBagConstraints.BOTH; messagePanel.add(messageScroller, gbc); menuBar = new JMenuBar(); fileMenu = new JMenu(LocalText.getText("FILE")); fileMenu.setMnemonic(KeyEvent.VK_F); editMenu = new JMenu(LocalText.getText("EDIT")); editMenu.setMnemonic(KeyEvent.VK_E); loadItem = new ActionMenuItem(LocalText.getText("LOAD")); loadItem.setActionCommand("LOAD"); loadItem.setMnemonic(KeyEvent.VK_L); loadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.ALT_MASK)); loadItem.addActionListener(this); loadItem.setEnabled(true); fileMenu.add(loadItem); saveItem = new ActionMenuItem(LocalText.getText("SAVE")); saveItem.setActionCommand("SAVE"); saveItem.setMnemonic(KeyEvent.VK_S); saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK)); saveItem.addActionListener(this); saveItem.setEnabled(true); fileMenu.add(saveItem); printItem = new ActionMenuItem(LocalText.getText("PRINT")); printItem.setActionCommand("PRINT"); printItem.setMnemonic(KeyEvent.VK_P); printItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK)); printItem.addActionListener(this); printItem.setEnabled(false); fileMenu.add(printItem); menuBar.add(fileMenu); setJMenuBar(menuBar); setContentPane(messagePanel); setSize(400, 400); setLocation(600, 400); setTitle(LocalText.getText("GameReportTitle")); final JFrame frame = this; addKeyListener(this); setVisible(true); String saveDirectory = Config.get("save.directory"); JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File(saveDirectory)); if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) { File selectedFile = jfc.getSelectedFile(); String filepath = selectedFile.getPath(); saveDirectory = selectedFile.getParent(); log.debug("Loading game from file " + filepath); String filename = filepath.replaceAll(".*[/\\\\]", ""); try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream( new File(filepath))); // New in 1.0.7: Rails version & save date/time. // Allow for older saved file versions. Object object = ois.readObject(); if (object instanceof String) { add((String)object+" saved file "+filename); object = ois.readObject(); } else { add("Reading Rails (pre-1.0.7) saved file "+filename); } if (object instanceof String) { add("File was saved at "+(String)object); object = ois.readObject(); } long versionID = (Long) object; add("Saved versionID="+versionID+" (object="+object+")"); long saveFileVersionID = GameManager.saveFileVersionID; String name = (String) ois.readObject(); add("Saved game="+name); Map<String, String> selectedGameOptions = (Map<String, String>) ois.readObject(); for (String key : selectedGameOptions.keySet()) { add("Option "+key+"="+selectedGameOptions.get(key)); } List<String> playerNames = (List<String>) ois.readObject(); int i=1; for (String player : playerNames) { add("Player "+(i++)+": "+player); } Game game = new Game(name, playerNames, selectedGameOptions); if (!game.setup()) { throw new ConfigurationException("Error in setting up " + name); } List<PossibleAction> executedActions = (List<PossibleAction>) ois.readObject(); i=1; for (PossibleAction action : executedActions) { add("Action "+(i++)+": "+action.toString()); } ois.close(); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } } public void add (String text) { if (text.length() > 0) { reportText.append(text); reportText.append("\n"); scrollDown(); } } public void scrollDown () { SwingUtilities.invokeLater(new Runnable() { public void run() { messageWindow.vbar.setValue(messageWindow.vbar.getMaximum()); } }); } public void actionPerformed(ActionEvent actor) { String command = actor.getActionCommand(); if ("LOAD".equalsIgnoreCase(command)) { } } public void keyPressed(KeyEvent e) { } public void keyReleased(KeyEvent e) {} public void keyTyped(KeyEvent e) {} } |
From: Erik V. <ev...@us...> - 2009-12-27 18:30:43
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31004/rails/util Modified Files: Config.java Log Message: Some restructuring Index: Config.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Config.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Config.java 7 Nov 2009 12:10:37 -0000 1.9 --- Config.java 27 Dec 2009 18:30:31 -0000 1.10 *************** *** 36,39 **** --- 36,40 ---- public static void setConfigFile(String myConfigFile) { Config.myConfigFile = myConfigFile; + load(); } *************** *** 41,44 **** --- 42,55 ---- if (prop.isEmpty() || !loaded) { + load(); + } + if (prop.containsKey(key)) return prop.getProperty(key).trim(); + + return ""; + } + + private static void load() { + + if (prop.isEmpty() || !loaded) { /* List the property files to read here */ load(myConfigFile, false); *************** *** 47,53 **** loaded = true; } - if (prop.containsKey(key)) return prop.getProperty(key).trim(); - - return ""; } --- 58,61 ---- |
From: Erik V. <ev...@us...> - 2009-12-27 18:30:21
|
Update of /cvsroot/rails/18xx/rails/game/action In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30959/rails/game/action Modified Files: DiscardTrain.java Log Message: Fixed in 1856: 1. Loop if CGR does not discard any non-permanent train 2. Error if new OR starts immediately after CGR formation. Index: DiscardTrain.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/DiscardTrain.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DiscardTrain.java 4 Nov 2009 20:33:21 -0000 1.10 --- DiscardTrain.java 27 Dec 2009 18:30:11 -0000 1.11 *************** *** 75,81 **** b.append(" ").append(train.getName()); } ! b.append(forced ? "," : ", not").append (" forced,"); if (discardedTrain != null) { ! b.append(" and discards ").append(discardedTrain.getName()); } return b.toString(); --- 75,83 ---- b.append(" ").append(train.getName()); } ! b.append(forced ? "" : ", not").append (" forced"); if (discardedTrain != null) { ! b.append(", discards ").append(discardedTrain.getName()); ! } else if ("".equalsIgnoreCase(getPlayerName())) { ! b.append(", discards nothing"); } return b.toString(); |
From: Erik V. <ev...@us...> - 2009-12-27 18:30:20
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30959/rails/game Modified Files: OperatingRound.java Log Message: Fixed in 1856: 1. Loop if CGR does not discard any non-permanent train 2. Error if new OR starts immediately after CGR formation. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** OperatingRound.java 26 Dec 2009 13:44:26 -0000 1.84 --- OperatingRound.java 27 Dec 2009 18:30:11 -0000 1.85 *************** *** 1514,1518 **** } ! if (train == null) { errMsg = LocalText.getText("NoTrainSpecified"); break; --- 1514,1518 ---- } ! if (train == null && action.isForced()) { errMsg = LocalText.getText("NoTrainSpecified"); break; *************** *** 1534,1538 **** DisplayBuffer.add(LocalText.getText("CannotDiscardTrain", companyName, ! train.getName(), errMsg )); return false; --- 1534,1538 ---- DisplayBuffer.add(LocalText.getText("CannotDiscardTrain", companyName, ! (train != null ?train.getName() : "?"), errMsg )); return false; *************** *** 1555,1559 **** } ! setPossibleActions(); return true; --- 1555,1559 ---- } ! //setPossibleActions(); return true; |
From: Erik V. <ev...@us...> - 2009-12-27 18:30:20
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30959/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java CGRFormationRound.java Log Message: Fixed in 1856: 1. Loop if CGR does not discard any non-permanent train 2. Error if new OR starts immediately after CGR formation. Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CGRFormationRound.java 27 Nov 2009 20:35:18 -0000 1.24 --- CGRFormationRound.java 27 Dec 2009 18:30:11 -0000 1.25 *************** *** 6,9 **** --- 6,10 ---- import rails.game.action.*; import rails.game.move.CashMove; + import rails.game.state.BooleanState; import rails.game.state.IntegerState; import rails.util.LocalText; *************** *** 26,29 **** --- 27,31 ---- private IntegerState stepObject = new IntegerState ("CGRFormStep", 0); + private BooleanState cgrHasDiscardedTrains = new BooleanState ("CGRDiscardedTrains", false); public static final int STEP_REPAY_LOANS = 1; *************** *** 708,712 **** forcedTrainDiscard = true; return true; ! } else { // Check if CGR still has non-permanent trains // these may be discarded voluntarily --- 710,714 ---- forcedTrainDiscard = true; return true; ! } else if (!this.cgrHasDiscardedTrains.booleanValue()) { // Check if CGR still has non-permanent trains // these may be discarded voluntarily *************** *** 789,792 **** --- 791,796 ---- train.getName() )); + } else { + cgrHasDiscardedTrains.set(true); } Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** OperatingRound_1856.java 26 Dec 2009 12:49:58 -0000 1.26 --- OperatingRound_1856.java 27 Dec 2009 18:30:11 -0000 1.27 *************** *** 64,68 **** } else { operatingCompany = operatingCompanyArray[operatingCompanyIndex]; - // 1856 special: check if the company has sold enough shares to operate // This check does not apply to the CGR --- 64,67 ---- *************** *** 464,468 **** // End of CGRFormationRound finalLoanRepaymentPending.set(false); ! resetOperatingCompanies(mergingCompanies); if (operatingCompany != null) { setStep(STEP_INITIAL); --- 463,467 ---- // End of CGRFormationRound finalLoanRepaymentPending.set(false); ! if (!resetOperatingCompanies(mergingCompanies)) return; if (operatingCompany != null) { setStep(STEP_INITIAL); *************** *** 473,477 **** } ! private void resetOperatingCompanies(List<PublicCompanyI> mergingCompanies) { List<PublicCompanyI> companies --- 472,476 ---- } ! private boolean resetOperatingCompanies(List<PublicCompanyI> mergingCompanies) { List<PublicCompanyI> companies *************** *** 541,546 **** } else { finishOR(); } ! } --- 540,546 ---- } else { finishOR(); + return false; } ! return true; } |
From: Erik V. <ev...@us...> - 2009-12-26 13:53:13
|
Update of /cvsroot/rails/18xx/rails/game/special In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17078/rails/game/special Modified Files: SellBonusToken.java Log Message: Minor cleanup Index: SellBonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/special/SellBonusToken.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SellBonusToken.java 31 Oct 2009 17:08:26 -0000 1.2 --- SellBonusToken.java 26 Dec 2009 13:53:01 -0000 1.3 *************** *** 13,17 **** private String locationCodes = null; private List<MapHex> locations = null; - //private PublicCompanyI seller = null; private State seller = null; private String name; --- 13,16 ---- |
From: Erik V. <ev...@us...> - 2009-12-26 13:44:38
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16514/rails/game Modified Files: OperatingRound.java Log Message: Removed option to select "common" actions in case of forced actions (i.e. a train discard). Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** OperatingRound.java 26 Dec 2009 12:48:31 -0000 1.83 --- OperatingRound.java 26 Dec 2009 13:44:26 -0000 1.84 *************** *** 1978,2026 **** } ! setBonusTokenLays(); ! ! setDestinationActions(); ! ! setGameSpecificPossibleActions(); ! ! // Can private companies be bought? ! if (getCurrentPhase().isPrivateSellingAllowed()) { ! ! // Create a list of players with the current one in front ! int currentPlayerIndex = operatingCompany.getPresident().getIndex(); ! Player player; ! int minPrice, maxPrice; ! for (int i = currentPlayerIndex; i < currentPlayerIndex ! + numberOfPlayers; i++) { ! player = players.get(i % numberOfPlayers); ! for (PrivateCompanyI privComp : player.getPortfolio().getPrivateCompanies()) { ! minPrice = ! (int) (privComp.getBasePrice() * operatingCompany.getLowerPrivatePriceFactor()); ! maxPrice = ! (int) (privComp.getBasePrice() * operatingCompany.getUpperPrivatePriceFactor()); ! possibleActions.add(new BuyPrivate(privComp, minPrice, ! maxPrice)); } } ! } ! ! // Are there any "common" special properties, ! // i.e. properties that are available to everyone? ! List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { ! SellBonusToken sbt; ! loop: for (SpecialPropertyI sp : commonSP) { ! if (sp instanceof SellBonusToken) { ! sbt = (SellBonusToken) sp; ! // Can't buy if already owned ! if (operatingCompany.getBonuses() != null) { ! for (Bonus bonus : operatingCompany.getBonuses()) { ! if (bonus.getName().equals(sp.getName())) continue loop; ! } ! } ! possibleActions.add (new BuyBonusToken (sbt)); ! } ! } } --- 1978,2031 ---- } ! // The following additional "common" actions are only available if the ! // primary action is not forced. ! if (step >= 0) { ! ! setBonusTokenLays(); ! setDestinationActions(); ! ! setGameSpecificPossibleActions(); ! ! // Can private companies be bought? ! if (getCurrentPhase().isPrivateSellingAllowed()) { ! ! // Create a list of players with the current one in front ! int currentPlayerIndex = operatingCompany.getPresident().getIndex(); ! Player player; ! int minPrice, maxPrice; ! for (int i = currentPlayerIndex; i < currentPlayerIndex ! + numberOfPlayers; i++) { ! player = players.get(i % numberOfPlayers); ! for (PrivateCompanyI privComp : player.getPortfolio().getPrivateCompanies()) { ! ! minPrice = ! (int) (privComp.getBasePrice() * operatingCompany.getLowerPrivatePriceFactor()); ! maxPrice = ! (int) (privComp.getBasePrice() * operatingCompany.getUpperPrivatePriceFactor()); ! possibleActions.add(new BuyPrivate(privComp, minPrice, ! maxPrice)); ! } } } ! ! // Are there any "common" special properties, ! // i.e. properties that are available to everyone? ! List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { ! SellBonusToken sbt; ! loop: for (SpecialPropertyI sp : commonSP) { ! if (sp instanceof SellBonusToken) { ! sbt = (SellBonusToken) sp; ! // Can't buy if already owned ! if (operatingCompany.getBonuses() != null) { ! for (Bonus bonus : operatingCompany.getBonuses()) { ! if (bonus.getName().equals(sp.getName())) continue loop; ! } ! } ! possibleActions.add (new BuyBonusToken (sbt)); ! } ! } ! } } |
From: Erik V. <ev...@us...> - 2009-12-26 12:50:23
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7583/rails/ui/swing Modified Files: ORUIManager.java Log Message: Fixed message text Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ORUIManager.java 20 Dec 2009 15:38:05 -0000 1.36 --- ORUIManager.java 26 Dec 2009 12:50:15 -0000 1.37 *************** *** 1277,1281 **** bbt.getName(), Bank.format(bbt.getValue()), ! bbt.getCompanyName(), Bank.format(bbt.getPrice()) ); orPanel.addSpecialAction(bbt, text); --- 1277,1281 ---- bbt.getName(), Bank.format(bbt.getValue()), ! bbt.getSellerName(), Bank.format(bbt.getPrice()) ); orPanel.addSpecialAction(bbt, text); |
From: Erik V. <ev...@us...> - 2009-12-26 12:50:08
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7458/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Set seller of unsold Bridge/Tunnel tokens to Bank Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** OperatingRound_1856.java 27 Nov 2009 20:35:18 -0000 1.25 --- OperatingRound_1856.java 26 Dec 2009 12:49:58 -0000 1.26 *************** *** 8,11 **** --- 8,13 ---- import rails.game.state.BooleanState; import rails.game.state.IntegerState; + import rails.game.special.SellBonusToken; + import rails.game.special.SpecialPropertyI; import rails.util.LocalText; *************** *** 361,368 **** PhaseI postPhase = currentPhase; ! if (postPhase != prePhase && postPhase.getName().equals("5")) { ! finalLoanRepaymentPending.set(true); ! playerToStartLoanRepayment ! = gameManager.getPlayerByIndex(action.getPlayerIndex()); } --- 363,381 ---- PhaseI postPhase = currentPhase; ! if (postPhase != prePhase) { ! if (postPhase.getName().equals("5")) { ! finalLoanRepaymentPending.set(true); ! playerToStartLoanRepayment ! = gameManager.getPlayerByIndex(action.getPlayerIndex()); ! } else if (postPhase.getName().equals("4")) { ! // Make Bridge and Tunnel tokens buyable from the Bank. ! for (SpecialPropertyI sp : gameManager.getCommonSpecialProperties()) { ! if (sp instanceof SellBonusToken) { ! SellBonusToken sbt = (SellBonusToken)sp; ! sbt.setSeller(bank); ! log.debug("SP "+sp.getName()+" is now buyable from the Bank"); ! } ! } ! } } |
From: Erik V. <ev...@us...> - 2009-12-26 12:48:46
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7157/rails/game Modified Files: OperatingRound.java Log Message: Fixed message text Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** OperatingRound.java 20 Dec 2009 14:57:02 -0000 1.82 --- OperatingRound.java 26 Dec 2009 12:48:31 -0000 1.83 *************** *** 722,726 **** errMsg = LocalText.getText("NotEnoughMoney", ! operatingCompany.getName()); break; } --- 722,728 ---- errMsg = LocalText.getText("NotEnoughMoney", ! operatingCompany.getName(), ! Bank.format(operatingCompany.getCash()), ! Bank.format(cost)); break; } |
From: Erik V. <ev...@us...> - 2009-12-26 12:48:10
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7035/rails/game Modified Files: PrivateCompany.java Log Message: Fixed moving unsold Bridge/Tunnel tokens to GM/Bank Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PrivateCompany.java 4 Nov 2009 20:33:22 -0000 1.26 --- PrivateCompany.java 26 Dec 2009 12:48:02 -0000 1.27 *************** *** 183,191 **** ReportBuffer.add(LocalText.getText("PrivateCloses", name)); ! // For 1856: buyable tokens move to Bank for (SpecialPropertyI sp : specialProperties) { if (sp instanceof SellBonusToken) { ! ((SellBonusToken)sp).setSeller(GameManager.getInstance().getBank()); ! } } } --- 183,199 ---- ReportBuffer.add(LocalText.getText("PrivateCloses", name)); ! // For 1856: buyable tokens still owned by the private will now ! // become commonly buyable, i.e. owned by GameManager. ! // (Note: all such tokens will be made buyable from the Bank too, ! // this is done in OperatingRound_1856). ! List<SellBonusToken> moveToGM = new ArrayList<SellBonusToken>(4); for (SpecialPropertyI sp : specialProperties) { if (sp instanceof SellBonusToken) { ! moveToGM.add((SellBonusToken)sp); ! } ! } ! for (SellBonusToken sbt : moveToGM) { ! sbt.moveTo(GameManager.getInstance()); ! log.debug("SP "+sbt.getName()+" is now a common property"); } } |