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...> - 2008-12-11 20:12:24
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20930/rails/game Modified Files: Tile.java StartPacket.java PublicCertificate.java Log Message: Cleanups, annotations, formatting. Index: StartPacket.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartPacket.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** StartPacket.java 4 Jun 2008 19:00:31 -0000 1.11 --- StartPacket.java 11 Dec 2008 20:12:07 -0000 1.12 *************** *** 26,29 **** --- 26,30 ---- * The start packet name. Usually the default name "Ïnitial" is used. */ + @SuppressWarnings("unused") private String name; // For identification if there is more than one. /** The name of the class that implements the Start Round for this packet. */ *************** *** 47,51 **** * Constructor. Only takes the packet and class named. Actual initialisation * is done in <b>configureFromXML()</b>. ! * * @param name The start packet name. * @param roundClassName The StartRound class name. --- 48,52 ---- * Constructor. Only takes the packet and class named. Actual initialisation * is done in <b>configureFromXML()</b>. ! * * @param name The start packet name. * @param roundClassName The StartRound class name. *************** *** 60,64 **** * Configure the start packet from the contents of a <StartPacket> XML * element. ! * * @param element The <StartPacket> Element object. * @throws ConfigurationException if anything goes wrong. --- 61,65 ---- * Configure the start packet from the contents of a <StartPacket> XML * element. ! * * @param element The <StartPacket> Element object. * @throws ConfigurationException if anything goes wrong. *************** *** 136,150 **** /** * Get the start packet with as given name. ! * * @param name The start packet name. * @return The start packet (or null if it does not exist). */ public static StartPacket getStartPacket(String name) { ! return (StartPacket) packets.get(name); } /** * Get the start packet with the default name. ! * * @return The default start packet (or null if it does not exist). */ --- 137,151 ---- /** * Get the start packet with as given name. ! * * @param name The start packet name. * @return The start packet (or null if it does not exist). */ public static StartPacket getStartPacket(String name) { ! return packets.get(name); } /** * Get the start packet with the default name. ! * * @return The default start packet (or null if it does not exist). */ *************** *** 155,159 **** /** * Get the items of this start packet. ! * * @return The List of start items. */ --- 156,160 ---- /** * Get the items of this start packet. ! * * @return The List of start items. */ *************** *** 163,167 **** public StartItem getItem(int index) { ! return (StartItem) items.get(index); } --- 164,168 ---- public StartItem getItem(int index) { ! return items.get(index); } *************** *** 169,178 **** * Get the first start item. This one often gets a special treatment (price * reduction). ! * * @return first item */ public StartItem getFirstItem() { if (!items.isEmpty()) { ! return (StartItem) items.get(0); } else { return null; --- 170,179 ---- * Get the first start item. This one often gets a special treatment (price * reduction). ! * * @return first item */ public StartItem getFirstItem() { if (!items.isEmpty()) { ! return items.get(0); } else { return null; *************** *** 183,187 **** * Get the first start item that has not yet been sold. In many cases this * is the only item that can be bought immediately. ! * * @return first unsold item */ --- 184,188 ---- * Get the first start item that has not yet been sold. In many cases this * is the only item that can be bought immediately. ! * * @return first unsold item */ *************** *** 195,199 **** /** * Get all not yet sold start items. ! * * @return A List of all unsold items. */ --- 196,200 ---- /** * Get all not yet sold start items. ! * * @return A List of all unsold items. */ *************** *** 210,214 **** /** * Check if all items have bene sold. ! * * @return True if all items have been sold. */ --- 211,215 ---- /** * Check if all items have bene sold. ! * * @return True if all items have been sold. */ *************** *** 222,226 **** /** * Get the name of the StartRound class that will sell out this packet. ! * * @return StartRound subclass name. */ --- 223,227 ---- /** * Get the name of the StartRound class that will sell out this packet. ! * * @return StartRound subclass name. */ Index: Tile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Tile.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Tile.java 29 Nov 2008 20:01:33 -0000 1.24 --- Tile.java 11 Dec 2008 20:12:07 -0000 1.25 *************** *** 32,36 **** // Upgrade instances private String upgradesString = ""; ! private final List[] tracksPerSide = new ArrayList[6]; // N.B. Cannot parametrise collection array private Map<Integer, List<Track>> tracksPerStation = null; --- 32,37 ---- // Upgrade instances private String upgradesString = ""; ! @SuppressWarnings("unchecked") ! private final List[] tracksPerSide = new ArrayList[6]; // N.B. Cannot parametrise collection array private Map<Integer, List<Track>> tracksPerStation = null; *************** *** 258,266 **** } ! // Set reposition base tokens flag // (valid for all upgrades although attribute of one) relayBaseTokensOnUpgrade = upgradeTag.getAttributeAsBoolean( ! "relayBaseTokens", relayBaseTokensOnUpgrade); } --- 259,267 ---- } ! // Set reposition base tokens flag // (valid for all upgrades although attribute of one) relayBaseTokensOnUpgrade = upgradeTag.getAttributeAsBoolean( ! "relayBaseTokens", relayBaseTokensOnUpgrade); } *************** *** 338,342 **** * Get the valid upgrades if this tile on a certain hex (restrictions per * hex have not yet been implemented). ! * * @param hex The MapHex to be upgraded. * @return A List of valid upgrade TileI objects. --- 339,343 ---- * Get the valid upgrades if this tile on a certain hex (restrictions per * hex have not yet been implemented). ! * * @param hex The MapHex to be upgraded. * @return A List of valid upgrade TileI objects. *************** *** 451,455 **** * processed at the first usage, because Tiles are initialised before * the Map. ! * * @author Erik Vos */ --- 452,456 ---- * processed at the first usage, because Tiles are initialised before * the Map. ! * * @author Erik Vos */ *************** *** 462,470 **** protected boolean isAllowedForHex(MapHex hex, String phaseName) { ! if (allowedPhases != null && !allowedPhases.contains(phaseName)) { return false; } ! if (hexes != null) convertHexString(); --- 463,471 ---- protected boolean isAllowedForHex(MapHex hex, String phaseName) { ! if (allowedPhases != null && !allowedPhases.contains(phaseName)) { return false; } ! if (hexes != null) convertHexString(); *************** *** 477,481 **** } } ! protected TileI getTile() { return tile; --- 478,482 ---- } } ! protected TileI getTile() { return tile; *************** *** 485,493 **** this.hexes = hexes; } ! protected void setPhases (String phases) { allowedPhases = Arrays.asList(phases.split(",")); } ! private void convertHexString() { --- 486,494 ---- this.hexes = hexes; } ! protected void setPhases (String phases) { allowedPhases = Arrays.asList(phases.split(",")); } ! private void convertHexString() { Index: PublicCertificate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificate.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PublicCertificate.java 2 Nov 2008 19:52:48 -0000 1.11 --- PublicCertificate.java 11 Dec 2008 20:12:07 -0000 1.12 *************** *** 17,22 **** /** * Share percentage represented by this certificate - * - * @deprecated */ protected int shares; --- 17,20 ---- *************** *** 92,96 **** /** * Get the number of shares that this certificate represents. ! * * @return The number of shares. */ --- 90,94 ---- /** * Get the number of shares that this certificate represents. ! * * @return The number of shares. */ *************** *** 102,106 **** * Get the percentage of ownership that this certificate represents. This is * equal to the number of shares * the share unit. ! * * @return The share percentage. */ --- 100,104 ---- * Get the percentage of ownership that this certificate represents. This is * equal to the number of shares * the share unit. ! * * @return The share percentage. */ *************** *** 111,115 **** /** * Get the current price of this certificate. ! * * @return The current certificate price. */ --- 109,113 ---- /** * Get the current price of this certificate. ! * * @return The current certificate price. */ *************** *** 185,188 **** --- 183,187 ---- } + @Override protected Object clone() { try { *************** *** 201,205 **** * Two certificates are "equal" if they both belong to the same company, * represent the same share percentage, and are not a president share. ! * * @param cert Public company certificate to compare with. * @return True if the certs are "equal" in the defined sense. --- 200,204 ---- * Two certificates are "equal" if they both belong to the same company, * represent the same share percentage, and are not a president share. ! * * @param cert Public company certificate to compare with. * @return True if the certs are "equal" in the defined sense. *************** *** 210,213 **** --- 209,213 ---- } + @Override public String toString() { return "PublicCertificate: " + getName(); |
From: Erik V. <ev...@us...> - 2008-12-11 20:12:19
|
Update of /cvsroot/rails/18xx/rails/game/action In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20930/rails/game/action Modified Files: LayTile.java Log Message: Cleanups, annotations, formatting. Index: LayTile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/LayTile.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** LayTile.java 3 Dec 2008 20:15:15 -0000 1.15 --- LayTile.java 11 Dec 2008 20:12:07 -0000 1.16 *************** *** 1,4 **** /* $Header$ ! * * Created on 14-Sep-2006 * Change Log: --- 1,4 ---- /* $Header$ ! * * Created on 14-Sep-2006 * Change Log: *************** *** 10,17 **** import java.util.*; ! import rails.game.MapHex; ! import rails.game.MapManager; ! import rails.game.TileI; ! import rails.game.TileManager; import rails.game.special.SpecialProperty; import rails.game.special.SpecialTileLay; --- 10,14 ---- import java.util.*; ! import rails.game.*; import rails.game.special.SpecialProperty; import rails.game.special.SpecialTileLay; *************** *** 51,55 **** transient private SpecialTileLay specialProperty = null; private int specialPropertyId; ! /** * Need base tokens be relaid? --- 48,52 ---- transient private SpecialTileLay specialProperty = null; private int specialPropertyId; ! /** * Need base tokens be relaid? *************** *** 69,73 **** /** The tile orientation */ private int orientation; ! /** Any manually assigned base token positions */ private Map<String, Integer> relaidBaseTokens = null; --- 66,70 ---- /** The tile orientation */ private int orientation; ! /** Any manually assigned base token positions */ private Map<String, Integer> relaidBaseTokens = null; *************** *** 199,204 **** tileColours = map; } ! ! public boolean isRelayBaseTokens() { return relayBaseTokens; --- 196,201 ---- tileColours = map; } ! ! public boolean isRelayBaseTokens() { return relayBaseTokens; *************** *** 208,212 **** this.relayBaseTokens = relayBaseTokens; } ! public void addRelayBaseToken (String companyName, Integer cityNumber) { if (relaidBaseTokens == null) { --- 205,209 ---- this.relayBaseTokens = relayBaseTokens; } ! public void addRelayBaseToken (String companyName, Integer cityNumber) { if (relaidBaseTokens == null) { *************** *** 214,218 **** } relaidBaseTokens.put(companyName, cityNumber); ! relaidBaseTokensString = Util.appendWithDelimiter(relaidBaseTokensString, Util.appendWithDelimiter(companyName, String.valueOf(cityNumber), ":"), ","); --- 211,215 ---- } relaidBaseTokens.put(companyName, cityNumber); ! relaidBaseTokensString = Util.appendWithDelimiter(relaidBaseTokensString, Util.appendWithDelimiter(companyName, String.valueOf(cityNumber), ":"), ","); *************** *** 223,226 **** --- 220,224 ---- } + @Override public boolean equals(PossibleAction action) { if (!(action instanceof LayTile)) return false; *************** *** 232,235 **** --- 230,234 ---- } + @Override public String toString() { StringBuffer b = new StringBuffer("LayTile"); *************** *** 256,259 **** --- 255,259 ---- /** Deserialize */ + @SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { *************** *** 261,265 **** //in.defaultReadObject(); // Custom reading for backwards compatibility ! ObjectInputStream.GetField fields = in.readFields(); locationNames = (String) fields.get("locationNames", locationNames); tileColours = (Map<String, Integer>) fields.get("tileColours", tileColours); --- 261,265 ---- //in.defaultReadObject(); // Custom reading for backwards compatibility ! ObjectInputStream.GetField fields = in.readFields(); locationNames = (String) fields.get("locationNames", locationNames); tileColours = (Map<String, Integer>) fields.get("tileColours", tileColours); *************** *** 297,301 **** chosenHex = MapManager.getInstance().getHex(chosenHexName); } ! } --- 297,301 ---- chosenHex = MapManager.getInstance().getHex(chosenHexName); } ! } |
From: Erik V. <ev...@us...> - 2008-12-11 20:11:20
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20615/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Bug fix in flotation check when merging a minor Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StockRound_18EU.java 4 Dec 2008 00:55:27 -0000 1.15 --- StockRound_18EU.java 11 Dec 2008 20:11:15 -0000 1.16 *************** *** 33,37 **** super (); } ! /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize --- 33,37 ---- super (); } ! /** * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize *************** *** 43,47 **** super (aGameManager); } ! @Override public void start() { --- 43,47 ---- super (aGameManager); } ! @Override public void start() { *************** *** 67,71 **** * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ --- 67,71 ---- * Create a list of certificates that a player may buy in a Stock Round, * taking all rules into account. ! * * @return List of buyable certificates. */ *************** *** 266,270 **** /** * Start a company by buying one or more shares (more applies to e.g. 1841) ! * * @param player The player that wants to start a company. * @param company The company to start. --- 266,270 ---- /** * Start a company by buying one or more shares (more applies to e.g. 1841) ! * * @param player The player that wants to start a company. * @param company The company to start. *************** *** 478,482 **** * closed (in that case, the MergeCompanies.major attribute is null, which * never occurs in normal stock rounds). ! * * @param action * @return --- 478,482 ---- * closed (in that case, the MergeCompanies.major attribute is null, which * never occurs in normal stock rounds). ! * * @param action * @return *************** *** 528,532 **** if (major != null) { - checkFlotation(major); if (major.getNumberOfTrains() > major.getCurrentTrainLimit() && !compWithExcessTrains.contains(major)) { --- 528,531 ---- *************** *** 547,550 **** --- 546,550 ---- cert.moveTo(currentPlayer.getPortfolio()); ReportBuffer.add(LocalText.getText("MinorCloses", minor.getName())); + checkFlotation(major); } else { ReportBuffer.add(LocalText.getText("CLOSE_MINOR_LOG", new String[] { |
From: Erik V. <ev...@us...> - 2008-12-11 20:10:36
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20366/rails/ui/swing Modified Files: ORWindow.java ReportWindow.java Log Message: Localised some hardcoded text Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ReportWindow.java 3 Dec 2008 20:16:39 -0000 1.8 --- ReportWindow.java 11 Dec 2008 20:10:25 -0000 1.9 *************** *** 9,12 **** --- 9,13 ---- import rails.game.GameManager; import rails.game.ReportBuffer; + import rails.util.LocalText; /** *************** *** 50,54 **** setSize(400, 400); setLocation(600, 400); ! setTitle("Rails: Game log"); final JFrame frame = this; --- 51,55 ---- setSize(400, 400); setLocation(600, 400); ! setTitle(LocalText.getText("GameReportTitle")); final JFrame frame = this; Index: ORWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORWindow.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ORWindow.java 3 Dec 2008 20:16:39 -0000 1.19 --- ORWindow.java 11 Dec 2008 20:10:25 -0000 1.20 *************** *** 18,21 **** --- 18,22 ---- import rails.game.OperatingRound; import rails.game.action.*; + import rails.util.LocalText; /** *************** *** 74,78 **** orUIManager.init(this); ! setTitle("Rails: Map"); setLocation(10, 10); setVisible(false); --- 75,79 ---- orUIManager.init(this); ! setTitle(LocalText.getText("MapWindowTitle")); setLocation(10, 10); setVisible(false); *************** *** 155,158 **** --- 156,161 ---- public void activate(OperatingRound or) { orPanel.recreate(or); + setTitle(LocalText.getText("MapWindowORTitle", + gameUIManager.getGameManager().getCompositeORNumber())); pack(); if (lastBounds != null) { *************** *** 178,181 **** --- 181,185 ---- orPanel.finish(); upgradePanel.finish(); + setTitle(LocalText.getText("MapWindowTitle")); } } |
From: Erik V. <ev...@us...> - 2008-12-11 20:10:35
|
Update of /cvsroot/rails/18xx In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20366 Modified Files: LocalisedText.properties Log Message: Localised some hardcoded text Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** LocalisedText.properties 28 Nov 2008 19:41:34 -0000 1.61 --- LocalisedText.properties 11 Dec 2008 20:10:25 -0000 1.62 *************** *** 140,143 **** --- 140,144 ---- GameIs=Game is {0}. GameOver=The game is over. + GameReportTitle=Rails: Game Report GameSetupFailed=Game setup from file {0} failed GetShareForMinor={0} gets a {1}% share of {2} from {3} in exchange for Minor {4} *************** *** 182,185 **** --- 183,188 ---- LoadGame=Load Game MAP=Map + MapWindowTitle=Rails: Map + MapWindowORTitle=Rails: Map, Operating Round {0} MARKET=Stock Market MayNotBuyAndSell={0} may not both buy and sell shares |
From: Erik V. <ev...@us...> - 2008-12-10 20:45:01
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8617/rails/game/specific/_18EU Modified Files: GameManager_18EU.java Log Message: Initialisation fixed Index: GameManager_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/GameManager_18EU.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameManager_18EU.java 4 Jun 2008 19:00:36 -0000 1.2 --- GameManager_18EU.java 10 Dec 2008 20:44:48 -0000 1.3 *************** *** 30,34 **** --- 30,36 ---- FinalMinorExchangeRound sr = new FinalMinorExchangeRound(); + sr.setGameManager(this); sr.start(or); + setRound (sr); } |
From: Erik V. <ev...@us...> - 2008-12-07 19:27:17
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20653/rails/ui/swing Modified Files: GameUIManager.java Log Message: Cleanups only Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GameUIManager.java 21 Nov 2008 20:41:47 -0000 1.13 --- GameUIManager.java 7 Dec 2008 19:27:08 -0000 1.14 *************** *** 92,97 **** orWindow = new ORWindow(this); orUIManager = orWindow.getORUIManager(); - // mapPanel = orWindow.getMapPanel(); - // statusWindow = new StatusWindow(this); String statusWindowClassName = getClassName(Defs.ClassName.STATUS_WINDOW); --- 92,95 ---- *************** *** 107,111 **** updateUI(); ! } --- 105,109 ---- updateUI(); ! } *************** *** 215,220 **** activeWindow = statusWindow; - // stockRound = (StockRound) currentRound; - statusWindow.updateStatus(); --- 213,216 ---- *************** *** 279,283 **** gameUIInit(); processOnServer(null); - // updateUI(); statusWindow.setGameActions(); } --- 275,278 ---- |
From: Erik V. <ev...@us...> - 2008-12-07 19:27:17
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20653/rails/game/specific/_18EU Modified Files: FinalMinorExchangeRound.java Log Message: Cleanups only Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FinalMinorExchangeRound.java 4 Dec 2008 00:55:48 -0000 1.4 --- FinalMinorExchangeRound.java 7 Dec 2008 19:27:08 -0000 1.5 *************** *** 128,160 **** } - /* - * @Override protected void setNextPlayer() { if - * (!discardingTrains.booleanValue()) { // Check if any player has a minor - * left for (int i=0; i<GameManager.getNumberOfPlayers(); i++) { - * GameManager.setNextPlayer(); currentPlayer = - * GameManager.getCurrentPlayer(); for (PublicCertificateI cert : - * currentPlayer.getPortfolio().getCertificates()) { if - * (cert.getCompany().getTypeName().equals("Minor")) { initPlayer(); return; } } } // - * No more minors, get rid of any excess trains discardingTrains.set(true); - * - * if (compWithExcessTrains.isEmpty()) { gameMgr.nextRound (this); return; } // - * Make up a list of train discarding companies in sequence of the last OR // - * TODO: this disregards any changes in the operating sequence // during the - * last OR. This is probably wrong. PublicCompanyI[] operatingCompanies = - * lastOR.getOperatingCompanies(); discardingCompanies = new - * PublicCompanyI[compWithExcessTrains.size()]; for (int i=0, j=0; i<operatingCompanies.length; - * i++) { if (compWithExcessTrains.contains(operatingCompanies[i])) { - * discardingCompanies[j++] = operatingCompanies[i]; } } - * - * discardingCompanyIndex = new IntegerState ("DiscardingCompanyIndex", 0); } - * else { PublicCompanyI comp = - * discardingCompanies[discardingCompanyIndex.intValue()]; if - * (comp.getNumberOfTrains() <= comp.getCurrentTrainLimit()) { - * discardingCompanyIndex.add(1); } } - * - * if (discardingCompanyIndex.intValue() >= discardingCompanies.length) { // - * All excess trains have been discarded gameMgr.nextRound (this); return; } } - */ - @Override protected void initPlayer() { --- 128,131 ---- *************** *** 171,173 **** return "FinalMinorExchangeRound"; } ! } --- 142,144 ---- return "FinalMinorExchangeRound"; } ! } \ No newline at end of file |
From: Mark J S. <kr...@us...> - 2008-12-04 01:20:21
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7243/18xx/rails/game/specific/_1856 Modified Files: StockRound_1856.java Log Message: Added Constructors for proper initializing Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StockRound_1856.java 2 Dec 2008 20:29:15 -0000 1.4 --- StockRound_1856.java 4 Dec 2008 01:20:13 -0000 1.5 *************** *** 4,7 **** --- 4,8 ---- import rails.game.CashHolder; import rails.game.Certificate; + import rails.game.GameManager; import rails.game.Portfolio; import rails.game.PublicCertificateI; *************** *** 9,16 **** --- 10,28 ---- import rails.game.ReportBuffer; import rails.game.StockRound; + import rails.game.move.CashMove; import rails.util.LocalText; public class StockRound_1856 extends StockRound { + /** + * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Stock Round + * + */ + public StockRound_1856 (GameManager aGameManager) { + super (aGameManager); + } + /** * Special 1856 code to check for company flotation. |
From: Mark J S. <kr...@us...> - 2008-12-04 01:15:40
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7075/18xx/rails/game Modified Files: ShareSellingRound.java Log Message: Added Constructors for proper initializing Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ShareSellingRound.java 2 Dec 2008 20:29:15 -0000 1.16 --- ShareSellingRound.java 4 Dec 2008 01:15:35 -0000 1.17 *************** *** 23,31 **** IntegerState cashToRaise; public ShareSellingRound(GameManager gameManager, PublicCompanyI compNeedingTrain, int cashToRaise) { ! this.gameManager = gameManager; ! this.companyManager = gameManager.getCompanyManager(); this.companyNeedingTrain = compNeedingTrain; this.cashToRaise = new IntegerState("CashToRaise", cashToRaise); --- 23,40 ---- IntegerState cashToRaise; + /** + * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and + * and other parameters used by the Share Selling Round Class + * + * @param aGameManager The GameManager Object needed to initialize the StockRound Class + * @param compNeedingTraing The PublicCompanyI Object that needs to buy the train, + * who is limited on selling shares of + * @param cashToRaise The amount of cash needed to be raised during the special sell-off + * + */ public ShareSellingRound(GameManager gameManager, PublicCompanyI compNeedingTrain, int cashToRaise) { ! super (gameManager); this.companyNeedingTrain = compNeedingTrain; this.cashToRaise = new IntegerState("CashToRaise", cashToRaise); |
From: Mark J S. <kr...@us...> - 2008-12-04 01:03:43
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6580/18xx/rails/game Modified Files: TreasuryShareRound.java Log Message: Added Constructors for proper initializing Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TreasuryShareRound.java 2 Dec 2008 20:29:15 -0000 1.9 --- TreasuryShareRound.java 4 Dec 2008 01:03:40 -0000 1.10 *************** *** 30,39 **** private final BooleanState hasSold; ! public TreasuryShareRound(GameManager gameManager, ! PublicCompanyI operatingCompany) { ! ! this.gameManager = gameManager; ! this.companyManager = gameManager.getCompanyManager(); ! this.operatingCompany = operatingCompany; sellingPlayer = operatingCompany.getPresident(); --- 30,44 ---- private final BooleanState hasSold; ! /** ! * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and ! * and other parameters used by the Treasury Share Round Class ! * ! * @param aGameManager The GameManager Object needed to initialize the StockRound Class ! * @param operatingCompany The PublicCompanyI Object that is selling shares ! * ! */ ! public TreasuryShareRound(GameManager aGameManager, ! PublicCompanyI operatingCompany) { ! super (aGameManager); this.operatingCompany = operatingCompany; sellingPlayer = operatingCompany.getPresident(); |
From: Mark J S. <kr...@us...> - 2008-12-04 00:55:52
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6167/18xx/rails/game/specific/_1835 Modified Files: StockRound_1835.java Log Message: Added Constructors for proper initializing Index: StockRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/StockRound_1835.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StockRound_1835.java 30 Oct 2008 21:48:20 -0000 1.1 --- StockRound_1835.java 4 Dec 2008 00:55:48 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import rails.game.CompanyManagerI; + import rails.game.GameManager; import rails.game.Portfolio; import rails.game.PublicCompanyI; *************** *** 18,21 **** --- 19,32 ---- CompanyManagerI compMgr; + /** + * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Stock Round + * + */ + public StockRound_1835 (GameManager aGameManager) { + super (aGameManager); + } + /** * The company release rules for 1835. |
From: Mark J S. <kr...@us...> - 2008-12-04 00:55:51
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6167/18xx/rails/game/specific/_18EU Modified Files: FinalMinorExchangeRound.java Log Message: Added Constructors for proper initializing Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FinalMinorExchangeRound.java 30 Jun 2008 20:35:30 -0000 1.3 --- FinalMinorExchangeRound.java 4 Dec 2008 00:55:48 -0000 1.4 *************** *** 19,27 **** OperatingRound_18EU lastOR; ! /** ! * The constructor. ! */ ! public FinalMinorExchangeRound() {} public void start(OperatingRound_18EU lastOR) { ReportBuffer.add("\n" --- 19,41 ---- OperatingRound_18EU lastOR; ! /** ! * Constructor with no parameters, will call super class (StockRound_18EU's) Constructor to initialize ! * ! */ ! public FinalMinorExchangeRound() ! { ! super (); ! } + /** + * Constructor with the GameManager, will call super class (StockRound_18EU's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Stock Round + * + */ + public FinalMinorExchangeRound(GameManager aGameManager) { + super (aGameManager); + } + public void start(OperatingRound_18EU lastOR) { ReportBuffer.add("\n" |
From: Mark J S. <kr...@us...> - 2008-12-04 00:55:31
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6150/18xx/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Added Constructors for proper initializing Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StockRound_18EU.java 2 Nov 2008 19:52:48 -0000 1.14 --- StockRound_18EU.java 4 Dec 2008 00:55:27 -0000 1.15 *************** *** 26,29 **** --- 26,47 ---- protected boolean phase5Reached = false; + /** + * Constructor with no parameters, will call super class (StockRound's) Constructor to initialize + * + */ + public StockRound_18EU () { + super (); + } + + /** + * Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Stock Round + * + */ + public StockRound_18EU (GameManager aGameManager) { + super (aGameManager); + } + @Override public void start() { |
From: Mark J S. <kr...@us...> - 2008-12-04 00:54:48
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6128/18xx/rails/game Modified Files: StockRound.java Log Message: Added Constructors for proper intialization Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** StockRound.java 20 Nov 2008 21:49:38 -0000 1.32 --- StockRound.java 4 Dec 2008 00:54:43 -0000 1.33 *************** *** 59,62 **** --- 59,80 ---- static protected boolean noSaleIfNotOperated = false; + /** + * Constructor with no parameters, call the super Class (Round's) Constructor with no parameters + * + */ + public StockRound () { + super (); + } + + /** + * Constructor with the GameManager, will call super class (Round's) Constructor to initialize + * + * @param aGameManager The GameManager Object needed to initialize the Round Class + * + */ + public StockRound (GameManager aGameManager) { + super (aGameManager); + } + public void start() { |
From: Mark J S. <kr...@us...> - 2008-12-04 00:46:51
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5872/18xx/rails/game Modified Files: Round.java Log Message: Update to include Constructors. Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Round.java 20 Nov 2008 21:49:38 -0000 1.12 --- Round.java 4 Dec 2008 00:46:46 -0000 1.13 *************** *** 29,35 **** protected CompanyManagerI companyManager = null; ! public void setGameManager (GameManager gameManager) { ! this.gameManager = gameManager; ! this.companyManager = gameManager.getCompanyManager(); } --- 29,62 ---- protected CompanyManagerI companyManager = null; ! /** ! * Constructor with no parameters, call the setGameManager with null to properly initialize ! * ! */ ! public Round () { ! setGameManager (null); ! } ! ! /** ! * Constructor with the GameManager, will call setGameManager with the parameter to initialize ! * ! * @param aGameManager The GameManager Object needed to initialize the Round Class ! * ! */ ! public Round (GameManager aGameManager) { ! setGameManager (aGameManager); ! } ! ! /** Initialization routine that will set the gameManager and the companyManager objects for use in the class ! * ! * @param aGameManager The GameManager Object to save in the class, and use to find the CompanyManager ! * ! */ ! public void setGameManager (GameManager aGameManager) { ! gameManager = aGameManager; ! if (aGameManager == null) { ! companyManager = null; ! } else { ! companyManager = aGameManager.getCompanyManager(); ! } } |
From: Mark J S. <kr...@us...> - 2008-12-04 00:45:31
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5810/18xx/rails/game Modified Files: OperatingRound.java Log Message: Update to include Constructors. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** OperatingRound.java 3 Dec 2008 20:15:15 -0000 1.46 --- OperatingRound.java 4 Dec 2008 00:45:23 -0000 1.47 *************** *** 110,121 **** /** ! * The constructor. ! * ! * @param operate If false, only the privates pay out. This applies if the ! * Start Packet has not yet been sold completely. */ public OperatingRound() { ! } ! public void start(boolean operate, String orNumber) { --- 110,120 ---- /** ! * Constructor with no parameters, call the super Class (Round's) Constructor with no parameters ! * */ public OperatingRound() { ! super (); ! } ! public void start(boolean operate, String orNumber) { |
From: Erik V. <ev...@us...> - 2008-12-03 20:17:45
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5063/rails/ui/swing Modified Files: StatusWindow.java Log Message: CLeanup Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** StatusWindow.java 29 Nov 2008 20:01:33 -0000 1.25 --- StatusWindow.java 3 Dec 2008 20:17:36 -0000 1.26 *************** *** 154,158 **** menuItem = new JCheckBoxMenuItem(LocalText.getText("REPORT")); ! menuItem.setName(LocalText.getText("REPORT")); menuItem.setActionCommand(REPORT_CMD); menuItem.setMnemonic(KeyEvent.VK_R); --- 154,158 ---- menuItem = new JCheckBoxMenuItem(LocalText.getText("REPORT")); ! menuItem.setName(REPORT_CMD); menuItem.setActionCommand(REPORT_CMD); menuItem.setMnemonic(KeyEvent.VK_R); *************** *** 264,267 **** --- 264,268 ---- final JFrame frame = this; addWindowListener(new WindowAdapter () { + @Override public void windowClosing(WindowEvent e) { if (JOptionPane.showConfirmDialog(frame, "Do you really want to exit the game?", "Select", JOptionPane.OK_CANCEL_OPTION) *************** *** 272,276 **** } }); ! pack(); --- 273,277 ---- } }); ! pack(); *************** *** 560,564 **** return gameStatus; } ! public static void uncheckMenuItemBox(String itemName) { int count = optMenu.getMenuComponentCount(); --- 561,565 ---- return gameStatus; } ! public static void uncheckMenuItemBox(String itemName) { int count = optMenu.getMenuComponentCount(); *************** *** 632,636 **** public void keyTyped(KeyEvent e) {} ! } --- 633,637 ---- public void keyTyped(KeyEvent e) {} ! } |
From: Erik V. <ev...@us...> - 2008-12-03 20:16:42
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5014/rails/ui/swing Modified Files: ORWindow.java StockChart.java ReportWindow.java Log Message: Could remove WindowListener methods (mostly unused) by passing WindowAdapter into addWindowListener. Index: ReportWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ReportWindow.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReportWindow.java 21 Nov 2008 20:41:47 -0000 1.7 --- ReportWindow.java 3 Dec 2008 20:16:39 -0000 1.8 *************** *** 2,17 **** package rails.ui.swing; - import rails.game.*; - import rails.util.LocalText; - import java.awt.*; - import javax.swing.*; import java.awt.event.*; /** * This is the UI for the LogWindow. It displays logged messages to the user * during the rails.game. */ ! public class ReportWindow extends JFrame implements WindowListener, KeyListener { private static final long serialVersionUID = 1L; --- 2,18 ---- package rails.ui.swing; import java.awt.*; import java.awt.event.*; + import javax.swing.*; + + import rails.game.GameManager; + import rails.game.ReportBuffer; + /** * This is the UI for the LogWindow. It displays logged messages to the user * during the rails.game. */ ! public class ReportWindow extends JFrame implements KeyListener { private static final long serialVersionUID = 1L; *************** *** 50,54 **** setLocation(600, 400); setTitle("Rails: Game log"); ! addWindowListener(this); addKeyListener(this); --- 51,63 ---- setLocation(600, 400); setTitle("Rails: Game log"); ! ! final JFrame frame = this; ! addWindowListener(new WindowAdapter() { ! @Override ! public void windowClosing(WindowEvent e) { ! StatusWindow.uncheckMenuItemBox(StatusWindow.REPORT_CMD); ! frame.dispose(); ! } ! }); addKeyListener(this); *************** *** 67,87 **** } - public void windowActivated(WindowEvent e) {} - - public void windowClosed(WindowEvent e) {} - - public void windowClosing(WindowEvent e) { - StatusWindow.uncheckMenuItemBox(LocalText.getText("REPORT")); - dispose(); - } - - public void windowDeactivated(WindowEvent e) {} - - public void windowDeiconified(WindowEvent e) {} - - public void windowIconified(WindowEvent e) {} - - public void windowOpened(WindowEvent e) {} - public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { --- 76,79 ---- Index: StockChart.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StockChart.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StockChart.java 4 Jun 2008 19:00:33 -0000 1.5 --- StockChart.java 3 Dec 2008 20:16:39 -0000 1.6 *************** *** 4,12 **** import java.awt.*; import java.awt.event.*; import javax.swing.*; import rails.game.*; import rails.ui.swing.elements.GUIStockSpace; - import rails.util.LocalText; /** --- 4,12 ---- import java.awt.*; import java.awt.event.*; + import javax.swing.*; import rails.game.*; import rails.ui.swing.elements.GUIStockSpace; /** *************** *** 14,18 **** */ ! public class StockChart extends JFrame implements WindowListener, KeyListener { private static final long serialVersionUID = 1L; private JPanel stockPanel; --- 14,18 ---- */ ! public class StockChart extends JFrame implements KeyListener { private static final long serialVersionUID = 1L; private JPanel stockPanel; *************** *** 31,35 **** stockPanel.setBackground(Color.LIGHT_GRAY); ! addWindowListener(this); addKeyListener(this); pack(); --- 31,42 ---- stockPanel.setBackground(Color.LIGHT_GRAY); ! final JFrame frame = this; ! addWindowListener(new WindowAdapter() { ! @Override ! public void windowClosing(WindowEvent e) { ! StatusWindow.uncheckMenuItemBox(StatusWindow.MARKET_CMD); ! frame.dispose(); ! } ! }); addKeyListener(this); pack(); *************** *** 97,117 **** } - public void windowActivated(WindowEvent e) {} - - public void windowClosed(WindowEvent e) {} - - public void windowClosing(WindowEvent e) { - StatusWindow.uncheckMenuItemBox(LocalText.getText("MARKET")); - dispose(); - } - - public void windowDeactivated(WindowEvent e) {} - - public void windowDeiconified(WindowEvent e) {} - - public void windowIconified(WindowEvent e) {} - - public void windowOpened(WindowEvent e) {} - public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { --- 104,107 ---- Index: ORWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORWindow.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ORWindow.java 1 Dec 2008 21:31:55 -0000 1.18 --- ORWindow.java 3 Dec 2008 20:16:39 -0000 1.19 *************** *** 2,27 **** package rails.ui.swing; ! import rails.common.Defs; ! import rails.game.*; ! import rails.game.action.LayTile; ! import rails.game.action.LayToken; ! import rails.game.action.PossibleAction; ! import rails.game.action.PossibleActions; ! import rails.util.LocalText; ! import java.util.ArrayList; import java.util.List; ! import java.awt.*; ! import java.awt.event.*; ! import javax.swing.*; import org.apache.log4j.Logger; /** * This Window displays the available operations that may be performed during an * Operating Round. This window also contains the Game Map. */ ! public class ORWindow extends JFrame implements WindowListener, ActionPerformer { private static final long serialVersionUID = 1L; public GameUIManager gameUIManager; --- 2,27 ---- package rails.ui.swing; ! import java.awt.BorderLayout; ! import java.awt.Rectangle; ! import java.awt.event.WindowAdapter; ! import java.awt.event.WindowEvent; import java.util.ArrayList; import java.util.List; ! import javax.swing.JFrame; ! import javax.swing.JOptionPane; import org.apache.log4j.Logger; + import rails.common.Defs; + import rails.game.DisplayBuffer; + import rails.game.OperatingRound; + import rails.game.action.*; + /** * This Window displays the available operations that may be performed during an * Operating Round. This window also contains the Game Map. */ ! public class ORWindow extends JFrame implements ActionPerformer { private static final long serialVersionUID = 1L; public GameUIManager gameUIManager; *************** *** 31,35 **** private UpgradesPanel upgradePanel; private MessagePanel messagePanel; ! private Rectangle lastBounds; --- 31,35 ---- private UpgradesPanel upgradePanel; private MessagePanel messagePanel; ! private Rectangle lastBounds; *************** *** 78,82 **** setVisible(false); setSize(800, 600); ! addWindowListener(this); gameUIManager.reportWindow.addLog(); --- 78,90 ---- setVisible(false); setSize(800, 600); ! ! final JFrame frame = this; ! addWindowListener(new WindowAdapter() { ! @Override ! public void windowClosing(WindowEvent e) { ! StatusWindow.uncheckMenuItemBox(StatusWindow.MAP_CMD); ! frame.dispose(); ! } ! }); gameUIManager.reportWindow.addLog(); *************** *** 111,131 **** } - public void windowActivated(WindowEvent e) {} - - public void windowClosed(WindowEvent e) {} - - public void windowClosing(WindowEvent e) { - StatusWindow.uncheckMenuItemBox(LocalText.getText("MAP")); - dispose(); - } - - public void windowDeactivated(WindowEvent e) {} - - public void windowDeiconified(WindowEvent e) {} - - public void windowIconified(WindowEvent e) {} - - public void windowOpened(WindowEvent e) {} - public boolean process(PossibleAction action) { --- 119,122 ---- *************** *** 167,171 **** if (lastBounds != null) { Rectangle newBounds = getBounds(); ! lastBounds.x = newBounds.x; setBounds (lastBounds); } --- 158,162 ---- if (lastBounds != null) { Rectangle newBounds = getBounds(); ! lastBounds.width = newBounds.width; setBounds (lastBounds); } *************** *** 181,185 **** /** * Round-end settings ! * */ public void finish() { --- 172,176 ---- /** * Round-end settings ! * */ public void finish() { |
From: Erik V. <ev...@us...> - 2008-12-03 20:15:23
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4937/rails/game Modified Files: Phase.java CompanyManagerI.java PublicCompanyI.java PublicCompany.java RoundI.java Company.java OperatingRound.java CompanyManager.java Log Message: Cleanups Index: CompanyManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/CompanyManager.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CompanyManager.java 4 Jul 2008 20:46:33 -0000 1.11 --- CompanyManager.java 3 Dec 2008 20:15:15 -0000 1.12 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import org.apache.log4j.Logger; import rails.util.*; public class CompanyManager implements CompanyManagerI, ConfigurableComponentI { /** A List with all private companies */ private List<PrivateCompanyI> lPrivateCompanies = new ArrayList<PrivateCompanyI>(); /** A List with all public companies */ private List<PublicCompanyI> lPublicCompanies = new ArrayList<PublicCompanyI>(); /** A map with all private companies by name */ private Map<String, PrivateCompanyI> mPrivateCompanies = new HashMap<String, PrivateCompanyI>(); /** A map with all public (i.e. non-private) companies by name */ private Map<String, PublicCompanyI> mPublicCompanies = new HashMap<String, PublicCompanyI>(); /** A map of all type names to maps of companies of that type by name */ // TODO Redundant, current usage can be replaced. private Map<String, HashMap<String, CompanyI>> mCompaniesByTypeAndName = new HashMap<String, HashMap<String, CompanyI>>(); /** A list of all start packets (usually one) */ // TODO Currently not used (but some newer games have more than one) private List<StartPacket> startPackets = new ArrayList<StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); /* * NOTES: 1. we don't have a map over all companies, because some games have * duplicate names, e.g. B&O in 1830. 2. we have both a map and a list of * private/public companies to preserve configuration sequence while * allowing direct access. */ /** * No-args constructor. */ public CompanyManager() { // Nothing to do here, everything happens when configured. } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { /** A map with all company types, by type name */ // Localised here as it has no permanent use Map<String, CompanyTypeI> mCompanyTypes = new HashMap<String, CompanyTypeI>(); for (Tag compTypeTag : tag.getChildren(CompanyTypeI.ELEMENT_ID)) { // Extract the attributes of the Component String name = compTypeTag.getAttributeAsString(CompanyTypeI.NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompanyType")); } String className = compTypeTag.getAttributeAsString(CompanyTypeI.CLASS_TAG); if (className == null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeHasNoClass", name)); } if (mCompanyTypes.get(name) != null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeConfiguredTwice", name)); } CompanyTypeI companyType = new CompanyType(name, className); mCompanyTypes.put(name, companyType); // Further parsing is done within CompanyType companyType.configureFromXML(compTypeTag); } /* Read and configure the companies */ for (Tag companyTag : tag.getChildren(CompanyI.COMPANY_ELEMENT_ID)) { // Extract the attributes of the Component String name = companyTag.getAttributeAsString(CompanyI.COMPANY_NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompany")); } String type = companyTag.getAttributeAsString(CompanyI.COMPANY_TYPE_TAG); if (type == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasNoType", name)); } CompanyTypeI cType = (CompanyTypeI) mCompanyTypes.get(type); if (cType == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasUnknownType", new String[] { name, type })); } try { CompanyI company = cType.createCompany(name, companyTag); /* Private or public */ if (company instanceof PrivateCompanyI) { mPrivateCompanies.put(name, (PrivateCompanyI) company); lPrivateCompanies.add((PrivateCompanyI) company); } else if (company instanceof PublicCompanyI) { ((PublicCompanyI)company).setIndex (numberOfPublicCompanies++); mPublicCompanies.put(name, (PublicCompanyI) company); lPublicCompanies.add((PublicCompanyI) company); } /* By type and name */ if (!mCompaniesByTypeAndName.containsKey(type)) mCompaniesByTypeAndName.put(type, new HashMap<String, CompanyI>()); ((Map<String, CompanyI>) mCompaniesByTypeAndName.get(type)).put( name, company); } catch (Exception e) { throw new ConfigurationException(LocalText.getText( "ClassCannotBeInstantiated", cType.getClassName()), e); } } /* Read and configure the start packets */ List<Tag> packetTags = tag.getChildren("StartPacket"); if (packetTags != null) { for (Tag packetTag : tag.getChildren("StartPacket")) { // Extract the attributes of the Component String name = packetTag.getAttributeAsString("name"); if (name == null) name = "Initial"; String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); sp.configureFromXML(packetTag); } } /* Read and configure additional rules */ /* This part may move later to a GameRules or GameManager XML */ Tag rulesTag = tag.getChild("StockRoundRules"); if (rulesTag != null) { for (String ruleTagName : rulesTag.getChildren().keySet()) { if (ruleTagName.equals("NoSaleInFirstSR")) { StockRound.setNoSaleInFirstSR(); } else if (ruleTagName.equals("NoSaleIfNotOperated")) { StockRound.setNoSaleIfNotOperated(); } } } } // Post XML parsing initialisations public void initCompanies() throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.init2(); } } /** * @see rails.game.CompanyManagerI#getCompany(java.lang.String) * */ public PrivateCompanyI getPrivateCompany(String name) { return mPrivateCompanies.get(name); } public PublicCompanyI getPublicCompany(String name) { return mPublicCompanies.get(name); } public List<PrivateCompanyI> getAllPrivateCompanies() { return lPrivateCompanies; } public List<PublicCompanyI> getAllPublicCompanies() { return lPublicCompanies; } public PublicCompanyI getCompanyByName(String name) { for (int i = 0; i < lPublicCompanies.size(); i++) { PublicCompany co = (PublicCompany) lPublicCompanies.get(i); if (name.equalsIgnoreCase(co.getName())) { return (PublicCompanyI) lPublicCompanies.get(i); } } return null; } public CompanyI getCompany(String type, String name) { if (mCompaniesByTypeAndName.containsKey(type)) { return (mCompaniesByTypeAndName.get(type)).get(name); } else { return null; } } /** @deprecated */ public List<PublicCompanyI> getCompaniesWithExcessTrains() { List<PublicCompanyI> list = new ArrayList<PublicCompanyI>(); int phaseIndex = PhaseManager.getInstance().getCurrentPhaseIndex(); for (PublicCompanyI comp : lPublicCompanies) { if (comp.getPortfolio().getNumberOfTrains() > comp.getTrainLimit(phaseIndex)) { list.add(comp); } } return list; } public void closeAllPrivates() { if (lPrivateCompanies == null) return; for (PrivateCompanyI priv : lPrivateCompanies) { priv.setClosed(); } } public List<PrivateCompanyI> getPrivatesOwnedByPlayers() { List<PrivateCompanyI> privatesOwnedByPlayers = new ArrayList<PrivateCompanyI>(); for (PrivateCompanyI priv : getAllPrivateCompanies()) { if (priv.getPortfolio().getOwner() instanceof Player) { privatesOwnedByPlayers.add(priv); } } return privatesOwnedByPlayers; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import org.apache.log4j.Logger; import rails.util.LocalText; import rails.util.Tag; public class CompanyManager implements CompanyManagerI, ConfigurableComponentI { /** A List with all private companies */ private List<PrivateCompanyI> lPrivateCompanies = new ArrayList<PrivateCompanyI>(); /** A List with all public companies */ private List<PublicCompanyI> lPublicCompanies = new ArrayList<PublicCompanyI>(); /** A map with all private companies by name */ private Map<String, PrivateCompanyI> mPrivateCompanies = new HashMap<String, PrivateCompanyI>(); /** A map with all public (i.e. non-private) companies by name */ private Map<String, PublicCompanyI> mPublicCompanies = new HashMap<String, PublicCompanyI>(); /** A map of all type names to maps of companies of that type by name */ // TODO Redundant, current usage can be replaced. private Map<String, HashMap<String, CompanyI>> mCompaniesByTypeAndName = new HashMap<String, HashMap<String, CompanyI>>(); /** A list of all start packets (usually one) */ // TODO Currently not used (but some newer games have more than one) private List<StartPacket> startPackets = new ArrayList<StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); /* * NOTES: 1. we don't have a map over all companies, because some games have * duplicate names, e.g. B&O in 1830. 2. we have both a map and a list of * private/public companies to preserve configuration sequence while * allowing direct access. */ /** * No-args constructor. */ public CompanyManager() { // Nothing to do here, everything happens when configured. } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { /** A map with all company types, by type name */ // Localised here as it has no permanent use Map<String, CompanyTypeI> mCompanyTypes = new HashMap<String, CompanyTypeI>(); for (Tag compTypeTag : tag.getChildren(CompanyTypeI.ELEMENT_ID)) { // Extract the attributes of the Component String name = compTypeTag.getAttributeAsString(CompanyTypeI.NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompanyType")); } String className = compTypeTag.getAttributeAsString(CompanyTypeI.CLASS_TAG); if (className == null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeHasNoClass", name)); } if (mCompanyTypes.get(name) != null) { throw new ConfigurationException(LocalText.getText( "CompanyTypeConfiguredTwice", name)); } CompanyTypeI companyType = new CompanyType(name, className); mCompanyTypes.put(name, companyType); // Further parsing is done within CompanyType companyType.configureFromXML(compTypeTag); } /* Read and configure the companies */ for (Tag companyTag : tag.getChildren(CompanyI.COMPANY_ELEMENT_ID)) { // Extract the attributes of the Component String name = companyTag.getAttributeAsString(CompanyI.COMPANY_NAME_TAG); if (name == null) { throw new ConfigurationException( LocalText.getText("UnnamedCompany")); } String type = companyTag.getAttributeAsString(CompanyI.COMPANY_TYPE_TAG); if (type == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasNoType", name)); } CompanyTypeI cType = mCompanyTypes.get(type); if (cType == null) { throw new ConfigurationException(LocalText.getText( "CompanyHasUnknownType", new String[] { name, type })); } try { CompanyI company = cType.createCompany(name, companyTag); /* Private or public */ if (company instanceof PrivateCompanyI) { mPrivateCompanies.put(name, (PrivateCompanyI) company); lPrivateCompanies.add((PrivateCompanyI) company); } else if (company instanceof PublicCompanyI) { ((PublicCompanyI)company).setIndex (numberOfPublicCompanies++); mPublicCompanies.put(name, (PublicCompanyI) company); lPublicCompanies.add((PublicCompanyI) company); } /* By type and name */ if (!mCompaniesByTypeAndName.containsKey(type)) mCompaniesByTypeAndName.put(type, new HashMap<String, CompanyI>()); ((Map<String, CompanyI>) mCompaniesByTypeAndName.get(type)).put( name, company); } catch (Exception e) { throw new ConfigurationException(LocalText.getText( "ClassCannotBeInstantiated", cType.getClassName()), e); } } /* Read and configure the start packets */ List<Tag> packetTags = tag.getChildren("StartPacket"); if (packetTags != null) { for (Tag packetTag : tag.getChildren("StartPacket")) { // Extract the attributes of the Component String name = packetTag.getAttributeAsString("name"); if (name == null) name = "Initial"; String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); sp.configureFromXML(packetTag); } } /* Read and configure additional rules */ /* This part may move later to a GameRules or GameManager XML */ Tag rulesTag = tag.getChild("StockRoundRules"); if (rulesTag != null) { for (String ruleTagName : rulesTag.getChildren().keySet()) { if (ruleTagName.equals("NoSaleInFirstSR")) { StockRound.setNoSaleInFirstSR(); } else if (ruleTagName.equals("NoSaleIfNotOperated")) { StockRound.setNoSaleIfNotOperated(); } } } } // Post XML parsing initialisations public void initCompanies() throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.init2(); } } /** * @see rails.game.CompanyManagerI#getCompany(java.lang.String) * */ public PrivateCompanyI getPrivateCompany(String name) { return mPrivateCompanies.get(name); } public PublicCompanyI getPublicCompany(String name) { return mPublicCompanies.get(name); } public List<PrivateCompanyI> getAllPrivateCompanies() { return lPrivateCompanies; } public List<PublicCompanyI> getAllPublicCompanies() { return lPublicCompanies; } public PublicCompanyI getCompanyByName(String name) { for (int i = 0; i < lPublicCompanies.size(); i++) { PublicCompany co = (PublicCompany) lPublicCompanies.get(i); if (name.equalsIgnoreCase(co.getName())) { return lPublicCompanies.get(i); } } return null; } public CompanyI getCompany(String type, String name) { if (mCompaniesByTypeAndName.containsKey(type)) { return (mCompaniesByTypeAndName.get(type)).get(name); } else { return null; } } public void closeAllPrivates() { if (lPrivateCompanies == null) return; for (PrivateCompanyI priv : lPrivateCompanies) { priv.setClosed(); } } public List<PrivateCompanyI> getPrivatesOwnedByPlayers() { List<PrivateCompanyI> privatesOwnedByPlayers = new ArrayList<PrivateCompanyI>(); for (PrivateCompanyI priv : getAllPrivateCompanies()) { if (priv.getPortfolio().getOwner() instanceof Player) { privatesOwnedByPlayers.add(priv); } } return privatesOwnedByPlayers; } } \ No newline at end of file Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** PublicCompany.java 29 Nov 2008 20:01:33 -0000 1.44 --- PublicCompany.java 3 Dec 2008 20:15:15 -0000 1.45 *************** *** 218,222 **** /** Initial train at floating time */ protected String initialTrain = null; ! /** * The constructor. The way this class is instantiated does not allow --- 218,222 ---- /** Initial train at floating time */ protected String initialTrain = null; ! /** * The constructor. The way this class is instantiated does not allow *************** *** 249,254 **** numberOfBaseTokens = tag.getAttributeAsInteger("tokens", 1); ! ! boolean certsAreInitiallyAvailable = tag.getAttributeAsBoolean("available", true); --- 249,254 ---- numberOfBaseTokens = tag.getAttributeAsInteger("tokens", 1); ! ! boolean certsAreInitiallyAvailable = tag.getAttributeAsBoolean("available", true); *************** *** 279,283 **** if (hex != null) { destinationHex = hex; ! hasReachedDestination = new BooleanState (name+"_reachedDestination", false); } else { throw new ConfigurationException("Invalid destination hex " --- 279,283 ---- if (hex != null) { destinationHex = hex; ! hasReachedDestination = new BooleanState (name+"_reachedDestination", false); } else { throw new ConfigurationException("Invalid destination hex " *************** *** 420,424 **** phaseMap.put(phases[k], lays); } - // phaseMap.put("turns", validForTurns); if (validForTurns > 0) { if (turnsWithExtraTileLaysInit == null) { --- 420,423 ---- *************** *** 449,455 **** "type", "")); int number = certificateTag.getAttributeAsInteger("number", 1); ! ! boolean certIsInitiallyAvailable ! = certificateTag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); --- 448,454 ---- "type", "")); int number = certificateTag.getAttributeAsInteger("number", 1); ! ! boolean certIsInitiallyAvailable ! = certificateTag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); *************** *** 527,530 **** --- 526,530 ---- /** Initialisation, to be called directly after instantiation (cloning) */ + @Override public void init(String name, CompanyTypeI type) { super.init(name, type); *************** *** 580,584 **** } ! public void setIndex (int index) { publicNumber = index; --- 580,584 ---- } ! public void setIndex (int index) { publicNumber = index; *************** *** 629,633 **** /** * Return the company token background colour. ! * * @return Color object */ --- 629,633 ---- /** * Return the company token background colour. ! * * @return Color object */ *************** *** 638,642 **** /** * Return the company token background colour. ! * * @return Hexadecimal string RRGGBB. */ --- 638,642 ---- /** * Return the company token background colour. ! * * @return Hexadecimal string RRGGBB. */ *************** *** 647,651 **** /** * Return the company token foreground colour. ! * * @return Color object. */ --- 647,651 ---- /** * Return the company token foreground colour. ! * * @return Color object. */ *************** *** 656,660 **** /** * Return the company token foreground colour. ! * * @return Hexadecimal string RRGGBB. */ --- 656,660 ---- /** * Return the company token foreground colour. ! * * @return Hexadecimal string RRGGBB. */ *************** *** 697,710 **** return destinationHex; } ! public boolean hasDestination () { return destinationHex != null; } ! public boolean hasReachedDestination() { return hasReachedDestination != null && hasReachedDestination.booleanValue(); } ! public void setReachedDestination (boolean value) { hasReachedDestination.set(value); --- 697,710 ---- return destinationHex; } ! public boolean hasDestination () { return destinationHex != null; } ! public boolean hasReachedDestination() { return hasReachedDestination != null && hasReachedDestination.booleanValue(); } ! public void setReachedDestination (boolean value) { hasReachedDestination.set(value); *************** *** 811,815 **** /** * Has the company already floated? ! * * @return true if the company has floated. */ --- 811,815 ---- /** * Has the company already floated? ! * * @return true if the company has floated. */ *************** *** 820,824 **** /** * Has the company already operated? ! * * @return true if the company has operated. */ --- 820,824 ---- /** * Has the company already operated? ! * * @return true if the company has operated. */ *************** *** 849,853 **** * used to start a company!</i> Use <code><b>start()</b></code> in * stead. ! * * @param spaceI */ --- 849,853 ---- * used to start a company!</i> Use <code><b>start()</b></code> in * stead. ! * * @param spaceI */ *************** *** 862,866 **** /** * Get the company par (initial) price. ! * * @return StockSpace object, which defines the company start position on * the stock chart. --- 862,866 ---- /** * Get the company par (initial) price. ! * * @return StockSpace object, which defines the company start position on * the stock chart. *************** *** 873,877 **** } } ! public int getIPOPrice () { if (hasParPrice) { --- 873,877 ---- } } ! public int getIPOPrice () { if (hasParPrice) { *************** *** 885,889 **** } } ! public int getMarketPrice () { if (getCurrentSpace() != null) { --- 885,889 ---- } } ! public int getMarketPrice () { if (getCurrentSpace() != null) { *************** *** 896,900 **** /** * Set a new company price. ! * * @param price The StockSpace object that defines the new location on the * stock market. --- 896,900 ---- /** * Set a new company price. ! * * @param price The StockSpace object that defines the new location on the * stock market. *************** *** 919,923 **** /** * Get the current company share price. ! * * @return The StockSpace object that defines the current location on the * stock market. --- 919,923 ---- /** * Get the current company share price. ! * * @return The StockSpace object that defines the current location on the * stock market. *************** *** 929,933 **** /** * Add a given amount to the company treasury. ! * * @param amount The amount to add (may be negative). */ --- 929,933 ---- /** * Add a given amount to the company treasury. ! * * @param amount The amount to add (may be negative). */ *************** *** 938,942 **** /** * Get the current company treasury. ! * * @return The current cash amount. */ --- 938,942 ---- /** * Get the current company treasury. ! * * @return The current cash amount. */ *************** *** 962,966 **** /** * Get a list of this company's certificates. ! * * @return ArrayList containing the certificates (item 0 is the President's * share). --- 962,966 ---- /** * Get a list of this company's certificates. ! * * @return ArrayList containing the certificates (item 0 is the President's * share). *************** *** 973,977 **** * Assign a predefined list of certificates to this company. The list is * deep cloned. ! * * @param list ArrayList containing the certificates. */ --- 973,977 ---- * Assign a predefined list of certificates to this company. The list is * deep cloned. ! * * @param list ArrayList containing the certificates. */ *************** *** 984,990 **** } } ! ! /** ! * Backlink the certificates to this company, * and give each one a type name. * --- 984,990 ---- } } ! ! /** ! * Backlink the certificates to this company, * and give each one a type name. * *************** *** 998,1002 **** /** * Add a certificate to the end of this company's list of certificates. ! * * @param certificate The certificate to add. */ --- 998,1002 ---- /** * Add a certificate to the end of this company's list of certificates. ! * * @param certificate The certificate to add. */ *************** *** 1010,1014 **** * Get the Portfolio of this company, containing all privates and * certificates owned.. ! * * @return The Portfolio of this company. */ --- 1010,1014 ---- * Get the Portfolio of this company, containing all privates and * certificates owned.. ! * * @return The Portfolio of this company. */ *************** *** 1019,1023 **** /** * Get the percentage of shares that must be sold to float the company. ! * * @return The float percentage. */ --- 1019,1023 ---- /** * Get the percentage of shares that must be sold to float the company. ! * * @return The float percentage. */ *************** *** 1028,1032 **** /** * Get the company President. ! * */ public Player getPresident() { --- 1028,1032 ---- /** * Get the company President. ! * */ public Player getPresident() { *************** *** 1037,1041 **** return null; } ! public PublicCertificateI getPresidentsShare () { return certificates.get(0); --- 1037,1041 ---- return null; } ! public PublicCertificateI getPresidentsShare () { return certificates.get(0); *************** *** 1050,1054 **** /** * Store the last revenue earned by this company. ! * * @param i The last revenue amount. */ --- 1050,1054 ---- /** * Store the last revenue earned by this company. ! * * @param i The last revenue amount. */ *************** *** 1059,1063 **** /** * Get the last revenue earned by this company. ! * * @return The last revenue amount. */ --- 1059,1063 ---- /** * Get the last revenue earned by this company. ! * * @return The last revenue amount. */ *************** *** 1088,1092 **** /** Split a dividend. TODO Optional rounding down the payout ! * * @param amount */ --- 1088,1092 ---- /** Split a dividend. TODO Optional rounding down the payout ! * * @param amount */ *************** *** 1110,1114 **** /** * Distribute the dividend amongst the shareholders. ! * * @param amount */ --- 1110,1114 ---- /** * Distribute the dividend amongst the shareholders. ! * * @param amount */ *************** *** 1161,1165 **** /** * Withhold a given amount of revenue (and store it). ! * * @param The revenue amount. */ --- 1161,1165 ---- /** * Withhold a given amount of revenue (and store it). ! * * @param The revenue amount. */ *************** *** 1175,1179 **** * (jan 2008) interpreted as: no share is owned either by the Bank or by the * company's own Treasury. ! * * @return true if the share price can move up. */ --- 1175,1179 ---- * (jan 2008) interpreted as: no share is owned either by the Bank or by the * company's own Treasury. ! * * @return true if the share price can move up. */ *************** *** 1199,1203 **** /** * Get the unit of share. ! * * @return The percentage of ownership that is called "one share". */ --- 1199,1203 ---- /** * Get the unit of share. ! * * @return The percentage of ownership that is called "one share". */ *************** *** 1271,1275 **** /** * Check if the presidency has changed for a <b>buying</b> player. ! * * @param buyer Player who has just bought a certificate. */ --- 1271,1275 ---- /** * Check if the presidency has changed for a <b>buying</b> player. ! * * @param buyer Player who has just bought a certificate. */ *************** *** 1417,1421 **** * "sequence" method. The other token layong costing methods will be * implemented later. ! * * @param index The sequence number of the token that the company is laying. * @return The cost of laying that token. --- 1417,1421 ---- * "sequence" method. The other token layong costing methods will be * implemented later. ! * * @param index The sequence number of the token that the company is laying. * @return The cost of laying that token. Index: RoundI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/RoundI.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RoundI.java 30 Jun 2008 20:35:29 -0000 1.7 --- RoundI.java 3 Dec 2008 20:15:15 -0000 1.8 *************** *** 2,9 **** package rails.game; - import java.util.List; - import rails.game.action.PossibleAction; - import rails.game.special.SpecialPropertyI; /** --- 2,6 ---- *************** *** 26,32 **** public String getHelp(); - /** @deprecated */ - public List<SpecialPropertyI> getSpecialProperties(); - public boolean process(PossibleAction action); --- 23,26 ---- Index: Company.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Company.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Company.java 4 Jun 2008 19:00:30 -0000 1.8 --- Company.java 3 Dec 2008 20:15:15 -0000 1.9 *************** *** 28,32 **** protected int certLimitCount = 2; - // protected boolean closed = false; protected BooleanState closedObject; --- 28,31 ---- *************** *** 145,149 **** * Stub method implemented to comply with TokenHolderI interface. Always * returns false. ! * * Use addToken(MapHex hex) method instead. */ --- 144,148 ---- * Stub method implemented to comply with TokenHolderI interface. Always * returns false. ! * * Use addToken(MapHex hex) method instead. */ Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** PublicCompanyI.java 20 Nov 2008 21:49:38 -0000 1.25 --- PublicCompanyI.java 3 Dec 2008 20:15:15 -0000 1.26 *************** *** 247,252 **** public boolean hasParPrice(); - // public int percentageOwnedByPlayers(); - public boolean isSplitAllowed(); --- 247,250 ---- *************** *** 257,269 **** public void checkPresidencyOnBuy(Player buyer); - /** - * Only usable if the float percentage is fixed. Games where the percentage - * varies must check this in StockRound and possibly StartRound. - */ - // public boolean checkFlotation(boolean moveCash); - /** @deprecated */ - @Deprecated - public int percentageOwnedByPlayers(); - public int getCapitalisation(); --- 255,258 ---- *************** *** 274,278 **** public int getCurrentTrainLimit(); - // public boolean mayBuyTrains (); public int getNumberOfTrains(); --- 263,266 ---- Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** OperatingRound.java 29 Nov 2008 20:01:33 -0000 1.45 --- OperatingRound.java 3 Dec 2008 20:15:15 -0000 1.46 *************** *** 111,115 **** /** * The constructor. ! * * @param operate If false, only the privates pay out. This applies if the * Start Packet has not yet been sold completely. --- 111,115 ---- /** * The constructor. ! * * @param operate If false, only the privates pay out. This applies if the * Start Packet has not yet been sold completely. *************** *** 204,210 **** result = buyPrivate((BuyPrivate) selectedAction); ! } else if (selectedAction instanceof ReachDestinations) { ! result = reachDestinations ((ReachDestinations) selectedAction); --- 204,210 ---- result = buyPrivate((BuyPrivate) selectedAction); ! } else if (selectedAction instanceof ReachDestinations) { ! result = reachDestinations ((ReachDestinations) selectedAction); *************** *** 360,364 **** if (tile != null) { ! if (cost > 0) new CashMove(operatingCompany, null, cost); operatingCompany.layTile(hex, tile, orientation, cost); --- 360,364 ---- if (tile != null) { ! if (cost > 0) new CashMove(operatingCompany, null, cost); operatingCompany.layTile(hex, tile, orientation, cost); *************** *** 765,769 **** * Internal method: change the OR state to the next step. If the currently * Operating Company is done, notify this. ! * * @param company The current company. */ --- 765,769 ---- * Internal method: change the OR state to the next step. If the currently * Operating Company is done, notify this. ! * * @param company The current company. */ *************** *** 919,923 **** /* Special-property tile lays */ currentSpecialTileLays.clear(); - // specialPropertyPerHex.clear(); /* * In 1835, this only applies to major companies. TODO: For now, --- 919,922 ---- *************** *** 959,963 **** /* Special-property tile lays */ currentSpecialTokenLays.clear(); ! /* * In 1835, this only applies to major companies. TODO: For now, --- 958,962 ---- /* Special-property tile lays */ currentSpecialTokenLays.clear(); ! /* * In 1835, this only applies to major companies. TODO: For now, *************** *** 1013,1017 **** /** * The current Company is done operating. ! * * @param company Name of the company that finished operating. * @return False if an error is found. --- 1012,1016 ---- /** * The current Company is done operating. ! * * @param company Name of the company that finished operating. * @return False if an error is found. *************** *** 1064,1068 **** priv.checkClosingIfExercised(true); } ! if (setNextOperatingCompany(false)) { --- 1063,1067 ---- priv.checkClosingIfExercised(true); } ! if (setNextOperatingCompany(false)) { *************** *** 1072,1079 **** } } ! protected boolean setNextOperatingCompany(boolean initial) { ! ! if (operatingCompanyIndexObject == null) { operatingCompanyIndexObject = --- 1071,1078 ---- } } ! protected boolean setNextOperatingCompany(boolean initial) { ! ! if (operatingCompanyIndexObject == null) { operatingCompanyIndexObject = *************** *** 1085,1091 **** operatingCompanyIndexObject.add(1); } ! operatingCompanyIndex = operatingCompanyIndexObject.intValue(); ! if (operatingCompanyIndex >= operatingCompanyArray.length) { return false; --- 1084,1090 ---- operatingCompanyIndexObject.add(1); } ! operatingCompanyIndex = operatingCompanyIndexObject.intValue(); ! if (operatingCompanyIndex >= operatingCompanyArray.length) { return false; *************** *** 1103,1107 **** priv.checkClosingIfExercised(true); } ! // OR done. Inform GameManager. ReportBuffer.add(LocalText.getText("EndOfOperatingRound", thisOrNumber)); --- 1102,1106 ---- priv.checkClosingIfExercised(true); } ! // OR done. Inform GameManager. ReportBuffer.add(LocalText.getText("EndOfOperatingRound", thisOrNumber)); *************** *** 1455,1466 **** } ! public boolean reachDestinations (ReachDestinations action) { ! List<PublicCompanyI> destinedCompanies = action.getReachedCompanies(); if (destinedCompanies != null) { for (PublicCompanyI company : destinedCompanies) { ! if (company.hasDestination() && !company.hasReachedDestination()) { if (!MoveSet.isOpen()) MoveSet.start(true); --- 1454,1465 ---- } ! public boolean reachDestinations (ReachDestinations action) { ! List<PublicCompanyI> destinedCompanies = action.getReachedCompanies(); if (destinedCompanies != null) { for (PublicCompanyI company : destinedCompanies) { ! if (company.hasDestination() && !company.hasReachedDestination()) { if (!MoveSet.isOpen()) MoveSet.start(true); *************** *** 1478,1489 **** return true; } ! /** Stub for applying any follow-up actions when ! * a company reaches it destinations. * Default version: no actions. * @param company */ protected void reachDestination (PublicCompanyI company) { ! } --- 1477,1488 ---- return true; } ! /** Stub for applying any follow-up actions when ! * a company reaches it destinations. * Default version: no actions. * @param company */ protected void reachDestination (PublicCompanyI company) { ! } *************** *** 1492,1496 **** /** * Get the public company that has the turn to operate. ! * * @return The currently operating company object. */ --- 1491,1495 ---- /** * Get the public company that has the turn to operate. ! * * @return The currently operating company object. */ *************** *** 1506,1510 **** /** * Get the current operating round step (i.e. the next action). ! * * @return The number that defines the next action. */ --- 1505,1509 ---- /** * Get the current operating round step (i.e. the next action). ! * * @return The number that defines the next action. */ *************** *** 1517,1521 **** * should only be done for specific rails.game exceptions, such as forced * train purchases. ! * * @param step */ --- 1516,1520 ---- * should only be done for specific rails.game exceptions, such as forced * train purchases. ! * * @param step */ *************** *** 1539,1543 **** * actions. (new method, intended to absorb code from several other * methods). ! * */ @Override --- 1538,1542 ---- * actions. (new method, intended to absorb code from several other * methods). ! * */ @Override *************** *** 1597,1601 **** setBonusTokenLays(); ! setDestinationActions(); --- 1596,1600 ---- setBonusTokenLays(); ! setDestinationActions(); *************** *** 1644,1648 **** * trains that the company has no money for. If there is no cash to buy any * train from the Bank, prepare for emergency train buying. ! * * @return List of all trains that could potentially be bought. */ --- 1643,1647 ---- * trains that the company has no money for. If there is no cash to buy any * train from the Bank, prepare for emergency train buying. ! * * @return List of all trains that could potentially be bought. */ *************** *** 1799,1803 **** * Returns whether or not the company is allowed to buy a train, considering * its train limit. ! * * @return */ --- 1798,1802 ---- * Returns whether or not the company is allowed to buy a train, considering * its train limit. ! * * @return */ *************** *** 1829,1841 **** } } ! ! /** * This is currently a stub, as it is unclear if there is a common * rule for setting destination reaching options. * See OperatingRound_1856 for a first implementation ! * of such rules. */ protected void setDestinationActions () { ! } --- 1828,1840 ---- } } ! ! /** * This is currently a stub, as it is unclear if there is a common * rule for setting destination reaching options. * See OperatingRound_1856 for a first implementation ! * of such rules. */ protected void setDestinationActions () { ! } Index: CompanyManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/CompanyManagerI.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CompanyManagerI.java 4 Jun 2008 19:00:32 -0000 1.9 --- CompanyManagerI.java 3 Dec 2008 20:15:15 -0000 1.10 *************** *** 18,22 **** /** * Returns the Private Company identified by the supplied name. ! * * @param name the name of the company sought * @return the Private Company with the supplied name --- 18,22 ---- /** * Returns the Private Company identified by the supplied name. ! * * @param name the name of the company sought * @return the Private Company with the supplied name *************** *** 26,30 **** /** * Returns the Public Company identified by the supplied name. ! * * @param name the name of the company sought * @return the Public Company with the supplied name --- 26,30 ---- /** * Returns the Public Company identified by the supplied name. ! * * @param name the name of the company sought * @return the Public Company with the supplied name *************** *** 34,38 **** /** * Gives a list of all the registered Private Companies. ! * * @return a list of all the registered Private Companies */ --- 34,38 ---- /** * Gives a list of all the registered Private Companies. ! * * @return a list of all the registered Private Companies */ *************** *** 41,45 **** /** * Gives a list of all the registered Private Companies. ! * * @return a list of all the registered Private Companies */ --- 41,45 ---- /** * Gives a list of all the registered Private Companies. ! * * @return a list of all the registered Private Companies */ *************** *** 48,52 **** /** * Find a company by type and name ! * * @param type The name of the CompanyType * @param name The name of the Company --- 48,52 ---- /** * Find a company by type and name ! * * @param type The name of the CompanyType * @param name The name of the Company *************** *** 60,65 **** public void initCompanies() throws ConfigurationException; - public List<PublicCompanyI> getCompaniesWithExcessTrains(); - public void closeAllPrivates(); --- 60,63 ---- Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Phase.java 3 Nov 2008 15:55:00 -0000 1.9 --- Phase.java 3 Dec 2008 20:15:14 -0000 1.10 *************** *** 2,14 **** package rails.game; ! import java.util.ArrayList; ! import java.util.HashMap; ! import java.util.List; ! import java.util.Map; ! ! import rails.util.Tag; import org.apache.log4j.Logger; public class Phase implements PhaseI { --- 2,11 ---- package rails.game; ! import java.util.*; import org.apache.log4j.Logger; + import rails.util.Tag; + public class Phase implements PhaseI { *************** *** 42,46 **** /** Items to close if a phase gets activated */ protected List<Closeable> closedObjects = null; ! /** A HashMap to contain phase-dependent parameters * by name and value. --- 39,43 ---- /** Items to close if a phase gets activated */ protected List<Closeable> closedObjects = null; ! /** A HashMap to contain phase-dependent parameters * by name and value. *************** *** 48,56 **** protected Map<String, String> parameters = null; - // protected static boolean previousPrivateSellingAllowed = false; - // protected static int previousNumberOfOperatingRounds = 1; - // protected static String previousTileColours = ""; - // protected static int previousOffBoardRevenueStep = 1; - protected static Logger log = Logger.getLogger(Phase.class.getPackage().getName()); --- 45,48 ---- *************** *** 130,134 **** oneTrainPerTypePerTurn); } ! Tag parameterTag = tag.getChild("Parameters"); if (parameterTag != null) { --- 122,126 ---- oneTrainPerTypePerTurn); } ! Tag parameterTag = tag.getChild("Parameters"); if (parameterTag != null) { *************** *** 211,215 **** closedObjects.add(object); } ! public String getParameterAsString (String key) { if (parameters != null) { --- 203,207 ---- closedObjects.add(object); } ! public String getParameterAsString (String key) { if (parameters != null) { *************** *** 219,223 **** } } ! public int getParameterAsInteger (String key) { String stringValue = getParameterAsString(key); --- 211,215 ---- } } ! public int getParameterAsInteger (String key) { String stringValue = getParameterAsString(key); *************** *** 234,237 **** --- 226,230 ---- } + @Override public String toString() { return name; |
From: Erik V. <ev...@us...> - 2008-12-03 20:15:23
|
Update of /cvsroot/rails/18xx/rails/game/action In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4937/rails/game/action Modified Files: StartItemAction.java BidStartItem.java LayTile.java BuyStartItem.java Log Message: Cleanups Index: BuyStartItem.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BuyStartItem.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BuyStartItem.java 2 Dec 2008 20:29:15 -0000 1.3 --- BuyStartItem.java 3 Dec 2008 20:15:15 -0000 1.4 *************** *** 77,84 **** } - public int getStatus() { - return startItem.getStatus(); - } - public boolean equals(PossibleAction action) { if (!(action instanceof BuyStartItem)) return false; --- 77,80 ---- Index: StartItemAction.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/StartItemAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StartItemAction.java 4 Jun 2008 19:00:29 -0000 1.3 --- StartItemAction.java 3 Dec 2008 20:15:15 -0000 1.4 *************** *** 45,52 **** } - /** @deprecated */ - @Deprecated public int getStatus() { - // if (startItem == null) return 0;//BAD return startItem.getStatus(); } --- 45,49 ---- Index: LayTile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/LayTile.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** LayTile.java 2 Dec 2008 20:29:15 -0000 1.14 --- LayTile.java 3 Dec 2008 20:15:15 -0000 1.15 *************** *** 177,192 **** } - /** - * @deprecated - * @return Returns the location. - */ - public MapHex getLocation() { - if (locations != null) { - return locations.get(0); - } else { - return null; - } - } - public List<MapHex> getLocations() { return locations; --- 177,180 ---- Index: BidStartItem.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BidStartItem.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BidStartItem.java 2 Dec 2008 20:29:15 -0000 1.3 --- BidStartItem.java 3 Dec 2008 20:15:15 -0000 1.4 *************** *** 69,76 **** } - public int getStatus() { - return startItem.getStatus(); - } - public boolean equals(PossibleAction action) { if (!(action instanceof BidStartItem)) return false; --- 69,72 ---- |
From: Erik V. <ev...@us...> - 2008-12-02 20:29:25
|
Update of /cvsroot/rails/18xx/rails/game/action In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1478/rails/game/action Modified Files: ReachDestinations.java BidStartItem.java LayTile.java BuyStartItem.java Log Message: Cleanups Index: BuyStartItem.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BuyStartItem.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BuyStartItem.java 4 Jun 2008 19:00:29 -0000 1.2 --- BuyStartItem.java 2 Dec 2008 20:29:15 -0000 1.3 *************** *** 77,83 **** } - /** @deprecated */ public int getStatus() { - // if (startItem == null) return 0;//BAD return startItem.getStatus(); } --- 77,81 ---- Index: LayTile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/LayTile.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LayTile.java 29 Nov 2008 20:01:33 -0000 1.13 --- LayTile.java 2 Dec 2008 20:29:15 -0000 1.14 *************** *** 8,19 **** import java.io.IOException; import java.io.ObjectInputStream; - import java.io.ObjectInputStream.GetField; import java.util.*; - import rails.game.City; - import rails.game.Company; import rails.game.MapHex; import rails.game.MapManager; - import rails.game.PublicCompanyI; import rails.game.TileI; import rails.game.TileManager; --- 8,15 ---- Index: BidStartItem.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/BidStartItem.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BidStartItem.java 4 Jun 2008 19:00:29 -0000 1.2 --- BidStartItem.java 2 Dec 2008 20:29:15 -0000 1.3 *************** *** 69,75 **** } - /** @deprecated */ public int getStatus() { - // if (startItem == null) return 0;//BAD return startItem.getStatus(); } --- 69,73 ---- Index: ReachDestinations.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/ReachDestinations.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReachDestinations.java 20 Nov 2008 21:49:38 -0000 1.1 --- ReachDestinations.java 2 Dec 2008 20:29:15 -0000 1.2 *************** *** 8,13 **** import rails.game.CompanyManagerI; import rails.game.Game; - import rails.game.MapHex; - import rails.game.MapManager; import rails.game.PublicCompanyI; --- 8,11 ---- *************** *** 89,93 **** CompanyManagerI cmgr = Game.getCompanyManager(); - MapManager mmgr = MapManager.getInstance(); possibleCompanies = new ArrayList<PublicCompanyI>(); --- 87,90 ---- |
From: Erik V. <ev...@us...> - 2008-12-02 20:29:25
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1478/rails/game/specific/_1856 Modified Files: StockRound_1856.java Log Message: Cleanups Index: StockRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/StockRound_1856.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StockRound_1856.java 20 Nov 2008 21:49:38 -0000 1.3 --- StockRound_1856.java 2 Dec 2008 20:29:15 -0000 1.4 *************** *** 9,13 **** import rails.game.ReportBuffer; import rails.game.StockRound; - import rails.game.move.CashMove; import rails.util.LocalText; --- 9,12 ---- |
From: Erik V. <ev...@us...> - 2008-12-02 20:29:23
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1478/rails/game Modified Files: TreasuryShareRound.java ShareSellingRound.java Log Message: Cleanups Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TreasuryShareRound.java 20 Nov 2008 21:49:38 -0000 1.8 --- TreasuryShareRound.java 2 Dec 2008 20:29:15 -0000 1.9 *************** *** 101,105 **** PublicCertificateI cert; PublicCompanyI comp; - StockSpaceI stockSpace; Portfolio from; int price; --- 101,104 ---- *************** *** 331,338 **** } - StockSpaceI currentSpace; - // TODO NEVER A PAR PRICE ? - //currentSpace = company.getCurrentSpace(); - price = company.getMarketPrice(); --- 330,333 ---- Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ShareSellingRound.java 20 Nov 2008 21:49:38 -0000 1.15 --- ShareSellingRound.java 2 Dec 2008 20:29:15 -0000 1.16 *************** *** 27,30 **** --- 27,31 ---- this.gameManager = gameManager; + this.companyManager = gameManager.getCompanyManager(); this.companyNeedingTrain = compNeedingTrain; this.cashToRaise = new IntegerState("CashToRaise", cashToRaise); |
From: Erik V. <ev...@us...> - 2008-12-02 20:29:23
|
Update of /cvsroot/rails/18xx/rails/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1478/rails/util Modified Files: Tag.java Log Message: Cleanups Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Tag.java 4 Jun 2008 19:00:39 -0000 1.6 --- Tag.java 2 Dec 2008 20:29:15 -0000 1.7 *************** *** 344,348 **** /** * @deprecated This is a stop-gap, needed until all XML parsing code has ! * been converted to use Tag. * @return */ --- 344,349 ---- /** * @deprecated This is a stop-gap, needed until all XML parsing code has ! * been converted to use Tag. This method is now only called from ! * some external utilities. * @return */ |