You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(46) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
|
Apr
|
May
(14) |
Jun
|
Jul
(13) |
Aug
(30) |
Sep
(83) |
Oct
(56) |
Nov
(148) |
Dec
(107) |
2010 |
Jan
(260) |
Feb
(164) |
Mar
(183) |
Apr
(99) |
May
(160) |
Jun
(40) |
Jul
(33) |
Aug
(48) |
Sep
(22) |
Oct
(24) |
Nov
(1) |
Dec
(12) |
2011 |
Jan
(6) |
Feb
(15) |
Mar
(13) |
Apr
(37) |
May
(27) |
Jun
(29) |
Jul
(33) |
Aug
(20) |
Sep
(17) |
Oct
(20) |
Nov
(33) |
Dec
(17) |
2012 |
Jan
(39) |
Feb
(38) |
Mar
(20) |
Apr
(21) |
May
(17) |
Jun
(22) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
From: Erik V. <ev...@us...> - 2010-03-27 18:44:31
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11490/rails/game/specific/_1835 Modified Files: GameManager_1835.java PrussianFormationRound.java Log Message: Prussian formation Index: PrussianFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/PrussianFormationRound.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PrussianFormationRound.java 21 Mar 2010 17:43:50 -0000 1.6 --- PrussianFormationRound.java 27 Mar 2010 18:44:24 -0000 1.7 *************** *** 3,18 **** import java.util.ArrayList; import java.util.Arrays; - import java.util.HashMap; import java.util.List; - import java.util.Map; - import java.util.TreeSet; import rails.common.GuiDef; import rails.game.*; - import rails.game.action.ExchangeableToken; import rails.game.action.PossibleAction; import rails.game.move.CashMove; import rails.game.special.ExchangeForShare; - import rails.game.special.SellBonusToken; import rails.game.special.SpecialPropertyI; import rails.util.LocalText; --- 3,13 ---- *************** *** 157,164 **** FoldIntoPrussian a = (FoldIntoPrussian) action; ! List<CompanyI> folded = a.getFoldedCompanies(); ! if (step == Step.START) { ! if (folded == null || folded.isEmpty() || !startPrussian(a)) { finishRound(); } else { --- 152,158 ---- FoldIntoPrussian a = (FoldIntoPrussian) action; ! if (step == Step.START) { ! if (!startPrussian(a)) { finishRound(); } else { *************** *** 166,178 **** } } else if (step == Step.MERGE) { ! if (!folded.isEmpty()) mergeIntoPrussian (a); ! } ! // No merge options for the current player, try the next one ! setNextPlayer(); ! if (getCurrentPlayer() == startingPlayer) { ! finishRound(); ! } return true; } else { --- 160,173 ---- } } else if (step == Step.MERGE) { ! ! mergeIntoPrussian (a); ! // No merge options for the current player, try the next one ! setNextPlayer(); ! if (getCurrentPlayer() == startingPlayer) { ! finishRound(); ! } + } return true; } else { *************** *** 186,190 **** String errMsg = null; ! while (true) { if (!(M2_ID.equals(action.getFoldedCompanyNames()))) { errMsg = LocalText.getText("WrongCompany", --- 181,188 ---- String errMsg = null; ! List<CompanyI> folded = action.getFoldedCompanies(); ! boolean folding = folded != null && !folded.isEmpty(); ! ! while (folding) { if (!(M2_ID.equals(action.getFoldedCompanyNames()))) { errMsg = LocalText.getText("WrongCompany", *************** *** 206,212 **** moveStack.start(false); ! executeStartPrussian(false); ! return true; } --- 204,210 ---- moveStack.start(false); ! if (folding) executeStartPrussian(false); ! return folding; } *************** *** 230,234 **** String errMsg = null; ! while (true) { break; } --- 228,235 ---- String errMsg = null; ! List<CompanyI> folded = action.getFoldedCompanies(); ! boolean folding = folded != null && !folded.isEmpty(); ! ! while (folding) { break; } *************** *** 245,254 **** // Execute ! executeExchange (action.getFoldedCompanies(), false, false); ! return true; } ! private void executeExchange (List<CompanyI> companies, boolean president, boolean display) { --- 246,255 ---- // Execute ! if (folding) executeExchange (action.getFoldedCompanies(), false, false); ! return folding; } ! private void executeExchange (List<CompanyI> companies, boolean president, boolean display) { Index: GameManager_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/GameManager_1835.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GameManager_1835.java 4 Mar 2010 22:12:41 -0000 1.3 --- GameManager_1835.java 27 Mar 2010 18:44:24 -0000 1.4 *************** *** 7,11 **** public static String PR_NAME = PrussianFormationRound.PR_ID; ! private RoundI previousRound; private Player prFormStartingPlayer = null; --- 7,11 ---- public static String PR_NAME = PrussianFormationRound.PR_ID; ! private RoundI previousRound = null; private Player prFormStartingPlayer = null; *************** *** 18,22 **** if (round instanceof PrussianFormationRound) { ! super.nextRound(previousRound); } else { PhaseI phase = getCurrentPhase(); --- 18,29 ---- if (round instanceof PrussianFormationRound) { ! if (interruptedRound != null) { ! setRound(interruptedRound); ! interruptedRound.resume(); ! interruptedRound = null; ! } else if (previousRound != null) { ! super.nextRound(previousRound); ! previousRound = null; ! } } else { PhaseI phase = getCurrentPhase(); *************** *** 33,36 **** --- 40,54 ---- } + + public void newPhaseChecks(RoundI round) { + PhaseI phase = getCurrentPhase(); + if (phase.getName().equals("4") || phase.getName().equals("4+4") + || phase.getName().equals("5")) { + if (!PrussianFormationRound.prussianIsComplete(this)) { + interruptedRound = round; + startPrussianFormationRound (); + } + } + } private void startPrussianFormationRound() { |
From: Erik V. <ev...@us...> - 2010-03-27 18:27:16
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8160/rails/game/specific/_1835 Modified Files: StockRound_1835.java Log Message: Fix 1856 share price adjustment if multiple 5% shares are sold in one round. Index: StockRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/StockRound_1835.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StockRound_1835.java 16 Feb 2010 20:18:25 -0000 1.7 --- StockRound_1835.java 27 Mar 2010 18:27:08 -0000 1.8 *************** *** 34,38 **** // No more changes if it has already dropped if (!soldBefore) { ! company.adjustSharePrice (SOLD, 1, gameManager.getStockMarket()); } } --- 34,38 ---- // No more changes if it has already dropped if (!soldBefore) { ! super.adjustSharePrice (company, 1, soldBefore); } } |
From: Erik V. <ev...@us...> - 2010-03-27 18:27:16
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8160/rails/game/specific/_1856 Modified Files: PublicCompany_CGR.java StockRound_1856.java Log Message: Fix 1856 share price adjustment if multiple 5% shares are sold in one round. Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StockRound_1856.java 31 Jan 2010 22:22:32 -0000 1.14 --- StockRound_1856.java 27 Mar 2010 18:27:08 -0000 1.15 *************** *** 3,10 **** --- 3,15 ---- import rails.game.*; import rails.game.action.BuyCertificate; + import rails.game.state.IntegerState; import rails.util.LocalText; public class StockRound_1856 extends StockRound { + /* Cope with multiple 5% share sales in one turn */ + private IntegerState sharesSoldSoFar; + private IntegerState squaresDownSoFar; + /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize *************** *** 15,19 **** public StockRound_1856 (GameManagerI aGameManager) { super (aGameManager); ! } /** --- 20,27 ---- public StockRound_1856 (GameManagerI aGameManager) { super (aGameManager); ! ! sharesSoldSoFar = new IntegerState("CGR_SharesSoldSoFar", 0); ! squaresDownSoFar = new IntegerState("CGR_SquaresDownSoFar", 0); ! } /** *************** *** 47,50 **** --- 55,86 ---- } + protected void initPlayer() { + super.initPlayer(); + sharesSoldSoFar.set(0); + squaresDownSoFar.set(0); + } + + protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { + + if (company instanceof PublicCompany_CGR) { + if (company.canSharePriceVary()) { + int numberOfSpaces; + if (company.getShareUnit() == 5) { + // Take care for selling 5% shares in multiple blocks per turn + numberOfSpaces + = (sharesSoldSoFar.intValue() + numberSold)/2 + - squaresDownSoFar.intValue(); + sharesSoldSoFar.add(numberSold); + squaresDownSoFar.add(numberOfSpaces); + } else { + numberOfSpaces = numberSold; + } + stockMarket.sell(company, numberOfSpaces); + } + } else { + super.adjustSharePrice (company, numberSold, soldBefore); + } + } + @Override protected CashHolder getSharePriceRecipient(PublicCertificateI cert, int cost) { Index: PublicCompany_CGR.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/PublicCompany_CGR.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PublicCompany_CGR.java 13 Mar 2010 18:42:59 -0000 1.9 --- PublicCompany_CGR.java 27 Mar 2010 18:27:08 -0000 1.10 *************** *** 30,36 **** // Share price is initially fixed canSharePriceVary.set(false); - - sharesSoldSoFar = new IntegerState(name+"_SharesSoldSoFar", 0); - squaresDownSoFar = new IntegerState(name+"_SquaresDownSoFar", 0); } --- 30,33 ---- *************** *** 142,177 **** @Override - public void adjustSharePrice (int actionPerformed, int numberOfSharesSold, - StockMarketI stockMarket) { - - if (actionPerformed == StockRound.SOLD) { - if (canSharePriceVary()) { - int numberOfSpaces; - if (shareUnit.intValue() == 5) { - // Take care for selling 5% shares in multiple blocks per turn - numberOfSpaces - = (sharesSoldSoFar.intValue() + numberOfSharesSold)/2 - - squaresDownSoFar.intValue(); - sharesSoldSoFar.add(numberOfSharesSold); - squaresDownSoFar.add(numberOfSpaces); - } else { - numberOfSpaces = numberOfSharesSold; - } - stockMarket.sell(this, numberOfSpaces); - } - } - } - - @Override - public void setOperated() { - super.setOperated(); - - // Reset the share selling counts - // TODO Should this be a generic function? - sharesSoldSoFar.set(0); - squaresDownSoFar.set(0); - } - - @Override public boolean mustOwnATrain() { if (!hadPermanentTrain()) { --- 139,142 ---- |
From: Erik V. <ev...@us...> - 2010-03-27 18:27:16
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8160/rails/game Modified Files: StockRound.java ShareSellingRound.java PublicCompanyI.java PublicCompany.java Log Message: Fix 1856 share price adjustment if multiple 5% shares are sold in one round. Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ShareSellingRound.java 14 Mar 2010 13:10:15 -0000 1.30 --- ShareSellingRound.java 27 Mar 2010 18:27:08 -0000 1.31 *************** *** 357,361 **** } } ! company.adjustSharePrice (SOLD, numberSold, gameManager.getStockMarket()); // Check if we still have the presidency --- 357,362 ---- } } ! boolean soldBefore = sellPrices.containsKey(companyName); ! adjustSharePrice (company, numberSold, soldBefore); // Check if we still have the presidency Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** PublicCompany.java 23 Mar 2010 18:44:58 -0000 1.92 --- PublicCompany.java 27 Mar 2010 18:27:08 -0000 1.93 *************** *** 1081,1093 **** } - public void adjustSharePrice (int actionPerformed, int numberOfSharesSold, - StockMarketI stockMarket) { - if (actionPerformed == StockRound.SOLD) { - if (canSharePriceVary()) { - stockMarket.sell(this, numberOfSharesSold); - } - } - } - public void updatePlayersWorth() { --- 1081,1084 ---- Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** PublicCompanyI.java 4 Mar 2010 22:08:09 -0000 1.50 --- PublicCompanyI.java 27 Mar 2010 18:27:08 -0000 1.51 *************** *** 255,261 **** public boolean canSharePriceVary(); - public void adjustSharePrice (int actionPerformed, int numberOfSharesSold, - StockMarketI stockMarket); - public void updatePlayersWorth(); --- 255,258 ---- Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** StockRound.java 21 Mar 2010 17:43:50 -0000 1.70 --- StockRound.java 27 Mar 2010 18:27:08 -0000 1.71 *************** *** 1089,1093 **** protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { ! company.adjustSharePrice (SOLD, numberSold, gameManager.getStockMarket()); } --- 1089,1096 ---- protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) { ! ! if (company.canSharePriceVary()) { ! stockMarket.sell(company, numberSold); ! } } |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:31
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916 Modified Files: build.xml Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** build.xml 21 Mar 2010 17:30:05 -0000 1.16 --- build.xml 23 Mar 2010 18:45:19 -0000 1.17 *************** *** 136,138 **** --- 136,157 ---- </java> </target> + <target name="TestGames"> + <property name="test.xml.dir" value="test/xml"/> + <property name="test.report.dir" value="test/report"/> + <mkdir dir="${test.xml.dir}"/> + <mkdir dir="${test.report.dir}"/> + <junit> + <classpath refid="18xx.classpath"/> + <formatter type="brief" usefile="false" /> + <formatter type="xml" /> + <test name ="test.TestGameBuilder" todir="${test.xml.dir}"/> + </junit> + <junitreport todir="${test.xml.dir}"> + <fileset dir="${test.xml.dir}"> + <include name="TEST-*.xml"/> + </fileset> + <report format="noframes" todir="${test.report.dir}"/> + </junitreport> + </target> + </project> |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:25
|
Update of /cvsroot/rails/18xx/test In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/test Added Files: TestGameBuilder.java test.properties TestGame.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. --- NEW FILE: TestGameBuilder.java --- package test; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; import java.util.Collections; import java.util.List; import javax.swing.JFileChooser; import javax.swing.JPanel; import javax.swing.filechooser.FileNameExtensionFilter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import rails.game.Game; import rails.game.ReportBuffer; import rails.util.Config; public final class TestGameBuilder extends TestCase { private static String configFile = "test/test.properties"; private static char extensionSeparator = '.'; private static int maxRecursionLevel = 5; // true = optimal for ant html reports, false = optimal for test runner private static boolean extendedTestNames = true; private static void prepareGameReport(File gameFile, String reportFilename) { Game game = null; if (gameFile.exists()) System.out.println("Found game at " + gameFile.getAbsolutePath()); game = Game.load(gameFile.getAbsolutePath()); if (game != null) { List<String> report = ReportBuffer.getAsList(); PrintWriter reportFile = null; try{ reportFile = new PrintWriter(reportFilename); } catch (IOException e) { System.err.print("Cannot open file " + reportFilename + " to save game report"); } if (reportFile != null) { for (String msg:report){ reportFile.println(msg); } reportFile.close(); System.out.println("Created reportfile at " + reportFilename); } } } // returns gameName if prepararion was successfull private static String prepareTestGame(File gameFile, boolean overrideReport){ // check preconditions if (!gameFile.exists() || !gameFile.isFile()) return null; // check if it is a Rails savefile String fileName = gameFile.getName(); int dot = fileName.lastIndexOf(extensionSeparator); String gameName = null; if (dot != -1 && fileName.substring(dot+1).equals( Config.get("save.filename.extension"))) { gameName = fileName.substring(0,dot); String gamePath = gameFile.getParent(); // check if there is a reportfile String reportFilename = gamePath + File.separator + gameName + "." + Config.get("report.filename.extension"); File reportFile = new File(reportFilename); if (!reportFile.exists() || overrideReport) prepareGameReport(gameFile, reportFilename); } return gameName; } private static TestSuite recursiveTestSuite(String rootPath, String dirPath, int level, boolean overrideReport){ // completeDirPath String combinedDirPath = rootPath + File.separator + dirPath; // assign directory File directory = new File(combinedDirPath); // check if directory exists otherwise return null if (!directory.exists() || !directory.isDirectory()) return null; // create new testsuite TestSuite suite; if (level == 0) suite = new TestSuite("Rails Tests"); else suite = new TestSuite(directory.getName()); // use filelist to sort List<String> filenameList = Arrays.asList(directory.list()); Collections.sort(filenameList); // add deeper directories for (String fn:filenameList) { File f = new File(combinedDirPath + File.separator + fn); String nextDirPath; if (dirPath.equals("")) nextDirPath = f.getName(); else nextDirPath = dirPath + File.separator + f.getName(); if (f.isDirectory() && level <= maxRecursionLevel) { TestSuite newSuite = recursiveTestSuite(rootPath, nextDirPath, level+1, overrideReport); if (newSuite != null) suite.addTest(newSuite); } } // add files of directory for (String fn:filenameList) { File f = new File(combinedDirPath + File.separator + fn); String gameName = prepareTestGame(f, overrideReport); if (gameName != null) { String extendedGameName; if (extendedTestNames) extendedGameName = dirPath + File.separator + gameName; else extendedGameName = gameName; suite.addTest(new TestGame(extendedGameName, rootPath)); System.out.println("Added TestGame "+ extendedGameName); } } return suite; } /** * Builds test suite of all test games below the main test directory * @return created test suite for junit */ public static Test suite() { // Activate logger System.setProperty("log4j.configuration", configFile); /* Tell the properties loader to read this file. */ Config.setConfigFile(configFile); System.out.println("Configuration file = " + configFile); // Main test directory File testDir = new File(Config.get("save.directory")); // Create tests TestSuite suite = null; if (testDir.exists() && testDir.isDirectory()) { System.out.println("Test directory = " + testDir.getAbsolutePath()); suite = recursiveTestSuite(testDir.getAbsolutePath(), "", 0, false); } return suite; } /** * Run main to rebuild the report files. * Only use this if you know what you are doing * * @param args a list of directories below the main test directory */ public static void main(String[] args) { // Activate logger System.setProperty("log4j.configuration", configFile); /* Tell the properties loader to read this file. */ Config.setConfigFile(configFile); System.out.println("Configuration file = " + configFile); // Main test directory String rootPath = Config.get("save.directory"); if (args != null && args.length > 0) { // commandline argument: only directories are possible System.out.println("Number of args: "+ args.length); for (String arg : args) // discard testsuite, only override the report files recursiveTestSuite(rootPath, arg, 0, true); } else { // ask for directories to ovrerride JPanel panel = new JPanel(); JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Select directories and/or files to reset game reports"); chooser.setCurrentDirectory(new File(rootPath)); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); chooser.setMultiSelectionEnabled(true); chooser.setFileFilter(new FileNameExtensionFilter("Rails save files (*.rails)", "rails")); chooser.setAcceptAllFileFilterUsed(false); chooser.showDialog(panel, "Select"); File[] files = chooser.getSelectedFiles(); for (File f : files) if (f.isDirectory()) // discard testsuite, only override the report files recursiveTestSuite(f.getAbsolutePath(), "", 0, true); else if (f.isFile()) prepareTestGame(f, true); } } } --- NEW FILE: TestGame.java --- package test; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import org.apache.log4j.Logger; import rails.game.Game; import rails.game.ReportBuffer; import rails.util.Config; import junit.framework.TestCase; public class TestGame extends TestCase { private String gamePath; private String gameName; private List<String> testReport = null; private List<String> expectedReport = null; protected static Logger log = Logger.getLogger(TestGame.class.getPackage().getName()); public TestGame(String gameName, String gamePath) { super(gameName); this.gameName = gameName; this.gamePath = gamePath; log.debug("Creates TestGame gameName = " + gameName + ", gamePath = " + gamePath); } protected void runTest() throws Throwable { gameReportTest(); } /** * a method that test that the game report is identical to the one created before */ private void gameReportTest() { // compares the two reports line by line int line = 0; while (true) { // test for size of reports if (line >= expectedReport.size()) if (line >= testReport.size()) break; // test succesfull else fail("Test report exceeeds expected report." + " Last line (" + line + "): " + testReport.get(line-1)); else if (line >= testReport.size()) fail("Expected report exceeds test report." + " Last line (" + line + "): " + expectedReport.get(line-1)); assertEquals("Reports differ in line " + line+1, expectedReport.get(line), testReport.get(line)); line = line + 1; } } protected void setUp() throws Exception { super.setUp(); // tries to load the game report String reportFilename = gamePath + File.separator + gameName + "." + Config.get("report.filename.extension"); File reportFile = new File(reportFilename); if (reportFile.exists()) { log.debug("Found reportfile at " + reportFilename); Scanner reportScanner = new Scanner(new FileReader(reportFilename)); expectedReport = new ArrayList<String>(); while (reportScanner.hasNext()) expectedReport.add(reportScanner.nextLine()); reportScanner.close(); } else { log.debug("Did not find reportfile at " + reportFilename); } // tries to load the game and run String gameFilename = gamePath + File.separator + gameName + "." + Config.get("save.filename.extension"); File gameFile = new File(gameFilename); if (gameFile.exists()) { log.debug("Found gamefile at " + gameFilename); Game testGame = Game.load(gameFilename); if (testGame != null) testReport = ReportBuffer.getAsList(); } else { log.error("Did not find gamefile at " + gameFilename); } } protected void tearDown() throws Exception { super.tearDown(); testReport.clear(); expectedReport.clear(); } } --- NEW FILE: test.properties --- ####################### Test preferences ################################ # # Those are the settings used for automated testing # ######################################################################## # # Preferred tile format. # The only currently supported format is svg. Anything else is ignored. #tile.format_preference=svg # Root directory for the tile images (just above directory 'tiles'). # Not required if tile images are provided included in the Rails jar file. #tile.root_directory= ### Locale #### # Language: two-letter ISO code (lower case; default is en=English). # Country: two-letter ISO code (upper case; specifies country # (implying a language variant of that country; no default). # Locale: concatenation of the above. If present, overrides any of the above. # Examples: en, en_US, en_UK, fr_FR, fr_CA. locale=te_st0 #language= #country= ### Money display ### # Each game has a specific format for monetary amounts (e.g. $100, 100M). # An overriding format can be specified here, but then applies to all games. # The @ character must be present and is replaced by the amount. # Example: £@ to specify a pound sign prefix: £100. #money_format=$@ ### Save file directory # If the below entry exists, is not empty, and specifies an existing # directory, that directory is used as a starting point for any # file choosing action for the Save and Load commands. # The path may be relative or absolute. save.directory=test/data # The default Save filename is <gamename>_<datetimepattern>.<extension> # This name will be initially proposed. # As soon as that proposal has been changed once in a Save action, # the last used name is always proposed in stead. # The default date/time pattern is yyyyMMdd_HHmm # The pattern codes are as defined in the Java class # SimpleDateFormat (just Google that name to find the codes). #save.filename.date_time_pattern=yyyyMMdd_HHmm # The default timezone is local time. # A specific timezone (such as UTC) can be set; the value must be a Java timezone ID #save.filename.date_time_zone=UTC # Optionally, a suffix (e.g. player name) can be added after the time stamp # with a preceding underscore (which is automatically added) # The special value NEXT_PLAYER puts the next moving player name into this spot. #save.filename.suffix=NEXT_PLAYER # The default extension is .rails save.filename.extension=rails ### Game report directory # If the below entry exists, is not empty, and specifies an existing # directory, a copy of the Game Report (as displayed in the Report Window) # will be saved there. The path may be relative or absolute. #report.directory=log # The default file name includes the game name and the game start time: # 18XX_yyyymmdd_hhmm.txt where 18XX is the game name. # You can specify different values for the date/time part and teh extension here. # The date/time pattern must be as defined in the Java SimpleDateFormat class. #report.filename.date_time_pattern=yyyyMMdd report.filename.extension=report ### Windows ## Report window visibility # By default the report window is hidden when starting or loading a game. # This property allows to open it automatically. # Valid values are yes and no (default). #report.window.open=yes ## Report window editability # 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 ## Stock Chart window visibility # By default the stock chart hides at the end of an SR. # By specifying "yes" here, the window will not be automatically hidden any more #stockchart.window.open=yes ### Player info ## Default players # Comma-separated list of player names. # Useful for game testing purposes. #default_players=Alice,Bob,Charlie # ## Local player name # Useful for distributed usage (Internet, PBEM, cloud storage/dropbox) # Required for "request turn" facility with cloud storage (dropbox) #local.player.name=Alice ### Default game # Name of game selected in the game selection window. # Useful for game testing purposes. #default_game=1830 ### Various options # Show simple (ORx) or composite (ORx.x) OR number. # Valid values: "simple" and "composite" (default) #or.number_format=simple ####################### Log4J properties ############################## # For information on how to customise log4j logging, see for instance # http://www.vipan.com/htdocs/log4jhelp.html # It's a bit outdated: Category is now named Logger, # and Priority is now named Level. # But it's the best intro I know on how to configure Appenders. (EV) ####################################################################### # Set root logger level to DEBUG and use appender F(file) #log4j.debug=true log4j.rootLogger=DEBUG, F # Define the Log file appender log4j.appender.F=org.apache.log4j.FileAppender # Log file properties log4j.appender.F.File=test/test.log log4j.appender.F.append=false # Log file layout log4j.appender.F.layout=org.apache.log4j.PatternLayout log4j.appender.F.layout.ConversionPattern=%-5p %m%n ################## End of Log4J properties ############################# |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:18
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/rails/game/specific/_18EU Modified Files: FinalMinorExchangeRound.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FinalMinorExchangeRound.java 28 Feb 2010 21:38:06 -0000 1.12 --- FinalMinorExchangeRound.java 23 Mar 2010 18:45:36 -0000 1.13 *************** *** 27,32 **** public void start(Player playerToStartFMERound) { ! ReportBuffer.add("\n" ! + LocalText.getText("StartFinalMinorExchangeRound")); setCurrentPlayerIndex(playerToStartFMERound.getIndex()); --- 27,32 ---- public void start(Player playerToStartFMERound) { ! ReportBuffer.add(""); ! ReportBuffer.add(LocalText.getText("StartFinalMinorExchangeRound")); setCurrentPlayerIndex(playerToStartFMERound.getIndex()); |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:14
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** OperatingRound_1856.java 19 Mar 2010 20:37:53 -0000 1.32 --- OperatingRound_1856.java 23 Mar 2010 18:44:17 -0000 1.33 *************** *** 20,24 **** private Player playerToStartLoanRepayment = null; ! static { steps = new GameDef.OrStep[] { --- 20,25 ---- private Player playerToStartLoanRepayment = null; ! // static ! { steps = new GameDef.OrStep[] { |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:11
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/rails/game/correct Modified Files: CashCorrectionManager.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: CashCorrectionManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/CashCorrectionManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CashCorrectionManager.java 10 Mar 2010 21:02:22 -0000 1.3 --- CashCorrectionManager.java 23 Mar 2010 18:45:40 -0000 1.4 *************** *** 20,24 **** public static CorrectionManager getInstance(GameManager gm) { ! if (ccm == null) { ccm = new CashCorrectionManager(); ccm.gameManager = gm; --- 20,24 ---- public static CorrectionManager getInstance(GameManager gm) { ! if (ccm == null || ccm.gameManager != gm) { ccm = new CashCorrectionManager(); ccm.gameManager = gm; |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:08
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/rails/game Modified Files: Player.java Game.java Company.java TileManager.java OperatingRound.java Token.java GameManager.java PublicCompany.java ReportBuffer.java ComponentManager.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: ReportBuffer.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ReportBuffer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ReportBuffer.java 31 Jan 2010 22:22:28 -0000 1.9 --- ReportBuffer.java 23 Mar 2010 18:45:15 -0000 1.10 *************** *** 15,30 **** * Class to write a log, and also to maintain a log message stack for writing to * the UI. */ public final class ReportBuffer { ! protected static String reportDirectory = null; ! protected String reportPathname = null; ! protected PrintWriter report = null; ! protected static boolean wantReport = false; ! protected static List<String> initialQueue = new ArrayList<String>(); private static final String DEFAULT_DTS_PATTERN = "yyyyMMdd_HHmm"; private static final String DEFAULT_REPORT_EXTENSION = "txt"; - protected static Logger log = - Logger.getLogger(ReportBuffer.class.getPackage().getName()); static { --- 15,46 ---- * Class to write a log, and also to maintain a log message stack for writing to * the UI. + * + * Each gameManager has one unique ReportBuffer, which is used by the public static methods. + * Messages before the creation of that buffer are kept in an internal initial queue. + * + * Also used for regression testing comparing the output of the report buffer. + * */ public final class ReportBuffer { ! /** ! * A stack for displaying messages in the Log Window. Such messages are ! * intended to record the progress of the rails.game and can be used as a ! * rails.game report. ! */ ! private List<String> reportQueue = new ArrayList<String>(); ! ! /** Another stack for messages that must "wait" for other messages */ ! private List<String> waitQueue = new ArrayList<String> (); ! ! private String reportPathname = null; ! private PrintWriter report = null; ! ! /** Initial queue for all messages, before the ReportBuffer for the GameManager is created */ ! private static List<String> initialQueue = new ArrayList<String>(); + private static boolean wantReport = false; + private static String reportDirectory = null; private static final String DEFAULT_DTS_PATTERN = "yyyyMMdd_HHmm"; private static final String DEFAULT_REPORT_EXTENSION = "txt"; static { *************** *** 33,36 **** --- 49,56 ---- } + private static Logger log = + Logger.getLogger(ReportBuffer.class.getPackage().getName()); + + public ReportBuffer() { if (!initialQueue.isEmpty()) { *************** *** 42,68 **** } - /** - * A buffer for displaying messages in the Log Window. Such messages are - * intended to record the progress of the rails.game and can be used as a - * rails.game report. - */ - private StringBuffer reportBuffer = new StringBuffer(); ! /** Add a message to the log buffer (and display it on the console) */ ! public static void add(String message) { ! GameManagerI gm = GameManager.getInstance(); ! ReportBuffer instance = null; ! if (gm != null) instance = gm.getReportBuffer(); ! if (gm == null || instance == null) { ! // Queue in a static buffer until the instance is created ! initialQueue.add(message); ! } else { ! instance.addMessage(message); ! } } private void addMessage (String message) { if (message != null) { ! reportBuffer.append(message).append("\n"); /* Also log the message */ if (message.length() > 0) log.info(message); --- 62,79 ---- } ! private List<String> getReportQueue() { ! return reportQueue; } + private void clearReportQueue() { + reportQueue.clear(); + } + private void addMessage (String message) { if (message != null) { ! if (message.equals("")) ! message = "---"; // workaround for testing ! reportQueue.add(message); /* Also log the message */ if (message.length() > 0) log.info(message); *************** *** 71,87 **** } } ! ! /** Get the current log buffer, and clear it */ ! public static String get() { ! ReportBuffer instance = getInstance(); ! String result = instance.reportBuffer.toString(); ! instance.reportBuffer = new StringBuffer(); ! return result; ! } ! ! private static ReportBuffer getInstance() { ! return GameManager.getInstance().getReportBuffer(); ! } ! private void writeToReport(String message) { --- 82,86 ---- } } ! private void writeToReport(String message) { *************** *** 130,135 **** } ! /* A stack for messages that must "wait" for other messages */ ! private List<String> waitQueue = new ArrayList<String> (); public static void addWaiting (String string) { --- 129,186 ---- } ! ! /** Get the current log buffer, and clear it */ ! public static String get() { ! ReportBuffer instance = getInstance(); ! ! // convert to String ! StringBuffer result = new StringBuffer(); ! for (String msg:instance.getReportQueue()) ! result.append(msg).append("\n"); ! ! // clear current queue ! instance.clearReportQueue(); ! ! return result.toString(); ! } ! ! /** Add a message to the log buffer (and display it on the console) */ ! public static void add(String message) { ! GameManagerI gm = GameManager.getInstance(); ! ReportBuffer instance = null; ! if (gm != null) instance = gm.getReportBuffer(); ! if (gm == null || instance == null) { ! // Queue in a static buffer until the instance is created ! initialQueue.add(message); ! } else { ! instance.addMessage(message); ! } ! } ! ! /** return the current buffer as list */ ! public static List<String> getAsList() { ! ReportBuffer instance = getInstance(); ! ! if (instance == null) ! return initialQueue; ! else ! return instance.getReportQueue(); ! } ! ! /** clear the current buffer */ ! public static void clear() { ! ReportBuffer instance = getInstance(); ! ! if (instance == null) ! initialQueue.clear(); ! else ! instance.clearReportQueue(); ! } ! ! private static ReportBuffer getInstance() { ! return GameManager.getInstance().getReportBuffer(); ! } ! ! public static void addWaiting (String string) { Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** PublicCompany.java 5 Mar 2010 20:17:32 -0000 1.91 --- PublicCompany.java 23 Mar 2010 18:44:58 -0000 1.92 *************** *** 1304,1308 **** // Calculate, round up, report and add the cash ! for (CashHolder recipient : sharesPerRecipient.keySet()) { if (recipient instanceof Bank) continue; shares = (sharesPerRecipient.get(recipient)); --- 1304,1311 ---- // Calculate, round up, report and add the cash ! ! // Define a precise sequence for the reporting ! Set<CashHolder> recipientSet = sharesPerRecipient.keySet(); ! for (CashHolder recipient : SequenceUtil.sortCashHolders(recipientSet)) { if (recipient instanceof Bank) continue; shares = (sharesPerRecipient.get(recipient)); Index: TileManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TileManager.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TileManager.java 15 Jan 2010 19:55:59 -0000 1.14 --- TileManager.java 23 Mar 2010 18:44:38 -0000 1.15 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.LocalText; import rails.util.Tag; public class TileManager implements ConfigurableComponentI { protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); private static List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); //directories.add("data/" + ComponentManager.getGameName()); directories.add("data/" + GameManager.getInstance().getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (TileI tile : tileMap.values()) { tile.finishConfiguration(this); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.LocalText; import rails.util.Tag; public class TileManager implements ConfigurableComponentI { protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); // private static List<String> directories = new ArrayList<String>(); private List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); //directories.add("data/" + ComponentManager.getGameName()); directories.add("data/" + GameManager.getInstance().getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (TileI tile : tileMap.values()) { tile.finishConfiguration(this); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } } \ No newline at end of file Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** GameManager.java 16 Mar 2010 21:22:17 -0000 1.93 --- GameManager.java 23 Mar 2010 18:44:55 -0000 1.94 *************** *** 1019,1027 **** DisplayBuffer.add(message); List<String> gameReport = getGameReport(); - StringBuilder report = new StringBuilder(); for (String s:gameReport) ! report.append(s); ! ReportBuffer.add(report.toString()); // activate gameReport for UI --- 1019,1027 ---- DisplayBuffer.add(message); + ReportBuffer.add(""); + List<String> gameReport = getGameReport(); for (String s:gameReport) ! ReportBuffer.add(s); // activate gameReport for UI *************** *** 1062,1072 **** /* Report winner */ Player winner = rankedPlayers.get(0); ! b.add(LocalText.getText("EoGWinner") + winner.getName() ! + "! \n\n"+ LocalText.getText("EoGFinalRanking") + " :"); /* Report final ranking */ int i = 0; for (Player p : rankedPlayers) { ! b.add("\n" + (++i) + ". " + Bank.format(p.getWorth()) + " " + p.getName()); } --- 1062,1072 ---- /* Report winner */ Player winner = rankedPlayers.get(0); ! b.add(LocalText.getText("EoGWinner") + winner.getName()+ "!"); ! b.add(LocalText.getText("EoGFinalRanking") + " :"); /* Report final ranking */ int i = 0; for (Player p : rankedPlayers) { ! b.add((++i) + ". " + Bank.format(p.getWorth()) + " " + p.getName()); } Index: Player.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Player.java 31 Jan 2010 22:22:28 -0000 1.24 --- Player.java 23 Mar 2010 18:44:30 -0000 1.25 *************** *** 177,183 **** * Compare Players by their total worth, in descending order. This method * implements the Comparable interface. */ public int compareTo(Player p) { ! return -new Integer(getWorth()).compareTo(new Integer(p.getWorth())); } } --- 177,189 ---- * Compare Players by their total worth, in descending order. This method * implements the Comparable interface. + * second level decision is by name */ public int compareTo(Player p) { ! // first by wealth ! int result = -new Integer(getWorth()).compareTo(new Integer(p.getWorth())); ! // then by name ! if (result == 0) ! result = getName().compareTo(p.getName()); ! return result; } } Index: Token.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Token.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Token.java 8 Jan 2010 21:30:46 -0000 1.7 --- Token.java 23 Mar 2010 18:44:55 -0000 1.8 *************** *** 9,12 **** --- 9,14 ---- import java.util.Map; + import org.apache.log4j.Logger; + import rails.game.move.MoveableHolder; import rails.game.move.ObjectMove; *************** *** 24,27 **** --- 26,32 ---- private static int index = 0; + protected static Logger log = + Logger.getLogger(Token.class.getPackage().getName()); + public Token() { *************** *** 30,33 **** --- 35,45 ---- } + // initialize the special properties static variables + public static void init() { + tokenMap = new HashMap<String, TokenI>(); + index = 0; + log.debug("Init token static variables"); + } + public static TokenI getByUniqueId(String id) { return tokenMap.get(id); Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Game.java 21 Mar 2010 17:30:06 -0000 1.52 --- Game.java 23 Mar 2010 18:44:37 -0000 1.53 *************** *** 8,11 **** --- 8,12 ---- import rails.game.action.PossibleAction; + import rails.game.special.SpecialProperty; import rails.util.LocalText; import rails.util.Tag; *************** *** 89,92 **** --- 90,97 ---- ReportBuffer.add(LocalText.getText("GameIs", name)); + // set special properties and token static variables + SpecialProperty.init(); + Token.init(); + // Have the ComponentManager work through the other rails.game files componentManager.finishPreparation(); Index: Company.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Company.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Company.java 16 Mar 2010 21:22:17 -0000 1.16 --- Company.java 23 Mar 2010 18:44:38 -0000 1.17 *************** *** 14,18 **** public abstract class Company implements CompanyI, ConfigurableComponentI, ! Cloneable { protected String name; --- 14,18 ---- public abstract class Company implements CompanyI, ConfigurableComponentI, ! Cloneable, Comparable<Company> { protected String name; *************** *** 231,234 **** --- 231,245 ---- return false; } + + public int compareTo(Company otherCompany){ + int result; + // compare typeNames first + result = this.getTypeName().compareTo(otherCompany.getTypeName()); + // if same typeName then name + if (result == 0) + result = this.getName().compareTo(otherCompany.getName()); + + return result; + } public static String joinNamesWithDelimiter (List<CompanyI> companies, String delimiter) { Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** OperatingRound.java 19 Mar 2010 20:51:05 -0000 1.118 --- OperatingRound.java 23 Mar 2010 18:44:44 -0000 1.119 *************** *** 71,75 **** public static final int SPLIT_ROUND_DOWN = 2; // More to the treasury ! protected static GameDef.OrStep[] steps = new GameDef.OrStep[] { GameDef.OrStep.INITIAL, --- 71,76 ---- public static final int SPLIT_ROUND_DOWN = 2; // More to the treasury ! // protected static GameDef.OrStep[] steps = ! protected GameDef.OrStep[] steps = new GameDef.OrStep[] { GameDef.OrStep.INITIAL, Index: ComponentManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ComponentManager.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ComponentManager.java 31 Jan 2010 22:22:28 -0000 1.17 --- ComponentManager.java 23 Mar 2010 18:45:16 -0000 1.18 *************** *** 39,43 **** protected static Logger log = Logger.getLogger(ComponentManager.class.getPackage().getName()); ! protected static List<String> directories = new ArrayList<String>(); public static synchronized ComponentManager configureInstance(String gameName, Tag tag, --- 39,44 ---- protected static Logger log = Logger.getLogger(ComponentManager.class.getPackage().getName()); ! // protected static List<String> directories = new ArrayList<String>(); ! protected List<String> directories = new ArrayList<String>(); public static synchronized ComponentManager configureInstance(String gameName, Tag tag, |
From: Stefan F. <ste...@us...> - 2010-03-23 18:46:02
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10916/rails/util Modified Files: LocalText.java Added Files: SequenceUtil.java Log Message: Implementation of Rails junit testing. More details see mail to the develop list. Index: LocalText.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/LocalText.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LocalText.java 11 Jan 2009 17:23:21 -0000 1.6 --- LocalText.java 23 Mar 2010 18:45:16 -0000 1.7 *************** *** 38,42 **** if (key == null || key.length() == 0) return ""; ! /* Load the texts */ if (localisedText == null) { --- 38,42 ---- if (key == null || key.length() == 0) return ""; ! /* Load the texts */ if (localisedText == null) { *************** *** 83,86 **** --- 83,96 ---- } } + + // special treatment for test + if (localeCode.equals("te_st0")) { + StringBuffer s = new StringBuffer(key); + if (parameters != null) + for (Object o:parameters) + s.append("," + o.toString()); + return s.toString(); + } + /* Find the text */ try { --- NEW FILE: SequenceUtil.java --- package rails.util; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import rails.game.Bank; import rails.game.CashHolder; import rails.game.Player; import rails.game.PublicCompany; public class SequenceUtil { // private constructor private SequenceUtil() {}; private static <E extends CashHolder> List<E> selectCashHolders(Class<E> clazz, Collection<CashHolder> coll) { // select all cashholders of that type List<E> list = new ArrayList<E>(); for (CashHolder c:coll) { if (clazz.isAssignableFrom(c.getClass())) { @SuppressWarnings("unchecked") E cast = (E) c; list.add(cast); } } return list; } /** * Defines a sorting on cashHolders * @return sorted list of cashholders */ public static List<CashHolder> sortCashHolders(Collection<CashHolder> coll) { List<CashHolder> sortedList = new ArrayList<CashHolder>(); // first add players List<Player> players = selectCashHolders(Player.class, coll); Collections.sort(players); sortedList.addAll(players); // then public companies List<PublicCompany> PublicCompanys = selectCashHolders(PublicCompany.class, coll); Collections.sort(PublicCompanys); sortedList.addAll(PublicCompanys); // last add the bank sortedList.addAll(selectCashHolders(Bank.class, coll)); return sortedList; } } |
From: Erik V. <ev...@us...> - 2010-03-21 17:44:00
|
Update of /cvsroot/rails/18xx/data/1830 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/data/1830 Modified Files: Game.xml CompanyManager.xml Log Message: 1835 Prussian formation & some consequential changes Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/CompanyManager.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.35 --- CompanyManager.xml 21 Mar 2010 17:43:50 -0000 1.36 *************** *** 2,5 **** --- 2,8 ---- <CompanyManager> <CompanyType name="Private" class="rails.game.PrivateCompany"> + <ClosingConditions> + <Phase>5</Phase> + </ClosingConditions> </CompanyType> <CompanyType name="Public" class="rails.game.PublicCompany"> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/Game.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Game.xml 16 Feb 2010 20:11:28 -0000 1.33 --- Game.xml 21 Mar 2010 17:43:50 -0000 1.34 *************** *** 122,126 **** <Phase name="5"> <Tiles colour="yellow,green,brown"/> ! <Privates close="yes"/> <OperatingRounds number="3"/> <OffBoardRevenue step="2"/> --- 122,126 ---- <Phase name="5"> <Tiles colour="yellow,green,brown"/> ! <!--Privates close="yes"/--> <OperatingRounds number="3"/> <OffBoardRevenue step="2"/> |
From: Erik V. <ev...@us...> - 2010-03-21 17:43:58
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/rails/game/specific/_1835 Modified Files: PrussianFormationRound.java Log Message: 1835 Prussian formation & some consequential changes Index: PrussianFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/PrussianFormationRound.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PrussianFormationRound.java 5 Mar 2010 22:38:31 -0000 1.5 --- PrussianFormationRound.java 21 Mar 2010 17:43:50 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- import java.util.ArrayList; + import java.util.Arrays; import java.util.HashMap; import java.util.List; *************** *** 20,23 **** --- 21,25 ---- private PublicCompanyI prussian; + private PublicCompanyI m2; private PhaseI phase; *************** *** 51,57 **** phase = getCurrentPhase(); startPr = !prussian.hasStarted(); ! forcedStart = phase.getName().equals("4+4"); mergePr = !prussianIsComplete(gameManager); - forcedMerge = phase.getName().equals("5"); ReportBuffer.add(LocalText.getText("StartFormationRound", PR_ID)); --- 53,59 ---- phase = getCurrentPhase(); startPr = !prussian.hasStarted(); ! forcedMerge = phase.getName().equals("5"); ! forcedStart = phase.getName().equals("4+4") || forcedMerge; mergePr = !prussianIsComplete(gameManager); ReportBuffer.add(LocalText.getText("StartFormationRound", PR_ID)); *************** *** 60,67 **** step = startPr ? Step.START : Step.MERGE; if (step == Step.MERGE) { ! startingPlayer ! = ((GameManager_1835)gameManager).getPrussianFormationStartingPlayer(); ! setCurrentPlayer(startingPlayer); } } --- 62,99 ---- step = startPr ? Step.START : Step.MERGE; + + if (step == Step.START) { + m2 = companyManager.getCompanyByName(M2_ID); + setCurrentPlayer(m2.getPresident()); + ((GameManager_1835)gameManager).setPrussianFormationStartingPlayer(currentPlayer); + if (forcedStart) { + executeStartPrussian(true); + step = Step.MERGE; + } + } + if (step == Step.MERGE) { ! startingPlayer ! = ((GameManager_1835)gameManager).getPrussianFormationStartingPlayer(); ! setCurrentPlayer(startingPlayer); ! if (forcedMerge) { ! List<SpecialPropertyI> sps; ! List<CompanyI> foldables = new ArrayList<CompanyI> (); ! for (PrivateCompanyI company : gameManager.getAllPrivateCompanies()) { ! sps = company.getSpecialProperties(); ! if (sps != null && !sps.isEmpty() && sps.get(0) instanceof ExchangeForShare) { ! foldables.add(company); ! } ! } ! for (PublicCompanyI company : gameManager.getAllPublicCompanies()) { ! if (company.isClosed()) continue; ! sps = company.getSpecialProperties(); ! if (sps != null && !sps.isEmpty() && sps.get(0) instanceof ExchangeForShare) { ! foldables.add(company); ! } ! } ! executeExchange (foldables, false, true); ! finishRound(); ! } } } *************** *** 71,75 **** if (step == Step.START) { - PublicCompanyI m2 = companyManager.getCompanyByName(M2_ID); Player m2Owner = m2.getPresident(); startingPlayer = m2Owner; --- 103,106 ---- *************** *** 129,133 **** if (step == Step.START) { ! if (folded.isEmpty() || !startPrussian(a)) { finishRound(); } else { --- 160,164 ---- if (step == Step.START) { ! if (folded == null || folded.isEmpty() || !startPrussian(a)) { finishRound(); } else { *************** *** 175,181 **** moveStack.start(false); ! // Execute prussian.start(); - ((GameManager_1835)gameManager).setPrussianFormationStartingPlayer(currentPlayer); String message = LocalText.getText("START_MERGED_COMPANY", PR_ID, --- 206,217 ---- moveStack.start(false); ! executeStartPrussian(false); ! ! return true; ! } ! ! private void executeStartPrussian (boolean display) { ! prussian.start(); String message = LocalText.getText("START_MERGED_COMPANY", PR_ID, *************** *** 183,194 **** prussian.getStartSpace()); ReportBuffer.add(message); ! executeExchange (action.getFoldedCompanies(), true); prussian.setFloated(); - - return true; } ! private boolean mergeIntoPrussian (FoldIntoPrussian action) { // Validate --- 219,229 ---- prussian.getStartSpace()); ReportBuffer.add(message); + if (display) DisplayBuffer.add(message); ! executeExchange (Arrays.asList(new CompanyI[]{m2}), true, false); prussian.setFloated(); } ! private boolean mergeIntoPrussian (FoldIntoPrussian action) { // Validate *************** *** 210,231 **** // Execute ! executeExchange (action.getFoldedCompanies(), false); return true; } ! private void executeExchange (List<CompanyI> companies, boolean president) { ExchangeForShare efs; PublicCertificateI cert; for (CompanyI company : companies) { // Shortcut, sp should be checked efs = (ExchangeForShare) company.getSpecialProperties().get(0); cert = unavailable.findCertificate(prussian, efs.getShare()/prussian.getShareUnit(), president); ! cert.moveTo(currentPlayer.getPortfolio()); //company.setClosed(); ! ReportBuffer.add(LocalText.getText("MERGE_MINOR_LOG", ! currentPlayer.getName(), company.getName(), PR_ID, --- 245,274 ---- // Execute ! executeExchange (action.getFoldedCompanies(), false, false); return true; } ! private void executeExchange (List<CompanyI> companies, boolean president, ! boolean display) { ExchangeForShare efs; PublicCertificateI cert; + Player player; for (CompanyI company : companies) { + log.debug("Merging company "+company.getName()); + if (company instanceof PrivateCompanyI) { + player = (Player)((PrivateCompanyI)company).getPortfolio().getOwner(); + } else { + player = ((PublicCompanyI)company).getPresident(); + } // Shortcut, sp should be checked efs = (ExchangeForShare) company.getSpecialProperties().get(0); cert = unavailable.findCertificate(prussian, efs.getShare()/prussian.getShareUnit(), president); ! cert.moveTo(player.getPortfolio()); //company.setClosed(); ! String message = LocalText.getText("MERGE_MINOR_LOG", ! player.getName(), company.getName(), PR_ID, *************** *** 233,244 **** : Bank.format(((PublicCompanyI)company).getCash()), company instanceof PrivateCompanyI ? "no" ! : ((PublicCompanyI)company).getPortfolio().getTrainList().size())); ! ReportBuffer.add(LocalText.getText("GetShareForMinor", ! currentPlayer.getName(), cert.getShare(), PR_ID, ipo.getName(), ! company.getName() )); ! if (company instanceof PublicCompanyI) { --- 276,290 ---- : Bank.format(((PublicCompanyI)company).getCash()), company instanceof PrivateCompanyI ? "no" ! : ((PublicCompanyI)company).getPortfolio().getTrainList().size()); ! ReportBuffer.add(message); ! if (display) DisplayBuffer.add (message); ! message = LocalText.getText("GetShareForMinor", ! player.getName(), cert.getShare(), PR_ID, ipo.getName(), ! company.getName()); ! ReportBuffer.add(message); ! if (display) DisplayBuffer.add (message); if (company instanceof PublicCompanyI) { *************** *** 253,259 **** if (!hex.hasTokenOfCompany(prussian) && hex.layBaseToken(prussian, city.getNumber())) { /* TODO: the false return value must be impossible. */ ! ReportBuffer.add(LocalText.getText("ExchangesBaseToken", PR_ID, minor.getName(), ! city.getName())); prussian.layBaseToken(hex, 0); --- 299,307 ---- if (!hex.hasTokenOfCompany(prussian) && hex.layBaseToken(prussian, city.getNumber())) { /* TODO: the false return value must be impossible. */ ! message =LocalText.getText("ExchangesBaseToken", PR_ID, minor.getName(), ! city.getName()); ! ReportBuffer.add(message); ! if (display) DisplayBuffer.add (message); prussian.layBaseToken(hex, 0); |
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/rails/game Modified Files: BonusToken.java Closeable.java Bonus.java StockRound.java PrivateCompanyI.java Phase.java PhaseI.java PrivateCompany.java Log Message: 1835 Prussian formation & some consequential changes Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Phase.java 3 Feb 2010 05:37:54 -0000 1.18 --- Phase.java 21 Mar 2010 17:43:50 -0000 1.19 *************** *** 6,9 **** --- 6,10 ---- import org.apache.log4j.Logger; + import rails.util.LocalText; import rails.util.Tag; *************** *** 45,48 **** --- 46,51 ---- protected List<Closeable> closedObjects = null; + protected String extraInfo = ""; + /** A HashMap to contain phase-dependent parameters * by name and value. *************** *** 145,148 **** --- 148,160 ---- } } + + // Extra info text(usually related to extra-share special properties) + Tag infoTag = tag.getChild("Info"); + if (infoTag != null) { + String infoKey = infoTag.getAttributeAsString("key"); + String[] infoParms = infoTag.getAttributeAsString("parm", "").split(","); + extraInfo += "<br>"+LocalText.getText(infoKey, (Object[])infoParms); + } + } *************** *** 159,162 **** --- 171,178 ---- } } + + public String getInfo() { + return extraInfo; + } public boolean isTileColourAllowed(String tileColour) { Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** PrivateCompany.java 1 Mar 2010 22:27:32 -0000 1.38 --- PrivateCompany.java 21 Mar 2010 17:43:50 -0000 1.39 *************** *** 28,31 **** --- 28,33 ---- // Prevent closing conditions sfy 1889 protected List<String> preventClosingConditions = null; + // Close at start of phase + protected String closeAtPhaseName = null; protected String blockedHexesString = null; *************** *** 59,63 **** } - // Special properties // Extra info text(usually related to extra-share special properties) Tag infoTag = tag.getChild("Info"); --- 61,64 ---- *************** *** 102,109 **** if (conditionText != null) { preventClosingConditions.add(conditionText); ! } } } /* end sfy 1889 */ } } catch (Exception e) { --- 103,116 ---- if (conditionText != null) { preventClosingConditions.add(conditionText); ! } } } /* end sfy 1889 */ + + // Close at start of phase + Tag closeTag = closureTag.getChild("Phase"); + if (closeTag != null) { + closeAtPhaseName = closeTag.getText(); + } } } catch (Exception e) { *************** *** 133,136 **** --- 140,150 ---- infoText += parentInfoText; parentInfoText = ""; + + if (Util.hasValue(closeAtPhaseName)) { + PhaseI closingPhase = gameManager.getPhaseManager().getPhaseByName(closeAtPhaseName); + if (closingPhase != null) { + closingPhase.addObjectToClose(this); + } + } } *************** *** 191,195 **** /** ! * @return Portfolio of this Private */ public Portfolio getPortfolio() { --- 205,209 ---- /** ! * @return Portfolio (holder) of this Private */ public Portfolio getPortfolio() { *************** *** 359,362 **** --- 373,382 ---- } + public String getClosingInfo() { + return null; + } + public void close() { + setClosed(); + } } Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** StockRound.java 12 Mar 2010 20:28:27 -0000 1.69 --- StockRound.java 21 Mar 2010 17:43:50 -0000 1.70 *************** *** 1311,1314 **** --- 1311,1319 ---- } + public void setCurrentPlayer(Player player) { + super.setCurrentPlayer(player); + currentPlayer = player; + } + /*----- METHODS TO BE CALLED TO SET UP THE NEXT TURN -----*/ Index: Closeable.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Closeable.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Closeable.java 19 Jan 2010 19:54:11 -0000 1.3 --- Closeable.java 21 Mar 2010 17:43:50 -0000 1.4 *************** *** 5,9 **** public void close(); ! public String getInfo(); } --- 5,9 ---- public void close(); ! public String getClosingInfo(); } Index: BonusToken.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/BonusToken.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BonusToken.java 31 Jan 2010 22:22:28 -0000 1.16 --- BonusToken.java 21 Mar 2010 17:43:50 -0000 1.17 *************** *** 114,118 **** } ! public String getInfo () { return description; } --- 114,118 ---- } ! public String getClosingInfo () { return description; } Index: PhaseI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PhaseI.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PhaseI.java 3 Feb 2010 05:37:54 -0000 1.8 --- PhaseI.java 21 Mar 2010 17:43:50 -0000 1.9 *************** *** 17,20 **** --- 17,22 ---- public boolean doPrivatesClose(); + public void addObjectToClose(Closeable object); + public String getInfo(); public boolean isPrivateSellingAllowed(); Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Bonus.java 31 Jan 2010 22:22:28 -0000 1.7 --- Bonus.java 21 Mar 2010 17:43:50 -0000 1.8 *************** *** 110,114 **** } ! public String getInfo() { return toString(); } --- 110,114 ---- } ! public String getClosingInfo() { return toString(); } Index: PrivateCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PrivateCompanyI.java 28 Feb 2010 21:38:05 -0000 1.10 --- PrivateCompanyI.java 21 Mar 2010 17:43:50 -0000 1.11 *************** *** 6,10 **** import rails.game.move.MoveableHolder; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder { public static final String TYPE_TAG = "Private"; --- 6,10 ---- import rails.game.move.MoveableHolder; ! public interface PrivateCompanyI extends CompanyI, Certificate, MoveableHolder, Closeable { public static final String TYPE_TAG = "Private"; |
From: Erik V. <ev...@us...> - 2010-03-21 17:43:58
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/rails/ui/swing Modified Files: GameStatus.java ORPanel.java Log Message: 1835 Prussian formation & some consequential changes Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** GameStatus.java 14 Mar 2010 15:35:40 -0000 1.44 --- GameStatus.java 21 Mar 2010 17:43:50 -0000 1.45 *************** *** 799,803 **** if (j >= 0) { setPlayerCertButton(index, j, true, share); ! } else if (j == -1) { setTreasuryCertButton(index, true, share); } --- 799,803 ---- if (j >= 0) { setPlayerCertButton(index, j, true, share); ! } else if (j == -1 && compCanHoldOwnShares) { setTreasuryCertButton(index, true, share); } Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ORPanel.java 4 Mar 2010 22:08:24 -0000 1.48 --- ORPanel.java 21 Mar 2010 17:43:50 -0000 1.49 *************** *** 542,548 **** if (phase.getClosedObjects() != null) { for (Closeable object : phase.getClosedObjects()) { ! appendInfoText(b, LocalText.getText("PhaseRemoves", Util.lowerCaseFirst(object.getInfo()))); } } item = new JMenu (LocalText.getText("PhaseX", phase.getName())); item.setEnabled(true); --- 542,553 ---- if (phase.getClosedObjects() != null) { for (Closeable object : phase.getClosedObjects()) { ! if (Util.hasValue(object.getClosingInfo())) { ! appendInfoText(b, LocalText.getText("PhaseRemoves", Util.lowerCaseFirst(object.getClosingInfo()))); ! } } } + if (Util.hasValue(phase.getInfo())) { + appendInfoText(b, phase.getInfo()); + } item = new JMenu (LocalText.getText("PhaseX", phase.getName())); item.setEnabled(true); |
From: Erik V. <ev...@us...> - 2010-03-21 17:43:58
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28644/data/1835 Modified Files: Game.xml CompanyManager.xml Log Message: 1835 Prussian formation & some consequential changes Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/CompanyManager.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** CompanyManager.xml 6 Mar 2010 18:29:56 -0000 1.31 --- CompanyManager.xml 21 Mar 2010 17:43:50 -0000 1.32 *************** *** 40,43 **** --- 40,44 ---- </SpecialProperties> <ClosingConditions> + <Phase>5</Phase> <SpecialProperties condition="ifExercised"/> </ClosingConditions> *************** *** 53,56 **** --- 54,58 ---- </SpecialProperties> <ClosingConditions> + <Phase>5</Phase> <SpecialProperties condition="ifAllExercised"/> </ClosingConditions> *************** *** 66,69 **** --- 68,72 ---- </SpecialProperties> <ClosingConditions> + <Phase>5</Phase> <SpecialProperties condition="ifAllExercised"/> </ClosingConditions> *************** *** 71,74 **** --- 74,80 ---- <Company name="LD" longname="Leipzig-Dresdner Bahn" type="Private" basePrice="190" revenue="20"> <Info key="ComesWithPresidency" parm="Sax,20"/> + <ClosingConditions> + <Phase>5</Phase> + </ClosingConditions> </Company> <Company name="BB" longname="Braunschweigische Bahn" type="Private" basePrice="130" revenue="25"> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Game.xml 28 Feb 2010 21:38:05 -0000 1.28 --- Game.xml 21 Mar 2010 17:43:49 -0000 1.29 *************** *** 83,88 **** <Tiles colour="yellow,green,brown"/> <OperatingRounds number="3"/> ! <Privates close="yes"/> <OffBoardRevenue step="3"/> </Phase> <Phase name="6"> --- 83,89 ---- <Tiles colour="yellow,green,brown"/> <OperatingRounds number="3"/> ! <!--Privates close="yes"/--> <OffBoardRevenue step="3"/> + <Info key="PhaseClosesAllPrivates"/> </Phase> <Phase name="6"> |
From: Brett L. <wak...@us...> - 2010-03-21 17:30:15
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27071/rails/game Modified Files: Game.java Log Message: bump version numbers to 1.2.2 Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Game.java 18 Mar 2010 05:24:40 -0000 1.51 --- Game.java 21 Mar 2010 17:30:06 -0000 1.52 *************** *** 12,16 **** public class Game { ! public static final String version = "1.2.1"; /** The component Manager */ --- 12,16 ---- public class Game { ! public static final String version = "1.2.2"; /** The component Manager */ |
From: Brett L. <wak...@us...> - 2010-03-21 17:30:14
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27071 Modified Files: rails.sh rails.bat build.xml Log Message: bump version numbers to 1.2.2 Index: rails.bat =================================================================== RCS file: /cvsroot/rails/18xx/rails.bat,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rails.bat 18 Mar 2010 05:24:40 -0000 1.9 --- rails.bat 21 Mar 2010 17:30:05 -0000 1.10 *************** *** 1,2 **** ! java -jar rails-1.2.1.jar %1 \ No newline at end of file --- 1,2 ---- ! java -jar rails-1.2.2.jar %1 \ No newline at end of file Index: rails.sh =================================================================== RCS file: /cvsroot/rails/18xx/rails.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rails.sh 18 Mar 2010 05:24:40 -0000 1.8 --- rails.sh 21 Mar 2010 17:30:05 -0000 1.9 *************** *** 1,3 **** #!/bin/bash ! java -jar ./rails-1.2.1.jar $1 \ No newline at end of file --- 1,3 ---- #!/bin/bash ! java -jar ./rails-1.2.2.jar $1 \ No newline at end of file Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** build.xml 18 Mar 2010 05:24:40 -0000 1.15 --- build.xml 21 Mar 2010 17:30:05 -0000 1.16 *************** *** 10,14 **** <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.2.1"/> <taskdef name="jarbundler" classpath="tools/lib/jarbundler-2.1.0.jar" --- 10,14 ---- <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.2.2"/> <taskdef name="jarbundler" classpath="tools/lib/jarbundler-2.1.0.jar" |
From: Stefan F. <ste...@us...> - 2010-03-21 12:55:48
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8513/rails/ui/swing/hexmap Modified Files: EWHexMap.java Log Message: Removed typo, fixes bug ID: 2973927, map zoom Index: EWHexMap.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/EWHexMap.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EWHexMap.java 11 Mar 2010 20:38:19 -0000 1.14 --- EWHexMap.java 21 Mar 2010 12:55:33 -0000 1.15 *************** *** 78,82 **** hex = h[i][j]; if (hex != null) { ! hex.scaleHex(cx + scale * ((GUIHex.SQRT3 * ii) + (GUIHex.SQRT3 / 2 * (jj & 1))), cy + jj * 1.5 * scale, scale, zoomFactor); --- 78,82 ---- hex = h[i][j]; if (hex != null) { ! hex.scaleHex(cx + scale * ((GUIHex.SQRT3 * ii) + (GUIHex.SQRT3 / 2 * (j & 1))), cy + jj * 1.5 * scale, scale, zoomFactor); |
From: Stefan F. <ste...@us...> - 2010-03-20 12:24:09
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7696/data/1889 Modified Files: TileSet.xml Log Message: Added upgrades 205,206 to tile 57 (as suggested by Aliza Panitz - this is a correction of the tile manifest in the rulebook) Index: TileSet.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/TileSet.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TileSet.xml 3 Feb 2010 20:01:28 -0000 1.2 --- TileSet.xml 20 Mar 2010 12:23:59 -0000 1.3 *************** *** 85,89 **** <Attributes quantity="2"/> </IfOption> ! <Upgrade id="14,15"/> </Tile> <Tile id="58"> --- 85,89 ---- <Attributes quantity="2"/> </IfOption> ! <Upgrade id="14,15,205,206"/> </Tile> <Tile id="58"> *************** *** 93,97 **** <Attributes quantity="1"/> </Tile> ! <Tile id="438"> <!--NEW TILE: I4 TODO: 80 costs to upgrade--> <Attributes quantity="1"/> <Upgrade id="439"/> --- 93,97 ---- <Attributes quantity="1"/> </Tile> ! <Tile id="438"> <!--NEW TILE: I4 --> <Attributes quantity="1"/> <Upgrade id="439"/> *************** *** 172,176 **** <Upgrade id="448,611"/> </Tile> ! <Tile id="439"> <!--NEW TILE: I4 TODO: costs 80 to upgrade --> <Attributes quantity="1"/> <Upgrade id="492"/> --- 172,176 ---- <Upgrade id="448,611"/> </Tile> ! <Tile id="439"> <!--NEW TILE: I4 --> <Attributes quantity="1"/> <Upgrade id="492"/> |
From: Erik V. <ev...@us...> - 2010-03-19 20:51:18
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8889/rails/game Modified Files: OperatingRound.java Log Message: Changed previous fix, to reinstate the need to press Done after repaying loans Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** OperatingRound.java 19 Mar 2010 20:37:53 -0000 1.117 --- OperatingRound.java 19 Mar 2010 20:51:05 -0000 1.118 *************** *** 1964,1974 **** if (repayment > 0) executeRepayLoans (action); - // doneAllowed = true; - // has no effect, overwritten in setPossibleActions(), fix of bug 2954654 - - if (operatingCompany.getCurrentNumberOfLoans() == 0) { - nextStep(); - } - return true; } --- 1964,1967 ---- |
From: Erik V. <ev...@us...> - 2010-03-19 20:38:20
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7346/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Fix stall after repaying loans in 1856 Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** OperatingRound_1856.java 13 Mar 2010 18:41:25 -0000 1.31 --- OperatingRound_1856.java 19 Mar 2010 20:37:53 -0000 1.32 *************** *** 351,354 **** --- 351,358 ---- // Step may only be skipped if repayment is optional if (minNumber == 0) doneAllowed = true; + + } else { + // No (more) loans + doneAllowed = true; } } |
From: Erik V. <ev...@us...> - 2010-03-19 20:38:06
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7346/rails/game Modified Files: OperatingRound.java Log Message: Fix stall after repaying loans in 1856 Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** OperatingRound.java 14 Mar 2010 14:21:24 -0000 1.116 --- OperatingRound.java 19 Mar 2010 20:37:53 -0000 1.117 *************** *** 1966,1969 **** --- 1966,1973 ---- // doneAllowed = true; // has no effect, overwritten in setPossibleActions(), fix of bug 2954654 + + if (operatingCompany.getCurrentNumberOfLoans() == 0) { + nextStep(); + } return true; |
From: Brett L. <wak...@us...> - 2010-03-18 05:24:49
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28368/rails/game Modified Files: Game.java Log Message: bump version to 1.2.1 Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Game.java 14 Mar 2010 19:29:07 -0000 1.50 --- Game.java 18 Mar 2010 05:24:40 -0000 1.51 *************** *** 12,16 **** public class Game { ! public static final String version = "1.2"; /** The component Manager */ --- 12,16 ---- public class Game { ! public static final String version = "1.2.1"; /** The component Manager */ |
From: Brett L. <wak...@us...> - 2010-03-18 05:24:49
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28368 Modified Files: rails.sh rails.bat build.xml Log Message: bump version to 1.2.1 Index: rails.bat =================================================================== RCS file: /cvsroot/rails/18xx/rails.bat,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rails.bat 14 Mar 2010 19:29:06 -0000 1.8 --- rails.bat 18 Mar 2010 05:24:40 -0000 1.9 *************** *** 1,2 **** ! java -jar rails-1.2.jar %1 \ No newline at end of file --- 1,2 ---- ! java -jar rails-1.2.1.jar %1 \ No newline at end of file Index: rails.sh =================================================================== RCS file: /cvsroot/rails/18xx/rails.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rails.sh 3 Feb 2010 05:17:44 -0000 1.7 --- rails.sh 18 Mar 2010 05:24:40 -0000 1.8 *************** *** 1,3 **** #!/bin/bash ! java -jar ./rails-1.1.3.jar $1 --- 1,3 ---- #!/bin/bash ! java -jar ./rails-1.2.1.jar $1 \ No newline at end of file Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** build.xml 14 Mar 2010 19:29:06 -0000 1.14 --- build.xml 18 Mar 2010 05:24:40 -0000 1.15 *************** *** 10,14 **** <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.2"/> <taskdef name="jarbundler" classpath="tools/lib/jarbundler-2.1.0.jar" --- 10,14 ---- <property name="target" value="1.5"/> <property name="source" value="1.5"/> ! <property name="version" value="1.2.1"/> <taskdef name="jarbundler" classpath="tools/lib/jarbundler-2.1.0.jar" |