Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv382/rails/game Modified Files: Bank.java Bonus.java BonusToken.java City.java CompanyManager.java ComponentManager.java DisplayBuffer.java Game.java GameDef.java GameManager.java GameManagerI.java MapHex.java MapManager.java OperatingRound.java Phase.java PhaseManager.java Player.java Portfolio.java PrivateCompany.java PublicCertificate.java PublicCompany.java PublicCompanyI.java ReportBuffer.java Round.java ShareSellingRound.java StartItem.java StartRound.java StartRound_1830.java StartRound_1835.java StockMarket.java StockRound.java StockSpace.java Tile.java TrainManager.java TrainType.java TrainTypeI.java TreasuryShareRound.java Log Message: Fix indentation: Java files contain 4 spaces, not tabs Index: Bank.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bank.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Bank.java 15 Jan 2010 19:55:55 -0000 1.18 --- Bank.java 31 Jan 2010 22:22:27 -0000 1.19 *************** *** 194,201 **** public static String format(int amount) { ! // Replace @ with the amount ! String result = instance.moneyFormat.replaceFirst("@", String.valueOf(amount)); ! // Move any minus to the front ! if (amount < 0) result = result.replaceFirst("(.+)-", "-$1"); return result; } --- 194,201 ---- public static String format(int amount) { ! // Replace @ with the amount ! String result = instance.moneyFormat.replaceFirst("@", String.valueOf(amount)); ! // Move any minus to the front ! if (amount < 0) result = result.replaceFirst("(.+)-", "-$1"); return result; } Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** PublicCompany.java 22 Jan 2010 21:23:43 -0000 1.78 --- PublicCompany.java 31 Jan 2010 22:22:28 -0000 1.79 *************** *** 551,557 **** Tag optionsTag = tag.getChild("Options"); if (optionsTag != null) { ! mustTradeTrainsAtFixedPrice = optionsTag.getAttributeAsBoolean ! ("mustTradeTrainsAtFixedPrice", mustTradeTrainsAtFixedPrice); ! canClose = optionsTag.getAttributeAsBoolean("canClose", canClose); } } --- 551,557 ---- Tag optionsTag = tag.getChild("Options"); if (optionsTag != null) { ! mustTradeTrainsAtFixedPrice = optionsTag.getAttributeAsBoolean ! ("mustTradeTrainsAtFixedPrice", mustTradeTrainsAtFixedPrice); ! canClose = optionsTag.getAttributeAsBoolean("canClose", canClose); } } *************** *** 655,659 **** cert.setUniqueId(name, i); cert.setInitiallyAvailable(cert.isInitiallyAvailable() ! && this.certsAreInitiallyAvailable); } --- 655,659 ---- cert.setUniqueId(name, i); cert.setInitiallyAvailable(cert.isInitiallyAvailable() ! && this.certsAreInitiallyAvailable); } *************** *** 916,920 **** for (PublicCertificateI cert : certificates) { if (cert.getHolder() != scrapHeap) { ! cert.moveTo(scrapHeap); } } --- 916,920 ---- for (PublicCertificateI cert : certificates) { if (cert.getHolder() != scrapHeap) { ! cert.moveTo(scrapHeap); } } *************** *** 1086,1090 **** certificates = new ArrayList<PublicCertificateI>(); for (PublicCertificateI cert : list) { ! certificates.add(new PublicCertificate(cert)); } } --- 1086,1090 ---- certificates = new ArrayList<PublicCertificateI>(); for (PublicCertificateI cert : list) { ! certificates.add(new PublicCertificate(cert)); } } *************** *** 1236,1241 **** sharesPerRecipient.put(recipient, cert.getShares()); } else { ! sharesPerRecipient.put(recipient, ! sharesPerRecipient.get(recipient) + cert.getShares()); } } --- 1236,1241 ---- sharesPerRecipient.put(recipient, cert.getShares()); } else { ! sharesPerRecipient.put(recipient, ! sharesPerRecipient.get(recipient) + cert.getShares()); } } *************** *** 1247,1254 **** part = (int) Math.ceil(amount * shares * shareUnit.intValue() / 100.0); ReportBuffer.add(LocalText.getText("Payout", ! recipient.getName(), ! Bank.format(part), ! shares, ! shareUnit.intValue())); new CashMove(bank, recipient, part); } --- 1247,1254 ---- part = (int) Math.ceil(amount * shares * shareUnit.intValue() / 100.0); ReportBuffer.add(LocalText.getText("Payout", ! recipient.getName(), ! Bank.format(part), ! shares, ! shareUnit.intValue())); new CashMove(bank, recipient, part); } *************** *** 1490,1494 **** public void buyTrain(TrainI train, int price) { if (train.getOwner() instanceof PublicCompanyI) { ! ((MoneyModel)((PublicCompanyI)train.getOwner()).getTrainsSpentThisTurnModel()).add(-price); } portfolio.buyTrain(train, price); --- 1490,1494 ---- public void buyTrain(TrainI train, int price) { if (train.getOwner() instanceof PublicCompanyI) { ! ((MoneyModel)((PublicCompanyI)train.getOwner()).getTrainsSpentThisTurnModel()).add(-price); } portfolio.buyTrain(train, price); *************** *** 1531,1546 **** new ArrayList<SpecialPropertyI>(2); List<SpecialPropertyI> spsToMoveToGM = ! new ArrayList<SpecialPropertyI>(2); for (SpecialPropertyI sp : sps) { if (sp.getTransferText().equalsIgnoreCase("toCompany")) { spsToMoveHere.add(sp); } else if (sp.getTransferText().equalsIgnoreCase("toGameManager")) { ! // This must be SellBonusToken - remember the owner! ! if (sp instanceof SellBonusToken) { ! ((SellBonusToken)sp).setSeller(this); // Also note 1 has been used ((SellBonusToken)sp).setExercised(); ! } ! spsToMoveToGM.add(sp); } } --- 1531,1546 ---- new ArrayList<SpecialPropertyI>(2); List<SpecialPropertyI> spsToMoveToGM = ! new ArrayList<SpecialPropertyI>(2); for (SpecialPropertyI sp : sps) { if (sp.getTransferText().equalsIgnoreCase("toCompany")) { spsToMoveHere.add(sp); } else if (sp.getTransferText().equalsIgnoreCase("toGameManager")) { ! // This must be SellBonusToken - remember the owner! ! if (sp instanceof SellBonusToken) { ! ((SellBonusToken)sp).setSeller(this); // Also note 1 has been used ((SellBonusToken)sp).setExercised(); ! } ! spsToMoveToGM.add(sp); } } *************** *** 1624,1631 **** public boolean addBonus(Bonus bonus) { ! if (bonuses == null) { ! bonuses = new ArrayList<Bonus>(2); bonusValue.set(bonuses); ! } new AddToList<Bonus> (bonuses, bonus, name+"_Bonuses", bonusValue); return true; --- 1624,1631 ---- public boolean addBonus(Bonus bonus) { ! if (bonuses == null) { ! bonuses = new ArrayList<Bonus>(2); bonusValue.set(bonuses); ! } new AddToList<Bonus> (bonuses, bonus, name+"_Bonuses", bonusValue); return true; *************** *** 1633,1654 **** public boolean removeBonus(Bonus bonus) { ! new RemoveFromList<Bonus> (bonuses, bonus, name+"_Bonuses", bonusValue); return true; } public boolean removeBonus (String name) { ! if (bonuses != null && !bonuses.isEmpty()) { ! for(Bonus bonus : bonuses) { ! if (bonus.getName().equals(name)) return removeBonus(bonus); ! } ! } ! return false; } public List<Bonus> getBonuses() { ! return bonuses; ! } ! public BonusModel getBonusTokensModel() { return bonusValue; } --- 1633,1654 ---- public boolean removeBonus(Bonus bonus) { ! new RemoveFromList<Bonus> (bonuses, bonus, name+"_Bonuses", bonusValue); return true; } public boolean removeBonus (String name) { ! if (bonuses != null && !bonuses.isEmpty()) { ! for(Bonus bonus : bonuses) { ! if (bonus.getName().equals(name)) return removeBonus(bonus); ! } ! } ! return false; } public List<Bonus> getBonuses() { ! return bonuses; ! } ! public BonusModel getBonusTokensModel() { return bonusValue; } *************** *** 1782,1786 **** public boolean mustTradeTrainsAtFixedPrice() { ! return mustTradeTrainsAtFixedPrice; } --- 1782,1786 ---- public boolean mustTradeTrainsAtFixedPrice() { ! return mustTradeTrainsAtFixedPrice; } *************** *** 1823,1830 **** public boolean canClose() { ! return canClose; ! } ! @Override public Object clone() { --- 1823,1830 ---- public boolean canClose() { ! return canClose; ! } ! @Override public Object clone() { *************** *** 1848,1855 **** } ! /** Extra codes to be added to the president's indicator in the Game Status window. ! * Normally nothing (see 1856 CGR for an exception). */ ! public String getExtraShareMarks () { ! return ""; ! } } --- 1848,1855 ---- } ! /** Extra codes to be added to the president's indicator in the Game Status window. ! * Normally nothing (see 1856 CGR for an exception). */ ! public String getExtraShareMarks () { ! return ""; ! } } Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** StartRound.java 14 Jan 2010 20:59:03 -0000 1.34 --- StartRound.java 31 Jan 2010 22:22:28 -0000 1.35 *************** *** 307,315 **** @Override ! protected void finishRound() { ! super.finishRound(); } ! /*----- Setting up the UI for the next action -----*/ /** --- 307,315 ---- @Override ! protected void finishRound() { ! super.finishRound(); } ! /*----- Setting up the UI for the next action -----*/ /** Index: Player.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Player.java 5 Jan 2010 20:55:32 -0000 1.23 --- Player.java 31 Jan 2010 22:22:28 -0000 1.24 *************** *** 98,102 **** public void updateWorth () { ! worth.update(); } --- 98,102 ---- public void updateWorth () { ! worth.update(); } Index: GameDef.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameDef.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GameDef.java 15 Jan 2010 19:55:59 -0000 1.2 --- GameDef.java 31 Jan 2010 22:22:28 -0000 1.3 *************** *** 9,32 **** public class GameDef { ! public enum Parm { ! NO_SALE_IN_FIRST_SR (false), ! NO_SALE_IF_NOT_OPERATED (false), ! STOCK_ROUND_SEQUENCE(StockRound.SELL_BUY_SELL), ! PLAYER_SHARE_LIMIT (60), ! POOL_SHARE_LIMIT(50), ! TREASURY_SHARE_LIMIT(50), ! FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS(false), ! SKIP_FIRST_STOCK_ROUND(false); ! private Object defaultValue; ! Parm (boolean defaultValue) { this.defaultValue = defaultValue; } ! Parm (int defaultValue) { this.defaultValue = defaultValue; } ! public Object defaultValue() { return defaultValue; } ! public boolean defaultValueAsBoolean() { return (Boolean) defaultValue; } ! public int defaultValueAsInt() { return (Integer) defaultValue; } ! } } --- 9,32 ---- public class GameDef { ! public enum Parm { ! NO_SALE_IN_FIRST_SR (false), ! NO_SALE_IF_NOT_OPERATED (false), ! STOCK_ROUND_SEQUENCE(StockRound.SELL_BUY_SELL), ! PLAYER_SHARE_LIMIT (60), ! POOL_SHARE_LIMIT(50), ! TREASURY_SHARE_LIMIT(50), ! FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS(false), ! SKIP_FIRST_STOCK_ROUND(false); ! private Object defaultValue; ! Parm (boolean defaultValue) { this.defaultValue = defaultValue; } ! Parm (int defaultValue) { this.defaultValue = defaultValue; } ! public Object defaultValue() { return defaultValue; } ! public boolean defaultValueAsBoolean() { return (Boolean) defaultValue; } ! public int defaultValueAsInt() { return (Integer) defaultValue; } ! } } Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PublicCompanyI.java 8 Jan 2010 21:30:46 -0000 1.41 --- PublicCompanyI.java 31 Jan 2010 22:22:28 -0000 1.42 *************** *** 349,353 **** public int sharesOwnedByPlayers(); ! public String getExtraShareMarks (); public ModelObject getClosedModel (); --- 349,353 ---- public int sharesOwnedByPlayers(); ! public String getExtraShareMarks (); public ModelObject getClosedModel (); Index: StockMarket.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockMarket.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** StockMarket.java 13 Dec 2009 16:39:49 -0000 1.24 --- StockMarket.java 31 Jan 2010 22:22:28 -0000 1.25 *************** *** 47,55 **** public void configureFromXML(Tag tag) throws ConfigurationException { ! // Define a default stockspace type with colour white ! defaultType = new StockSpaceType(DEFAULT, StockSpaceType.WHITE); ! stockSpaceTypes.put (DEFAULT, defaultType); ! /* Read and configure the stock market space types */ List<Tag> typeTags = tag.getChildren(StockSpaceTypeI.ELEMENT_ID); --- 47,55 ---- public void configureFromXML(Tag tag) throws ConfigurationException { ! // Define a default stockspace type with colour white ! defaultType = new StockSpaceType(DEFAULT, StockSpaceType.WHITE); ! stockSpaceTypes.put (DEFAULT, defaultType); ! /* Read and configure the stock market space types */ List<Tag> typeTags = tag.getChildren(StockSpaceTypeI.ELEMENT_ID); *************** *** 237,241 **** // Check if company may enter a "Closed" area while (getStockSpace(newrow, col).closesCompany() && !company.canClose()) ! newrow--; /* --- 237,241 ---- // Check if company may enter a "Closed" area while (getStockSpace(newrow, col).closesCompany() && !company.canClose()) ! newrow--; /* *************** *** 266,272 **** int col = oldsquare.getColumn(); if (col < numCols - 1 && !oldsquare.isLeftOfLedge() ! && (newsquare = getStockSpace(row, col + 1)) != null) {} else if (row > 0 ! && (newsquare = getStockSpace(row - 1, col)) != null) {} prepareMove(company, oldsquare, newsquare); } --- 266,272 ---- int col = oldsquare.getColumn(); if (col < numCols - 1 && !oldsquare.isLeftOfLedge() ! && (newsquare = getStockSpace(row, col + 1)) != null) {} else if (row > 0 ! && (newsquare = getStockSpace(row - 1, col)) != null) {} prepareMove(company, oldsquare, newsquare); } *************** *** 279,288 **** if (col > 0 && (newsquare = getStockSpace(row, col - 1)) != null) {} else if (row < numRows - 1 && ! (newsquare = getStockSpace(row + 1, col)) != null) {} else { newsquare = oldsquare; } if (newsquare.closesCompany()) { ! if (!company.canClose()) return; // E.g. 1856 CGR company.setClosed(); oldsquare.removeToken(company); --- 279,288 ---- if (col > 0 && (newsquare = getStockSpace(row, col - 1)) != null) {} else if (row < numRows - 1 && ! (newsquare = getStockSpace(row + 1, col)) != null) {} else { newsquare = oldsquare; } if (newsquare.closesCompany()) { ! if (!company.canClose()) return; // E.g. 1856 CGR company.setClosed(); oldsquare.removeToken(company); Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** StartRound_1830.java 1 Jan 2010 18:57:21 -0000 1.28 --- StartRound_1830.java 31 Jan 2010 22:22:28 -0000 1.29 *************** *** 42,52 **** StartItem item; while ((item = startPacket.getFirstUnsoldItem()) != null ! && item.getBidders() == 1 && item.needsPriceSetting() == null) { assignItem(item.getBidder(), item, item.getBid(), 0); // Check if this has exhausted the start packet if (startPacket.areAllSold()) { ! finishRound(); ! break; } } --- 42,52 ---- StartItem item; while ((item = startPacket.getFirstUnsoldItem()) != null ! && item.getBidders() == 1 && item.needsPriceSetting() == null) { assignItem(item.getBidder(), item, item.getBid(), 0); // Check if this has exhausted the start packet if (startPacket.areAllSold()) { ! finishRound(); ! break; } } *************** *** 107,112 **** break; // No more actions possible! } else { ! // ERROR, this should have been detected in process()! ! log.error("??? Wrong place to assign item "+item.getName()); assignItem(item.getBidder(), item, item.getBid(), 0); } --- 107,112 ---- break; // No more actions possible! } else { ! // ERROR, this should have been detected in process()! ! log.error("??? Wrong place to assign item "+item.getName()); assignItem(item.getBidder(), item, item.getBid(), 0); } *************** *** 323,330 **** // More than one left: find next bidder ! if (GameOption.OPTION_VALUE_YES.equalsIgnoreCase(getGameOption("LeaveAuctionOnPass"))) { ! // Game option: player to leave auction after a pass (default no). ! auctionItem.setBid(-1, player); ! } setNextBiddingPlayer(auctionItem, --- 323,330 ---- // More than one left: find next bidder ! if (GameOption.OPTION_VALUE_YES.equalsIgnoreCase(getGameOption("LeaveAuctionOnPass"))) { ! // Game option: player to leave auction after a pass (default no). ! auctionItem.setBid(-1, player); ! } setNextBiddingPlayer(auctionItem, Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Phase.java 19 Jan 2010 19:54:47 -0000 1.16 --- Phase.java 31 Jan 2010 22:22:28 -0000 1.17 *************** *** 165,169 **** public String getTileColoursString() { ! return colourList; } --- 165,169 ---- public String getTileColoursString() { ! return colourList; } *************** *** 247,254 **** public List<Closeable> getClosedObjects() { ! return closedObjects; ! } ! @Override public String toString() { return name; --- 247,254 ---- public List<Closeable> getClosedObjects() { ! return closedObjects; ! } ! @Override public String toString() { return name; Index: ComponentManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ComponentManager.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ComponentManager.java 15 Jan 2010 19:55:59 -0000 1.16 --- ComponentManager.java 31 Jan 2010 22:22:28 -0000 1.17 *************** *** 42,46 **** public static synchronized ComponentManager configureInstance(String gameName, Tag tag, ! Map<String, String> gameOptions) throws ConfigurationException { return new ComponentManager(gameName, tag, gameOptions); --- 42,46 ---- public static synchronized ComponentManager configureInstance(String gameName, Tag tag, ! Map<String, String> gameOptions) throws ConfigurationException { return new ComponentManager(gameName, tag, gameOptions); Index: TrainTypeI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TrainTypeI.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TrainTypeI.java 4 Nov 2009 20:33:22 -0000 1.11 --- TrainTypeI.java 31 Jan 2010 22:22:28 -0000 1.12 *************** *** 108,111 **** public int getIndex(); ! public TrainManager getTrainManager(); } --- 108,111 ---- public int getIndex(); ! public TrainManager getTrainManager(); } Index: CompanyManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/CompanyManager.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CompanyManager.java 17 Jan 2010 14:05:48 -0000 1.20 --- CompanyManager.java 31 Jan 2010 22:22:28 -0000 1.21 *************** *** 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) */ private List<StartPacket> startPackets = new ArrayList<StartPacket>(); /** A map of all start packets, keyed by name. Default name is "Initial" */ private Map<String, StartPacket> startPacketMap = new HashMap<String, StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); protected GameManagerI gameManager; /* * 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 { gameManager = GameManager.getInstance(); /** 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", 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", StartPacket.DEFAULT_NAME); String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); startPacketMap.put(name, sp); sp.configureFromXML(packetTag); } } } // Post XML parsing initialisations public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.finishConfiguration(gameManager); } for (PrivateCompanyI comp : lPrivateCompanies) { comp.finishConfiguration(gameManager); } } /** * @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; } public StartPacket getStartPacket (int index) { return startPackets.get(index); } public StartPacket getStartPacket (String name) { return startPacketMap.get(name); } } \ 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) */ private List<StartPacket> startPackets = new ArrayList<StartPacket>(); /** A map of all start packets, keyed by name. Default name is "Initial" */ private Map<String, StartPacket> startPacketMap = new HashMap<String, StartPacket>(); private int numberOfPublicCompanies = 0; protected static Logger log = Logger.getLogger(CompanyManager.class.getPackage().getName()); protected GameManagerI gameManager; /* * 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 { gameManager = GameManager.getInstance(); /** 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", 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", StartPacket.DEFAULT_NAME); String roundClass = packetTag.getAttributeAsString("roundClass"); if (roundClass == null) { throw new ConfigurationException(LocalText.getText( "StartPacketHasNoClass", name)); } StartPacket sp = new StartPacket(name, roundClass); startPackets.add(sp); startPacketMap.put(name, sp); sp.configureFromXML(packetTag); } } } // Post XML parsing initialisations public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { for (PublicCompanyI comp : lPublicCompanies) { comp.finishConfiguration(gameManager); } for (PrivateCompanyI comp : lPrivateCompanies) { comp.finishConfiguration(gameManager); } } /** * @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; } public StartPacket getStartPacket (int index) { return startPackets.get(index); } public StartPacket getStartPacket (String name) { return startPacketMap.get(name); } } \ No newline at end of file Index: TrainManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TrainManager.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TrainManager.java 15 Jan 2010 19:55:59 -0000 1.25 --- TrainManager.java 31 Jan 2010 22:22:28 -0000 1.26 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; public class TrainManager implements ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected Map<String, TrainI> trainMap = new HashMap<String, TrainI>(); // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special GameManager.getInstance().setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, rulesTag.getChild("FaceValueIfDifferentPresidents") != null); } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); for (TrainTypeI type : lTrainTypes) { type.finishConfiguration(gameManager); } // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } public void addTrain (String uniqueID, TrainI train) { trainMap.put(uniqueID, train); } public TrainI getTrainByUniqueId(String id) { return trainMap.get(id); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public String getTrainCostOverview() { StringBuffer b = new StringBuffer(); for (TrainTypeI type : lTrainTypes) { if (b.length() > 1) b.append(" "); b.append(type.getName()).append(":").append(Bank.format(type.getCost())); if (type.getFirstExchangeCost() > 0) { b.append("(").append(Bank.format(type.getFirstExchangeCost())).append(")"); } } return b.toString(); } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; public class TrainManager implements ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected Map<String, TrainI> trainMap = new HashMap<String, TrainI>(); // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special GameManager.getInstance().setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS, rulesTag.getChild("FaceValueIfDifferentPresidents") != null); } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void finishConfiguration (GameManagerI gameManager) throws ConfigurationException { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); for (TrainTypeI type : lTrainTypes) { type.finishConfiguration(gameManager); } // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } public void addTrain (String uniqueID, TrainI train) { trainMap.put(uniqueID, train); } public TrainI getTrainByUniqueId(String id) { return trainMap.get(id); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public String getTrainCostOverview() { StringBuffer b = new StringBuffer(); for (TrainTypeI type : lTrainTypes) { if (b.length() > 1) b.append(" "); b.append(type.getName()).append(":").append(Bank.format(type.getCost())); if (type.getFirstExchangeCost() > 0) { b.append("(").append(Bank.format(type.getFirstExchangeCost())).append(")"); } } return b.toString(); } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } } \ No newline at end of file Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** PrivateCompany.java 16 Jan 2010 21:16:14 -0000 1.30 --- PrivateCompany.java 31 Jan 2010 22:22:28 -0000 1.31 *************** *** 185,191 **** public void setClosed() { ! if (isClosed()) return; ! super.setClosed(); unblockHexes(); moveTo(GameManager.getInstance().getBank().getScrapHeap()); --- 185,191 ---- public void setClosed() { ! if (isClosed()) return; ! super.setClosed(); unblockHexes(); moveTo(GameManager.getInstance().getBank().getScrapHeap()); *************** *** 198,202 **** List<SellBonusToken> moveToGM = new ArrayList<SellBonusToken>(4); for (SpecialPropertyI sp : specialProperties) { ! if (sp instanceof SellBonusToken) { moveToGM.add((SellBonusToken)sp); } --- 198,202 ---- List<SellBonusToken> moveToGM = new ArrayList<SellBonusToken>(4); for (SpecialPropertyI sp : specialProperties) { ! if (sp instanceof SellBonusToken) { moveToGM.add((SellBonusToken)sp); } Index: StockSpace.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockSpace.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StockSpace.java 13 Dec 2009 16:39:49 -0000 1.9 --- StockSpace.java 31 Jan 2010 22:22:28 -0000 1.10 *************** *** 257,266 **** @Override ! public String getText() { return Bank.format(price); } @Override ! public String toString() { return getText(); } --- 257,266 ---- @Override ! public String getText() { return Bank.format(price); } @Override ! public String toString() { return getText(); } Index: Bonus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Bonus.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Bonus.java 19 Jan 2010 19:54:53 -0000 1.6 --- Bonus.java 31 Jan 2010 22:22:28 -0000 1.7 *************** *** 18,22 **** public class Bonus implements Closeable { ! private PublicCompanyI owner; private List<MapHex> locations = null; private String name; --- 18,22 ---- public class Bonus implements Closeable { ! private PublicCompanyI owner; private List<MapHex> locations = null; private String name; *************** *** 38,45 **** public PublicCompanyI getOwner() { ! return owner; ! } ! public List<MapHex> getLocations() { return locations; } --- 38,45 ---- public PublicCompanyI getOwner() { ! return owner; ! } ! public List<MapHex> getLocations() { return locations; } *************** *** 87,95 **** if (removingObject == null) { ! String[] spec = removingObjectDesc.split(":"); ! if (spec[0].equalsIgnoreCase("Phase")) { ! removingObject = ! phaseManager.getPhaseByName(spec[1]); ! } } --- 87,95 ---- if (removingObject == null) { ! String[] spec = removingObjectDesc.split(":"); ! if (spec[0].equalsIgnoreCase("Phase")) { ! removingObject = ! phaseManager.getPhaseByName(spec[1]); ! } } ... [truncated message content] |