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-13 16:39:56
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28822/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: Implemented request to show low-price colours in SR and OR panels. Added a generic Model-to-View update mechanism (used by above) All configurable colours can now be specified as RGB decimally or hexadecimally. Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GUIHex.java 7 Nov 2009 12:09:55 -0000 1.25 --- GUIHex.java 13 Dec 2009 16:39:48 -0000 1.26 *************** *** 11,15 **** import rails.game.*; import rails.game.model.ModelObject; ! import rails.ui.swing.*; import rails.ui.swing.elements.ViewObject; import rails.util.Util; --- 11,16 ---- import rails.game.*; import rails.game.model.ModelObject; ! import rails.ui.swing.GUIToken; ! import rails.ui.swing.GameUIManager; import rails.ui.swing.elements.ViewObject; import rails.util.Util; *************** *** 163,169 **** setToolTip(); ! if (StatusWindow.useObserver) { ! model.addObserver(this); ! } } --- 164,168 ---- setToolTip(); ! model.addObserver(this); } *************** *** 679,683 **** /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (model != null && StatusWindow.useObserver) model.deleteObserver(this); } --- 678,682 ---- /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (model != null) model.deleteObserver(this); } *************** *** 707,711 **** log.debug("GUIHex " + model.getName() + " updated: new tile " + currentTileId + "/" + currentTileOrientation); ! GameUIManager.instance.orWindow.updateStatus(); } else { hexMap.repaint(getBounds()); --- 706,713 ---- log.debug("GUIHex " + model.getName() + " updated: new tile " + currentTileId + "/" + currentTileOrientation); ! ! if (GameUIManager.instance != null && GameUIManager.instance.orWindow != null) { ! GameUIManager.instance.orWindow.updateStatus(); ! } } else { hexMap.repaint(getBounds()); |
From: Brett L. <wak...@us...> - 2009-12-12 22:05:30
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31317 Modified Files: rails.sh rails.bat build.xml Log Message: bump version to 1.1.0 Index: rails.bat =================================================================== RCS file: /cvsroot/rails/18xx/rails.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rails.bat 22 Nov 2009 18:48:41 -0000 1.3 --- rails.bat 12 Dec 2009 22:05:20 -0000 1.4 *************** *** 1,2 **** ! java -jar rails-1.0.7-rc3.jar %1 \ No newline at end of file --- 1,2 ---- ! java -jar rails-1.1.0.jar %1 \ No newline at end of file Index: rails.sh =================================================================== RCS file: /cvsroot/rails/18xx/rails.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rails.sh 22 Nov 2009 18:48:41 -0000 1.3 --- rails.sh 12 Dec 2009 22:05:20 -0000 1.4 *************** *** 1,3 **** #!/bin/bash ! java -jar ./rails-1.0.7-rc3.jar $1 --- 1,3 ---- #!/bin/bash ! java -jar ./rails-1.1.0.jar $1 Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** build.xml 22 Nov 2009 18:48:41 -0000 1.5 --- build.xml 12 Dec 2009 22:05:20 -0000 1.6 *************** *** 10,14 **** <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.0.7-rc3"/> <path id="18xx.classpath"> <pathelement location="classes"/> --- 10,14 ---- <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.1.0"/> <path id="18xx.classpath"> <pathelement location="classes"/> |
From: Brett L. <wak...@us...> - 2009-12-12 22:05:30
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31317/rails/game Modified Files: Game.java Log Message: bump version to 1.1.0 Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Game.java 25 Nov 2009 18:48:19 -0000 1.40 --- Game.java 12 Dec 2009 22:05:20 -0000 1.41 *************** *** 12,16 **** public class Game { ! public static final String version = "1.0.7-rc3"; /** The component Manager */ --- 12,16 ---- public class Game { ! public static final String version = "1.1.0"; /** The component Manager */ |
From: Erik V. <ev...@us...> - 2009-12-08 21:16:59
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25928/rails/game Modified Files: Round.java StartRound_1830.java StartRound.java Log Message: Fixed bug in determining end of round Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** StartRound_1830.java 27 Nov 2009 20:35:18 -0000 1.26 --- StartRound_1830.java 8 Dec 2009 19:32:44 -0000 1.27 *************** *** 33,36 **** --- 33,58 ---- @Override + public boolean process(PossibleAction action) { + + if (!super.process(action)) return false; + + // Assign any further items that have been bid exactly once + // and don't need any further player intervention, such + // as setting a start price + StartItem item; + while ((item = startPacket.getFirstUnsoldItem()) != null + && item.getBidders() == 1 && item.needsPriceSetting() == null) { + assignItem(item.getBidder(), item, item.getBid(), 0); + + // Check if this has exhausted the start packet + if (startPacket.areAllSold()) { + finishRound(); + break; + } + } + return true; + } + + @Override public boolean setPossibleActions() { *************** *** 39,43 **** possibleActions.clear(); ! if (startPacket.areAllSold()) return false; if (currentPlayer == startPlayer) ReportBuffer.add(""); --- 61,65 ---- possibleActions.clear(); ! //if (startPacket.areAllSold()) return false; // SHOULDN'T GET HERE THEN if (currentPlayer == startPlayer) ReportBuffer.add(""); *************** *** 85,89 **** break; // No more actions possible! } else { ! // Otherwise, buy it now. assignItem(item.getBidder(), item, item.getBid(), 0); } --- 107,112 ---- break; // No more actions possible! } else { ! // ERROR, this should have been detected in process()! ! log.error("??? Wrong place to assign item "+item.getName()); assignItem(item.getBidder(), item, item.getBid(), 0); } *************** *** 132,138 **** * loop. go to next round if that happened */ ! if (gameManager.getStartPacket().areAllSold()) { ! return false; ! } if (possibleActions.isEmpty()) { --- 155,161 ---- * loop. go to next round if that happened */ ! //if (gameManager.getStartPacket().areAllSold()) { ! // return false; ! //} if (possibleActions.isEmpty()) { Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** StartRound.java 27 Nov 2009 20:35:18 -0000 1.31 --- StartRound.java 8 Dec 2009 19:32:44 -0000 1.32 *************** *** 138,149 **** possibleActions.clear(); finishRound(); - // } else if (!setPossibleActions()) { - /* - * If nobody can do anything, keep executing Operating and Start - * rounds until someone has got enough money to buy one of the - * remaining items. The game mechanism ensures that this will - * ultimately be possible. - */ - // finishRound(); } --- 138,141 ---- |
From: Erik V. <ev...@us...> - 2009-12-08 19:32:01
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25886/rails/ui/swing/hexmap Modified Files: EWHexMap.java NSHexMap.java Log Message: Added coordinate grid Index: NSHexMap.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/NSHexMap.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NSHexMap.java 2 Nov 2009 23:30:36 -0000 1.9 --- NSHexMap.java 8 Dec 2009 19:31:49 -0000 1.10 *************** *** 2,6 **** package rails.ui.swing.hexmap; ! import java.awt.Dimension; import java.util.ArrayList; --- 2,6 ---- package rails.ui.swing.hexmap; ! import java.awt.*; import java.util.ArrayList; *************** *** 54,56 **** --- 54,95 ---- * GUIHex.SQRT3 * scale)); } + + @Override + public void paint(Graphics g) { + + super.paint(g); + Graphics2D g2 = (Graphics2D) g; + String label; + + boolean lettersGoHorizontal = mapManager.lettersGoHorizontal(); + int xOffset = mapManager.letterAHasEvenNumbers() ? 1 : 0; + int xLeft = cx + 10; + int xRight = (cx + 5 + 3 * scale * hexArray.length); + int yTop = 20; + int yBottom = (int)(cy + 20 + 2 * hexArray[0].length * GUIHex.SQRT3 * scale); + + for (int i = 1; i < hexArray.length; i++) { + label = lettersGoHorizontal + ? String.valueOf((char)('@'+i)) + : String.valueOf(i); + g2.drawString(label, + (cx - 30 -3*label.length() + 3 * scale * (i + xOffset)), + yTop); + g2.drawString(label, + (cx - 30 -3*label.length() + 3 * scale * (i + xOffset)), + yBottom); + } + + for (int j = 1; j < 2 * hexArray[0].length; j++) { + label = lettersGoHorizontal + ? String.valueOf(j) + : String.valueOf((char)('@'+j)); + g2.drawString(label, + xLeft, + (int)(cy + 56 + j * GUIHex.SQRT3 * scale)); + g2.drawString(label, + xRight, + (int)(cy + 56 + j * GUIHex.SQRT3 * scale)); + } + } } Index: EWHexMap.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/EWHexMap.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EWHexMap.java 2 Nov 2009 23:30:36 -0000 1.10 --- EWHexMap.java 8 Dec 2009 19:31:49 -0000 1.11 *************** *** 2,6 **** package rails.ui.swing.hexmap; ! import java.awt.Dimension; import java.util.ArrayList; --- 2,6 ---- package rails.ui.swing.hexmap; ! import java.awt.*; import java.util.ArrayList; *************** *** 52,54 **** --- 52,96 ---- (int) Math.round((hexArray[0].length + 1) * 1.5 * scale)); } + + @Override + public void paint(Graphics g) { + + super.paint(g); + Graphics2D g2 = (Graphics2D) g; + String label; + + boolean lettersGoHorizontal = mapManager.lettersGoHorizontal(); + int xOffset = mapManager.letterAHasEvenNumbers() ? 1 : 0; + int xLeft = cx + 10; + int xRight = (int)(cx + 5 + scale * (GUIHex.SQRT3/2 * 2*hexArray.length)); + int yTop = cy + 10; + int yBottom = (int)(cy - 10 + hexArray[0].length * 1.5 * scale); + + for (int i = 1; i < 2*hexArray.length; i++) { + label = lettersGoHorizontal + ? String.valueOf((char)('@'+i)) + : String.valueOf(i); + g2.drawString(label, + (int) (cx + (26-3*label.length()) + scale * (GUIHex.SQRT3/2 * (i + xOffset))), + yTop); + g2.drawString(label, + (int) (cx + (26-3*label.length()) + scale * (GUIHex.SQRT3/2 * (i + xOffset))), + yBottom); + } + + for (int j = 1; j < hexArray[0].length; j++) { + label = lettersGoHorizontal + ? String.valueOf(j) + : String.valueOf((char)('@'+j)); + g2.drawString(label, + xLeft, + (int)(cy - 10 + j * 1.5 * scale)); + g2.drawString(label, + xRight, + (int)(cy - 10 + j * 1.5 * scale)); + } + + + } + } |
From: Erik V. <ev...@us...> - 2009-12-08 19:31:44
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25867/rails/ui/swing Modified Files: GameStatus.java Log Message: Added train price overview Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** GameStatus.java 25 Nov 2009 19:21:31 -0000 1.30 --- GameStatus.java 8 Dec 2009 19:31:33 -0000 1.31 *************** *** 504,507 **** --- 504,512 ---- futureTrainsWidth, 1, 0); + // Train cost overview + String text = gameUIManager.getGameManager().getTrainManager().getTrainCostOverview(); + addField (new Caption(text), poolTrainsXOffset, newTrainsYOffset + 1, + futureTrainsWidth + 2, 1, 0); + dummyButton = new ClickField("", "", "", this, buySellGroup); |
From: Erik V. <ev...@us...> - 2009-12-08 19:31:42
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25867/rails/game Modified Files: TrainManager.java Log Message: Added train price overview Index: TrainManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TrainManager.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TrainManager.java 4 Nov 2009 20:33:22 -0000 1.23 --- TrainManager.java 8 Dec 2009 19:31:32 -0000 1.24 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; public class TrainManager implements ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected Map<String, TrainI> trainMap = new HashMap<String, TrainI>(); protected boolean buyAtFaceValueBetweenDifferentPresidents = false; // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special buyAtFaceValueBetweenDifferentPresidents = rulesTag.getChild("FaceValueIfDifferentPresidents") != null; } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); for (TrainTypeI type : lTrainTypes) { type.finishConfiguration(gameManager); } // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } public void addTrain (String uniqueID, TrainI train) { trainMap.put(uniqueID, train); } public TrainI getTrainByUniqueId(String id) { return trainMap.get(id); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } public boolean buyAtFaceValueBetweenDifferentPresidents() { return buyAtFaceValueBetweenDifferentPresidents; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; public class TrainManager implements ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected Map<String, TrainI> trainMap = new HashMap<String, TrainI>(); protected boolean buyAtFaceValueBetweenDifferentPresidents = false; // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special buyAtFaceValueBetweenDifferentPresidents = rulesTag.getChild("FaceValueIfDifferentPresidents") != null; } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); for (TrainTypeI type : lTrainTypes) { type.finishConfiguration(gameManager); } // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } public void addTrain (String uniqueID, TrainI train) { trainMap.put(uniqueID, train); } public TrainI getTrainByUniqueId(String id) { return trainMap.get(id); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public String getTrainCostOverview() { StringBuffer b = new StringBuffer(); for (TrainTypeI type : lTrainTypes) { if (b.length() > 1) b.append(" "); b.append(type.getName()).append(":").append(Bank.format(type.getCost())); if (type.getFirstExchangeCost() > 0) { b.append("(").append(Bank.format(type.getFirstExchangeCost())).append(")"); } } return b.toString(); } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } public boolean buyAtFaceValueBetweenDifferentPresidents() { return buyAtFaceValueBetweenDifferentPresidents; } } \ No newline at end of file |
From: Erik V. <ev...@us...> - 2009-12-08 19:31:21
|
Update of /cvsroot/rails/18xx/data/18Kaas In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25847/data/18Kaas Modified Files: CompanyManager.xml Log Message: Added some missing required private speciral property attributes Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/CompanyManager.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompanyManager.xml 17 Feb 2008 22:10:08 -0000 1.7 --- CompanyManager.xml 8 Dec 2009 19:31:09 -0000 1.8 *************** *** 21,25 **** <Blocking hex="D15"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="D15" extra="yes"/> </SpecialProperty> --- 21,25 ---- <Blocking hex="D15"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="D15" extra="yes"/> </SpecialProperty> *************** *** 29,36 **** <Blocking hex="K16"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="K16" extra="no" free="no"/> </SpecialProperty> ! <SpecialProperty condition="ifOwnedByCompany" class="rails.game.special.SpecialTokenLay"> <SpecialTokenLay location="K16" extra="no" free="yes"/> </SpecialProperty> --- 29,36 ---- <Blocking hex="K16"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="K16" extra="no" free="no"/> </SpecialProperty> ! <SpecialProperty condition="ifOwnedByCompany" when="tokenLayingStep" class="rails.game.special.SpecialTokenLay"> <SpecialTokenLay location="K16" extra="no" free="yes"/> </SpecialProperty> *************** *** 40,44 **** <Blocking hex="D9"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByPlayer" class="rails.game.special.ExchangeForShare"> <ExchangeForShare company="NYC" share="10"/> </SpecialProperty> --- 40,44 ---- <Blocking hex="D9"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByPlayer" when="anyTime" class="rails.game.special.ExchangeForShare"> <ExchangeForShare company="NYC" share="10"/> </SpecialProperty> |
From: Erik V. <ev...@us...> - 2009-12-07 17:50:48
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32676/rails/game Modified Files: Round.java Log Message: Improved token exchange texts Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Round.java 27 Nov 2009 20:35:18 -0000 1.30 --- Round.java 7 Dec 2009 17:50:38 -0000 1.31 *************** *** 213,216 **** --- 213,217 ---- ReportBuffer.add(LocalText.getText("NoBaseTokenExchange", comp.getName(), + token.getOldCompanyName(), city.getName())); } |
From: Erik V. <ev...@us...> - 2009-12-07 17:50:25
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32659/rails/game Modified Files: StockRound.java Log Message: On the M&H/NYC swap, check if NYC floats. Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** StockRound.java 27 Nov 2009 20:35:18 -0000 1.52 --- StockRound.java 7 Dec 2009 17:50:16 -0000 1.53 *************** *** 1095,1099 **** false) : pool.findCertificate(publicCompany, false); - //player.buy(cert, 0); cert.moveTo(player.getPortfolio()); ReportBuffer.add(LocalText.getText("SwapsPrivateForCertificate", --- 1095,1098 ---- *************** *** 1105,1108 **** --- 1104,1110 ---- privateCompany.setClosed(); + // Check if the company has floated + if (!publicCompany.hasFloated()) checkFlotation(publicCompany); + return true; } |
From: Erik V. <ev...@us...> - 2009-12-07 17:49:33
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32520/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Aded missing messages on token exchanges on merging. Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** StockRound_18EU.java 27 Nov 2009 20:35:18 -0000 1.28 --- StockRound_18EU.java 7 Dec 2009 17:49:23 -0000 1.29 *************** *** 551,554 **** --- 551,567 ---- cert.getPortfolio().getName(), minor.getName() )); + if (major != null) { + if (action.getReplaceToken()) { + ReportBuffer.add(LocalText.getText("ExchangesBaseToken", + major.getName(), + minor.getName(), + homeHex.getName())); + } else { + ReportBuffer.add(LocalText.getText("NoBaseTokenExchange", + major.getName(), + minor.getName(), + homeHex.getName())); + } + } cert.moveTo(currentPlayer.getPortfolio()); ReportBuffer.add(LocalText.getText("MinorCloses", minor.getName())); |
From: Erik V. <ev...@us...> - 2009-12-07 17:49:01
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32327 Modified Files: LocalisedText.properties Log Message: Improved token exchange texts Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** LocalisedText.properties 29 Nov 2009 15:46:14 -0000 1.85 --- LocalisedText.properties 7 Dec 2009 17:48:53 -0000 1.86 *************** *** 140,144 **** EnterRevenue=Enter the earnings of the operating company EnterSearch=Enter search target ! ExchangesBaseToken={0} exchanges a {1} base token on {2} ExchangeableToken=Hex {1} {2}, city {3} (with tracks to {4}) [was {0} token] ExchangeTokens=Exchange tokens --- 140,144 ---- EnterRevenue=Enter the earnings of the operating company EnterSearch=Enter search target ! ExchangesBaseToken={0} exchanges the {1} base token on {2} ExchangeableToken=Hex {1} {2}, city {3} (with tracks to {4}) [was {0} token] ExchangeTokens=Exchange tokens *************** *** 247,251 **** NEW=New NewGame=New Game ! NoBaseTokenExchange={0} does not exchange a token on {1} NoDumping=Cannot dump presidency NoGameOptions=This game has no options --- 247,251 ---- NEW=New NewGame=New Game ! NoBaseTokenExchange={0} does not exchange the {1} base token on {2} NoDumping=Cannot dump presidency NoGameOptions=This game has no options |
From: Erik V. <ev...@us...> - 2009-12-07 17:48:44
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32278/rails/ui/swing Modified Files: ORWindow.java Log Message: Added round type check to updateStatus(), to prevent errors on map updates outside OR (such as token exchanges) Index: ORWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORWindow.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ORWindow.java 27 Nov 2009 20:31:50 -0000 1.28 --- ORWindow.java 7 Dec 2009 17:48:32 -0000 1.29 *************** *** 155,159 **** String numORs = gameManager.getNumOfORs (); ! /*if (!or.wasInterrupted())*/ orPanel.recreate(or); setTitle(LocalText.getText("MapWindowORTitle", gameManager.getORId(), --- 155,159 ---- String numORs = gameManager.getNumOfORs (); ! orPanel.recreate(or); setTitle(LocalText.getText("MapWindowORTitle", gameManager.getORId(), *************** *** 171,174 **** --- 171,178 ---- public void updateStatus() { + // Safety check. Do nothing if this method is called outside Operating Rounds, + // for instance when a token is exchanged during a Stock Round. + if (!(gameUIManager.getCurrentRound() instanceof OperatingRound)) return; + orUIManager.updateStatus(); requestFocus(); |
From: Erik V. <ev...@us...> - 2009-12-07 17:47:37
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32107/rails/game Modified Files: MapHex.java Log Message: Call update() on token exchange to update map. Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MapHex.java 7 Nov 2009 12:09:56 -0000 1.31 --- MapHex.java 7 Dec 2009 17:47:29 -0000 1.32 *************** *** 700,703 **** --- 700,704 ---- } else { token.moveTo(city); + update(); return true; } |
From: Erik V. <ev...@us...> - 2009-12-07 17:46:46
|
Update of /cvsroot/rails/18xx/data/18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32054/data/18EU Modified Files: TileSet.xml Map.xml Tiles.xml Log Message: Replaced tile -901 by -800 for ports Index: TileSet.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/TileSet.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TileSet.xml 24 Dec 2008 14:52:47 -0000 1.4 --- TileSet.xml 7 Dec 2009 17:46:37 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- </Tile> <Tile id="-3"/> + <Tile id="-800"/> <Tile id="-901"/> <Tile id="-902"/> Index: Map.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Map.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Map.xml 7 Nov 2009 17:22:44 -0000 1.10 --- Map.xml 7 Dec 2009 17:46:37 -0000 1.11 *************** *** 1,5 **** <Map mapClass="rails.ui.swing.hexmap.NSHexMap" tileOrientation="NS" letterOrientation="vertical" even="A"> <!-- Hex name="" tile="" orientation="" value="" impassable="" label="" cost="" value="" port="yes/no" --> ! <Hex name="A4" port="yes" value="10" tile="-901" orientation="1"/> <Hex name="B7" value="30,50" tile="-939" orientation="1" city="Hamburg"/> <Hex name="C4" label="Y" tile="-10" city="Amsterdam"/> --- 1,5 ---- <Map mapClass="rails.ui.swing.hexmap.NSHexMap" tileOrientation="NS" letterOrientation="vertical" even="A"> <!-- Hex name="" tile="" orientation="" value="" impassable="" label="" cost="" value="" port="yes/no" --> ! <Hex name="A4" port="yes" value="10" tile="-800" orientation="0"/> <Hex name="B7" value="30,50" tile="-939" orientation="1" city="Hamburg"/> <Hex name="C4" label="Y" tile="-10" city="Amsterdam"/> *************** *** 115,124 **** <Hex name="T5" tile="-10" city="Genoa"/> <Hex name="T7" tile="-1" city="Bologna"/> ! <Hex name="T9" port="yes" value="10" tile="-901" orientation="4"/> ! <Hex name="U2" port="yes" value="10" tile="-901" orientation="4"/> <Hex name="U4" tile="0" /> <Hex name="U6" tile="-1" city="Florence"/> <Hex name="U8" tile="0" /> ! <Hex name="V5" port="yes" value="10" tile="-901" orientation="4"/> <Hex name="V7" label="V" value="30,50" tile="-903" orientation="4" city="Rome"/> </Map> --- 115,124 ---- <Hex name="T5" tile="-10" city="Genoa"/> <Hex name="T7" tile="-1" city="Bologna"/> ! <Hex name="T9" port="yes" value="10" tile="-800" orientation="3"/> ! <Hex name="U2" port="yes" value="10" tile="-800" orientation="3"/> <Hex name="U4" tile="0" /> <Hex name="U6" tile="-1" city="Florence"/> <Hex name="U8" tile="0" /> ! <Hex name="V5" port="yes" value="10" tile="-800" orientation="3"/> <Hex name="V7" label="V" value="30,50" tile="-903" orientation="4" city="Rome"/> </Map> Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18EU/Tiles.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Tiles.xml 5 Mar 2008 19:55:14 -0000 1.6 --- Tiles.xml 7 Dec 2009 17:46:37 -0000 1.7 *************** *** 6,9 **** --- 6,12 ---- <Station id="city1" position="252" type="Town" value="10"/> <Track from="city1" gauge="normal" to="side2"/> + <Track from="city1" gauge="normal" to="side3"/></Tile> + <Tile colour="fixed" id="-800"> + <Station id="city1" position="302" type="Town" value="10"/> <Track from="city1" gauge="normal" to="side3"/> </Tile><Tile colour="red" id="-901" name="OM 1 way"> |
From: Erik V. <ev...@us...> - 2009-11-29 15:46:29
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5398 Modified Files: LocalisedText.properties Log Message: Added Find functionality to Report Window Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** LocalisedText.properties 28 Nov 2009 22:41:05 -0000 1.84 --- LocalisedText.properties 29 Nov 2009 15:46:14 -0000 1.85 *************** *** 139,142 **** --- 139,143 ---- EndOfOperatingRound=\nEnd of Operating Round {0} EnterRevenue=Enter the earnings of the operating company + EnterSearch=Enter search target ExchangesBaseToken={0} exchanges a {1} base token on {2} ExchangeableToken=Hex {1} {2}, city {3} (with tracks to {4}) [was {0} token] *************** *** 149,152 **** --- 150,157 ---- Extra3Trains=Extra 3-trains Extra4Trains=Extra 4-trains + FIND=Find + FIND_BACK=Find Backwards + FIND_NEXT=Find Next + FIND_PREV=Find Previous FILE=File FixedPriceNotPaid=Invalid price {0}, fixed price is {1} *************** *** 304,308 **** PriceAboveUpperLimit=Price ({0}) is above the maximum buy price ({1}) of {2} PriceBelowLowerLimit=Price ({0}) is below the minimum buy price ({1}) of {2} ! PriceIsPaidTo=The price ({0}) is paid to {1} PrivateBuyingIsNotAllowed=Private buying is not allowed PrivateCloses=Private {0} is closed --- 309,314 ---- PriceAboveUpperLimit=Price ({0}) is above the maximum buy price ({1}) of {2} PriceBelowLowerLimit=Price ({0}) is below the minimum buy price ({1}) of {2} ! PriceIsPaidTo=The price ({0}) is paid to {1} ! PRINT=Print PrivateBuyingIsNotAllowed=Private buying is not allowed PrivateCloses=Private {0} is closed |
From: Erik V. <ev...@us...> - 2009-11-29 15:46:23
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5398/rails/ui/swing Modified Files: ReportWindow.java Log Message: Added Find functionality to Report Window Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ReportWindow.java 28 Nov 2009 22:41:04 -0000 1.13 --- ReportWindow.java 29 Nov 2009 15:46:14 -0000 1.14 *************** *** 10,14 **** import java.io.IOException; import java.io.PrintWriter; - import java.util.Date; import javax.swing.*; --- 10,13 ---- *************** *** 16,22 **** import org.apache.log4j.Logger; - import rails.game.DisplayBuffer; - import rails.game.Game; - import rails.game.GameManager; import rails.game.GameManagerI; import rails.game.ReportBuffer; --- 15,18 ---- *************** *** 40,44 **** private JMenuBar menuBar; private JMenu fileMenu, editMenu; ! private JMenuItem saveItem, loadItem, printItem, findItem; private GameManagerI gameManager; --- 36,41 ---- private JMenuBar menuBar; private JMenu fileMenu, editMenu; ! private JMenuItem saveItem, loadItem, printItem; ! private JMenuItem findItem, findBackItem, findNextItem, findPrevItem; private GameManagerI gameManager; *************** *** 53,57 **** protected static final String PRINT_CMD = "Print"; protected static final String FIND_CMD = "Find"; ! protected static Logger log = Logger.getLogger(ReportWindow.class.getPackage().getName()); --- 50,57 ---- protected static final String PRINT_CMD = "Print"; protected static final String FIND_CMD = "Find"; ! protected static final String FIND_BACK_CMD = "FindBack"; ! protected static final String FIND_NEXT_CMD = "FindNext"; ! protected static final String FIND_PREV_CMD = "FindPrev"; ! protected static Logger log = Logger.getLogger(ReportWindow.class.getPackage().getName()); *************** *** 105,109 **** --- 105,155 ---- fileMenu.add(saveItem); + printItem = new ActionMenuItem(LocalText.getText("PRINT")); + printItem.setActionCommand(PRINT_CMD); + printItem.setMnemonic(KeyEvent.VK_P); + printItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, + ActionEvent.ALT_MASK)); + printItem.addActionListener(this); + printItem.setEnabled(false); + fileMenu.add(printItem); + + findItem = new ActionMenuItem(LocalText.getText("FIND")); + findItem.setActionCommand(FIND_CMD); + findItem.setMnemonic(KeyEvent.VK_F); + findItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, + ActionEvent.CTRL_MASK)); + findItem.addActionListener(this); + findItem.setEnabled(true); + editMenu.add(findItem); + + findBackItem = new ActionMenuItem(LocalText.getText("FIND_BACK")); + findBackItem.setActionCommand(FIND_BACK_CMD); + findBackItem.setMnemonic(KeyEvent.VK_B); + findBackItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, + ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK)); + findBackItem.addActionListener(this); + findBackItem.setEnabled(true); + editMenu.add(findBackItem); + + findNextItem = new ActionMenuItem(LocalText.getText("FIND_NEXT")); + findNextItem.setActionCommand(FIND_NEXT_CMD); + findNextItem.setMnemonic(KeyEvent.VK_N); + findNextItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, + ActionEvent.CTRL_MASK)); + findNextItem.addActionListener(this); + findNextItem.setEnabled(true); + editMenu.add(findNextItem); + + findPrevItem = new ActionMenuItem(LocalText.getText("FIND_PREV")); + findPrevItem.setActionCommand(FIND_PREV_CMD); + findPrevItem.setMnemonic(KeyEvent.VK_P); + findPrevItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, + ActionEvent.CTRL_MASK | ActionEvent.SHIFT_MASK)); + findPrevItem.addActionListener(this); + findPrevItem.setEnabled(true); + editMenu.add(findPrevItem); + menuBar.add(fileMenu); + menuBar.add(editMenu); setJMenuBar(menuBar); *************** *** 149,152 **** --- 195,206 ---- } else if (SAVE_CMD.equalsIgnoreCase(command)) { saveReportFile(); + } else if (FIND_CMD.equalsIgnoreCase(command)) { + findText(false); + } else if (FIND_BACK_CMD.equalsIgnoreCase(command)) { + findText(true); + } else if (FIND_NEXT_CMD.equalsIgnoreCase(command)) { + findNext(false); + } else if (FIND_PREV_CMD.equalsIgnoreCase(command)) { + findNext(true); } } *************** *** 210,213 **** --- 264,300 ---- } + private void findText(boolean backwards) { + + String text = reportText.getText(); + String target = JOptionPane.showInputDialog(reportText, + LocalText.getText("EnterSearch")); + if (!Util.hasValue(target)) return; + + int startPos = editable + ? reportText.getCaretPosition() + : backwards ? text.length() : 0; + int foundPos = backwards + ? text.lastIndexOf(target, startPos) + : text.indexOf(target, startPos); + if (foundPos < 0) return; + + reportText.select(foundPos, foundPos + target.length()); + } + + private void findNext(boolean backwards) { + + String text = reportText.getText(); + String target = reportText.getSelectedText(); + if (!Util.hasValue(target)) return; + + int startPos = reportText.getSelectionStart(); + int foundPos = backwards + ? text.lastIndexOf(target, startPos-1) + : text.indexOf(target, startPos+1); + if (foundPos < 0) return; + + reportText.select(foundPos, foundPos + target.length()); + } + public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { |
From: Erik V. <ev...@us...> - 2009-11-28 22:41:19
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1818/rails/ui/swing Modified Files: ReportWindow.java Log Message: Added option to make Report Window editable, and to save from and load files into this window Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ReportWindow.java 27 Nov 2009 20:32:18 -0000 1.12 --- ReportWindow.java 28 Nov 2009 22:41:04 -0000 1.13 *************** *** 4,14 **** --- 4,28 ---- import java.awt.*; import java.awt.event.*; + import java.io.BufferedReader; + import java.io.File; + import java.io.FileReader; + import java.io.FileWriter; + import java.io.IOException; + import java.io.PrintWriter; + import java.util.Date; import javax.swing.*; + import org.apache.log4j.Logger; + + import rails.game.DisplayBuffer; + import rails.game.Game; + import rails.game.GameManager; import rails.game.GameManagerI; import rails.game.ReportBuffer; + import rails.ui.swing.elements.ActionMenuItem; import rails.util.Config; import rails.util.LocalText; + import rails.util.Util; /** *************** *** 16,43 **** * during the rails.game. */ ! public class ReportWindow extends JFrame implements KeyListener { private static final long serialVersionUID = 1L; ! private JTextArea message; private JScrollPane messageScroller; private JScrollBar vbar; private JPanel messagePanel; private ReportWindow messageWindow; private GameManagerI gameManager; public ReportWindow(GameManagerI gameManager) { messageWindow = this; this.gameManager = gameManager; ! message = new JTextArea(); ! message.setEditable(false); ! message.setLineWrap(false); ! message.setBackground(Color.WHITE); ! message.setOpaque(true); ! message.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); messagePanel = new JPanel(new GridBagLayout()); messageScroller = ! new JScrollPane(message, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); --- 30,75 ---- * during the rails.game. */ ! public class ReportWindow extends JFrame implements ActionListener, KeyListener { private static final long serialVersionUID = 1L; ! private JTextArea reportText; private JScrollPane messageScroller; private JScrollBar vbar; private JPanel messagePanel; private ReportWindow messageWindow; + private JMenuBar menuBar; + private JMenu fileMenu, editMenu; + private JMenuItem saveItem, loadItem, printItem, findItem; + private GameManagerI gameManager; + + private String reportDirectory = Config.get("report.directory"); + private String reportFile; + + private boolean editable = "yes".equalsIgnoreCase(Config.get("report.window.editable")); + protected static final String SAVE_CMD = "Save"; + protected static final String LOAD_CMD = "Load"; + protected static final String PRINT_CMD = "Print"; + protected static final String FIND_CMD = "Find"; + + protected static Logger log = + Logger.getLogger(ReportWindow.class.getPackage().getName()); + + public ReportWindow(GameManagerI gameManager) { messageWindow = this; this.gameManager = gameManager; ! reportText = new JTextArea(); ! reportText.setEditable(editable); ! 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); *************** *** 45,51 **** GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; ! gbc.weightx = gbc.weighty = 0.5; gbc.fill = GridBagConstraints.BOTH; messagePanel.add(messageScroller, gbc); setContentPane(messagePanel); --- 77,112 ---- 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_CMD); + 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_CMD); + saveItem.setMnemonic(KeyEvent.VK_S); + saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, + ActionEvent.ALT_MASK)); + saveItem.addActionListener(this); + saveItem.setEnabled(true); + fileMenu.add(saveItem); + + menuBar.add(fileMenu); + + setJMenuBar(menuBar); + setContentPane(messagePanel); *************** *** 69,73 **** String newText = ReportBuffer.get(); if (newText.length() > 0) { ! message.append(newText); scrollDown(); } --- 130,134 ---- String newText = ReportBuffer.get(); if (newText.length() > 0) { ! reportText.append(newText); scrollDown(); } *************** *** 82,85 **** --- 143,213 ---- } + public void actionPerformed(ActionEvent actor) { + String command = actor.getActionCommand(); + if (LOAD_CMD.equalsIgnoreCase(command)) { + loadReportFile(); + } else if (SAVE_CMD.equalsIgnoreCase(command)) { + saveReportFile(); + } + } + + private void loadReportFile() { + + JFileChooser jfc = new JFileChooser(); + if (Util.hasValue(reportDirectory)) + jfc.setCurrentDirectory(new File(reportDirectory)); + File selectedFile; + + if (jfc.showOpenDialog(getContentPane()) == JFileChooser.APPROVE_OPTION) { + selectedFile = jfc.getSelectedFile(); + reportFile = selectedFile.getPath(); + reportDirectory = selectedFile.getParent(); + } else { + return; + } + + try { + BufferedReader in = new BufferedReader (new FileReader(selectedFile)); + String line; + StringBuffer b = new StringBuffer(); + while ((line = in.readLine()) != null) b.append(line).append("\n"); + in.close(); + reportText.setText(b.toString()); + } catch (IOException e) { + log.error ("Error whilst reading file "+reportFile, e); + JOptionPane.showMessageDialog(this, + e.getMessage(), "", JOptionPane.ERROR_MESSAGE); + } + } + + private void saveReportFile () { + + JFileChooser jfc = new JFileChooser(); + if (Util.hasValue(reportDirectory)) { + jfc.setCurrentDirectory(new File(reportDirectory)); + } + if (Util.hasValue(reportFile)) { + jfc.setSelectedFile(new File(reportFile)); + } + if (jfc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { + File selectedFile = jfc.getSelectedFile(); + String filepath = selectedFile.getPath(); + reportDirectory = selectedFile.getParent(); + if (!selectedFile.getName().equalsIgnoreCase(reportFile)) { + reportFile = filepath; + } + + try { + PrintWriter out = new PrintWriter (new FileWriter (new File (reportFile))); + out.print(reportText.getText()); + out.close(); + } catch (IOException e) { + log.error ("Error whilst writing file "+reportFile, e); + JOptionPane.showMessageDialog(this, + e.getMessage(), "", JOptionPane.ERROR_MESSAGE); + } + } + } + public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { |
From: Erik V. <ev...@us...> - 2009-11-28 22:41:17
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1818 Modified Files: my.properties LocalisedText.properties Log Message: Added option to make Report Window editable, and to save from and load files into this window Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** LocalisedText.properties 27 Nov 2009 20:35:18 -0000 1.83 --- LocalisedText.properties 28 Nov 2009 22:41:05 -0000 1.84 *************** *** 128,131 **** --- 128,132 ---- DuplicateTilesetID=Duplicate tile {0} in TileSet.xml DuplicateTokenRemoved=Duplicate {0} token on hex {1} returned to company + EDIT=Edit EMERGENCY_SHARE_SELLING_TITLE=Rails: Game Status - SELLING SHARES FOR EMERGENCY CASH RAISING END_OF_GAME_CLOSE_ALL_WINDOWS=Close all windows *************** *** 216,219 **** --- 217,221 ---- LoadFailed=Load failed, reason: {0} LoadGame=Load Game + LOAD=Load LoadInterrupted=Load interrupted at this point, you can continue play from here LoansNotAllowed={0} may not take any loans Index: my.properties =================================================================== RCS file: /cvsroot/rails/18xx/my.properties,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** my.properties 27 Nov 2009 20:33:32 -0000 1.9 --- my.properties 28 Nov 2009 22:41:05 -0000 1.10 *************** *** 65,68 **** --- 65,71 ---- # Valid values are yes and no (default). #report.window.open=yes + # Specify if the report window is editable, so you can add your own comments. + # Valid values are yes and no (default). + #report.window.editable=yes ### Default players |
From: Erik V. <ev...@us...> - 2009-11-27 21:51:30
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8532/rails/game Modified Files: TreasuryShareRound.java Log Message: Fixed missing argument for 'sold' message Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TreasuryShareRound.java 7 Oct 2009 19:00:38 -0000 1.14 --- TreasuryShareRound.java 27 Nov 2009 20:30:56 -0000 1.15 *************** *** 477,480 **** --- 477,481 ---- companyName, numberSold, + company.getShareUnit(), (numberSold * company.getShareUnit()), companyName, |
From: Erik V. <ev...@us...> - 2009-11-27 20:51:50
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8699/rails/ui/swing Modified Files: ReportWindow.java Log Message: Enable initial visibility Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ReportWindow.java 26 Nov 2009 22:15:28 -0000 1.11 --- ReportWindow.java 27 Nov 2009 20:32:18 -0000 1.12 *************** *** 9,12 **** --- 9,13 ---- import rails.game.GameManagerI; import rails.game.ReportBuffer; + import rails.util.Config; import rails.util.LocalText; *************** *** 62,66 **** }); addKeyListener(this); ! } --- 63,67 ---- }); addKeyListener(this); ! setVisible("yes".equalsIgnoreCase(Config.get("report.window.open"))); } *************** *** 72,76 **** } } ! public void scrollDown () { SwingUtilities.invokeLater(new Runnable() { --- 73,77 ---- } } ! public void scrollDown () { SwingUtilities.invokeLater(new Runnable() { |
From: Erik V. <ev...@us...> - 2009-11-27 20:51:38
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9149/rails/game Modified Files: StartRound_1830.java StartRound_1835.java GameManagerI.java Round.java StockRound.java OperatingRound.java StartRound.java GameManager.java Log Message: Beautified report window contents & log Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StartRound.java 17 Nov 2009 22:38:29 -0000 1.30 --- StartRound.java 27 Nov 2009 20:35:18 -0000 1.31 *************** *** 21,24 **** --- 21,25 ---- protected String variant; protected Player currentPlayer; + protected Player startPlayer; /** *************** *** 77,82 **** setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); currentPlayer = getCurrentPlayer(); - ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("StartOfInitialRound")); ReportBuffer.add(LocalText.getText("HasPriority", --- 78,83 ---- setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); currentPlayer = getCurrentPlayer(); + startPlayer = currentPlayer; ReportBuffer.add(LocalText.getText("StartOfInitialRound")); ReportBuffer.add(LocalText.getText("HasPriority", *************** *** 136,142 **** */ possibleActions.clear(); - //gameManager.nextRound(this); finishRound(); ! } else if (!setPossibleActions()) { /* * If nobody can do anything, keep executing Operating and Start --- 137,142 ---- */ possibleActions.clear(); finishRound(); ! // } else if (!setPossibleActions()) { /* * If nobody can do anything, keep executing Operating and Start *************** *** 145,149 **** * ultimately be possible. */ ! finishRound(); } --- 145,149 ---- * ultimately be possible. */ ! // finishRound(); } *************** *** 151,154 **** --- 151,156 ---- } + + /*----- Processing player actions -----*/ Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** GameManager.java 25 Nov 2009 18:48:19 -0000 1.70 --- GameManager.java 27 Nov 2009 20:35:18 -0000 1.71 *************** *** 72,75 **** --- 72,76 ---- protected int currentNumberOfOperatingRounds = 1; protected boolean skipFirstStockRound = false; + protected boolean showCompositeORNumber = true; protected boolean gameEndsWithBankruptcy = false; *************** *** 408,411 **** --- 409,414 ---- priorityPlayer.setState(players.get(0)); setPlayerCertificateLimit (playerManager.getInitialPlayerCertificateLimit()); + + showCompositeORNumber = !"simple".equalsIgnoreCase(Config.get("or.number_format")); } *************** *** 587,590 **** --- 590,601 ---- } + public String getORId () { + if (showCompositeORNumber) { + return getCompositeORNumber(); + } else { + return String.valueOf(absoluteORNumber.intValue()); + } + } + /* (non-Javadoc) * @see rails.game.GameManagerI#getCompositeORNumber() *************** *** 594,597 **** --- 605,612 ---- } + public int getRelativeORNumber() { + return relativeORNumber.intValue(); + } + public String getNumOfORs () { return new Integer(numOfORs).toString(); Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Round.java 25 Nov 2009 18:44:45 -0000 1.29 --- Round.java 27 Nov 2009 20:35:18 -0000 1.30 *************** *** 184,187 **** --- 184,189 ---- PublicCompanyI comp = action.getCompany(); + ReportBuffer.add(""); + for (ExchangeableToken token : tokens) { cityName = token.getCityName(); Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** OperatingRound.java 26 Nov 2009 20:14:30 -0000 1.80 --- OperatingRound.java 27 Nov 2009 20:35:18 -0000 1.81 *************** *** 124,129 **** super (gameManager); - thisOrNumber = gameManager.getCompositeORNumber(); - if (players == null) { players = gameManager.getPlayers(); --- 124,127 ---- *************** *** 136,139 **** --- 134,142 ---- public void start(boolean operate) { + thisOrNumber = gameManager.getORId(); + + ReportBuffer.add(LocalText.getText("START_OR", thisOrNumber)); + + int count = 0; for (PrivateCompanyI priv : companyManager.getAllPrivateCompanies()) { if (!priv.isClosed()) { *************** *** 141,144 **** --- 144,148 ---- CashHolder recipient = ((Portfolio)priv.getHolder()).getOwner(); int revenue = priv.getRevenue(); + if (count++ == 0) ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("ReceivesFor", recipient.getName(), *************** *** 151,156 **** } - ReportBuffer.add(LocalText.getText("START_OR", thisOrNumber)); - if (operate) { --- 155,158 ---- *************** *** 1009,1012 **** --- 1011,1017 ---- protected void initTurn() { log.debug("Starting turn of "+operatingCompany.getName()); + ReportBuffer.add(LocalText.getText("CompanyOperates", + operatingCompany.getName(), + operatingCompany.getPresident().getName())); setCurrentPlayer(operatingCompany.getPresident()); operatingCompany.initTurn(); Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** StartRound_1830.java 23 Nov 2009 18:32:45 -0000 1.25 --- StartRound_1830.java 27 Nov 2009 20:35:18 -0000 1.26 *************** *** 40,43 **** --- 40,44 ---- if (startPacket.areAllSold()) return false; + if (currentPlayer == startPlayer) ReportBuffer.add(""); while (possibleActions.isEmpty()) { Index: StartRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1835.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** StartRound_1835.java 7 Oct 2009 19:00:38 -0000 1.21 --- StartRound_1835.java 27 Nov 2009 20:35:18 -0000 1.22 *************** *** 111,114 **** --- 111,116 ---- Player currentPlayer = getCurrentPlayer(); + if (currentPlayer == startPlayer) ReportBuffer.add(""); + int cashToSpend = currentPlayer.getCash(); Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** StockRound.java 25 Nov 2009 18:44:45 -0000 1.51 --- StockRound.java 27 Nov 2009 20:35:18 -0000 1.52 *************** *** 21,24 **** --- 21,25 ---- protected int numberOfPlayers; protected Player currentPlayer; + protected Player startingPlayer; protected State companyBoughtThisTurnWrapper = *************** *** 74,85 **** public void start() { ! ReportBuffer.add("\n" + LocalText.getText("StartStockRound", ! + getStockRoundNumber())); setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); initPlayer(); ! ReportBuffer.add(LocalText.getText("HasPriority", ! currentPlayer.getName() )); } --- 75,88 ---- public void start() { ! ReportBuffer.add(LocalText.getText("StartStockRound", ! getStockRoundNumber())); setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); + startingPlayer = getCurrentPlayer(); // For the Report + ReportBuffer.add(LocalText.getText("HasPriority", + startingPlayer.getName() )); initPlayer(); ! } *************** *** 1188,1191 **** --- 1191,1195 ---- hasSoldThisTurnBeforeBuying.set(false); hasActed.set(false); + if (currentPlayer == startingPlayer) ReportBuffer.add(""); } Index: GameManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManagerI.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GameManagerI.java 25 Nov 2009 18:48:19 -0000 1.22 --- GameManagerI.java 27 Nov 2009 20:35:18 -0000 1.23 *************** *** 31,35 **** --- 31,37 ---- public abstract void nextRound(RoundI round); + public String getORId (); public abstract String getCompositeORNumber(); + public int getRelativeORNumber(); public abstract int getSRNumber(); |
From: Erik V. <ev...@us...> - 2009-11-27 20:51:30
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8810/rails/ui/swing Modified Files: StatusWindow.java Log Message: Enable initial report window visibility Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** StatusWindow.java 6 Oct 2009 18:34:04 -0000 1.28 --- StatusWindow.java 27 Nov 2009 20:32:44 -0000 1.29 *************** *** 17,20 **** --- 17,21 ---- import rails.ui.swing.elements.ActionButton; import rails.ui.swing.elements.ActionMenuItem; + import rails.util.Config; import rails.util.LocalText; *************** *** 209,212 **** --- 210,216 ---- setJMenuBar(menuBar); + if ("yes".equalsIgnoreCase(Config.get("report.window.open"))) { + enableCheckBoxMenuItem(REPORT_CMD); + } } |
From: Erik V. <ev...@us...> - 2009-11-27 20:35:27
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9149/rails/game/specific/_18EU Modified Files: StartRound_18EU.java StockRound_18EU.java Log Message: Beautified report window contents & log Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** StockRound_18EU.java 26 Nov 2009 20:14:30 -0000 1.27 --- StockRound_18EU.java 27 Nov 2009 20:35:18 -0000 1.28 *************** *** 538,541 **** --- 538,542 ---- if (cert != null) { + ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("MERGE_MINOR_LOG", currentPlayer.getName(), *************** *** 554,557 **** --- 555,559 ---- checkFlotation(major); } else { + ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("CLOSE_MINOR_LOG", currentPlayer.getName(), Index: StartRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StartRound_18EU.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StartRound_18EU.java 7 Oct 2009 21:03:36 -0000 1.9 --- StartRound_18EU.java 27 Nov 2009 20:35:18 -0000 1.10 *************** *** 243,247 **** } ! ReportBuffer.add(LocalText.getText("SELECT_ITEM", playerName, item.getName() )); --- 243,247 ---- } ! ReportBuffer.add(LocalText.getText("SelectForAuctioning", playerName, item.getName() )); |
From: Erik V. <ev...@us...> - 2009-11-27 20:35:26
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9149/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java CGRFormationRound.java Log Message: Beautified report window contents & log Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CGRFormationRound.java 26 Nov 2009 20:14:30 -0000 1.23 --- CGRFormationRound.java 27 Nov 2009 20:35:18 -0000 1.24 *************** *** 58,62 **** companiesToRepayLoans = null; ! ReportBuffer.add(LocalText.getText("StartCGRFormationRound", startingPlayer.getName())); --- 58,63 ---- companiesToRepayLoans = null; ! ReportBuffer.add(LocalText.getText("StartFormationRound", ! cgrName, startingPlayer.getName())); *************** *** 81,84 **** --- 82,89 ---- } + ReportBuffer.add(LocalText.getText("StartFormationRound", + cgrName, + startingPlayer.getName())); + setStep(STEP_REPAY_LOANS); *************** *** 155,159 **** // If that was all, we're done with this company numberOfLoans = currentCompany.getCurrentNumberOfLoans(); ! if (numberOfLoans == 0) continue; // Check the president's cash --- 160,166 ---- // If that was all, we're done with this company numberOfLoans = currentCompany.getCurrentNumberOfLoans(); ! if (numberOfLoans == 0) { ! continue; ! } // Check the president's cash *************** *** 267,271 **** } ! return true; } --- 274,278 ---- } ! return true; } *************** *** 287,290 **** --- 294,299 ---- cgrSharesUsed = 0; + ReportBuffer.add(""); + do { player = getCurrentPlayer(); *************** *** 475,478 **** --- 484,502 ---- ReportBuffer.add (LocalText.getText("Floats", PublicCompany_CGR.NAME)); + // Determine the new certificate limit. + // The number of available companies is 11, + // or 12 minus the number of closed companies, whichever is lower. + int numCompanies = Math.min(11, 12-mergingCompanies.size()); + int numPlayers = gameManager.getNumberOfPlayers(); + // Need some checks here... + int newCertLimit = certLimitsTable[numPlayers-3][numCompanies-4]; + gameManager.setPlayerCertificateLimit(newCertLimit); + message = LocalText.getText("CertificateLimit", + newCertLimit, + numPlayers, + numCompanies); + DisplayBuffer.add(message); + ReportBuffer.add(message); + // Collect the old token spots, and move cash and trains List<BaseToken> homeTokens = new ArrayList<BaseToken>(); *************** *** 514,518 **** 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); --- 538,542 ---- 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); *************** *** 522,525 **** --- 546,550 ---- // Replace the home tokens + ReportBuffer.add(""); for (BaseToken token : homeTokens) { city = (City) token.getHolder(); *************** *** 590,593 **** --- 615,619 ---- int trainLimit = cgr.getTrainLimit(gameManager.getCurrentPlayerIndex()); List<TrainI> trains = cgr.getPortfolio().getTrainList(); + if (cgr.getNumberOfTrains() > trainLimit) ReportBuffer.add(""); outer: while (cgr.getNumberOfTrains() > trainLimit) { for (TrainI train : trains) { *************** *** 602,620 **** } - // Determine the new certificate limit. - // The number of available companies is 11, - // or 12 minus the number of closed companies, whichever is lower. - int numCompanies = Math.min(11, 12-mergingCompanies.size()); - int numPlayers = gameManager.getNumberOfPlayers(); - // Need some checks here... - int newCertLimit = certLimitsTable[numPlayers-3][numCompanies-4]; - gameManager.setPlayerCertificateLimit(newCertLimit); - message = LocalText.getText("CertificateLimit", - newCertLimit, - numPlayers, - numCompanies); - DisplayBuffer.add(message); - ReportBuffer.add(message); - } --- 628,631 ---- *************** *** 622,625 **** --- 633,637 ---- City city; MapHex hex; + ReportBuffer.add(""); for (BaseToken token : exchangedTokens) { // Remove old token Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** OperatingRound_1856.java 7 Oct 2009 18:56:22 -0000 1.24 --- OperatingRound_1856.java 27 Nov 2009 20:35:18 -0000 1.25 *************** *** 477,481 **** // Remove closed companies from the operating company list ! // (leave this code in case we need it; it works) //for (Iterator<PublicCompanyI> it = companies.iterator(); // it.hasNext(); ) { --- 477,481 ---- // Remove closed companies from the operating company list ! // (PLEASE leave this code in case we need it; it works) //for (Iterator<PublicCompanyI> it = companies.iterator(); // it.hasNext(); ) { *************** *** 515,518 **** --- 515,521 ---- message = LocalText.getText("DoesNotForm", cgr.getName()); } + ReportBuffer.add(LocalText.getText("EndOfFormationRound", + cgr.getName(), + getRoundName())); ReportBuffer.add (message); DisplayBuffer.add(message); |