From: Erik V. <ev...@us...> - 2009-10-09 19:03:59
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28916/rails/game Modified Files: Game.java PublicCompany.java TrainManager.java OperatingRound.java TileManager.java GameManagerI.java GameManager.java Removed Files: PhaseManagerI.java TileManagerI.java TrainManagerI.java Log Message: Removed some not really necessary interfaces. --- PhaseManagerI.java DELETED --- Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** PublicCompany.java 7 Oct 2009 21:03:36 -0000 1.66 --- PublicCompany.java 9 Oct 2009 19:03:49 -0000 1.67 *************** *** 8,12 **** import rails.game.model.*; import rails.game.move.*; ! import rails.game.special.*; import rails.game.state.*; import rails.util.*; --- 8,13 ---- import rails.game.model.*; import rails.game.move.*; ! import rails.game.special.SellBonusToken; ! import rails.game.special.SpecialPropertyI; import rails.game.state.*; import rails.util.*; *************** *** 874,878 **** if (initialTrain != null) { ! TrainManagerI trainManager = gameManager.getTrainManager(); TrainTypeI type = trainManager.getTypeByName(initialTrain); TrainI train = bank.getIpo().getTrainOfType(type); --- 875,879 ---- if (initialTrain != null) { ! TrainManager trainManager = gameManager.getTrainManager(); TrainTypeI type = trainManager.getTypeByName(initialTrain); TrainI train = bank.getIpo().getTrainOfType(type); Index: TileManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TileManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TileManager.java 4 Jun 2008 19:00:30 -0000 1.8 --- TileManager.java 9 Oct 2009 19:03:49 -0000 1.9 *************** *** 1 **** ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.*; public class TileManager implements TileManagerI, ConfigurableComponentI { protected static TileManagerI instance = null; protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); private static List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { instance = this; } public static TileManagerI get() { return instance; } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); directories.add("data/" + ComponentManager.getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.util.LocalText; import rails.util.Tag; public class TileManager implements ConfigurableComponentI { protected static TileManager instance = null; protected Map<Integer, TileI> tileMap = new HashMap<Integer, TileI>(); protected List<Integer> tileIds = new ArrayList<Integer>(); private static List<String> directories = new ArrayList<String>(); /** * No-args constructor. */ public TileManager() { instance = this; } public static TileManager get() { return instance; } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tileSetTop) throws ConfigurationException { /* * Note: prefix se is used for elements from TileSet.xml, prefix te for * elements from Tiles.xml. */ String tileDefFileName = tileSetTop.getAttributeAsString("tiles"); if (tileDefFileName == null) throw new ConfigurationException(LocalText.getText("NoTilesXML")); directories.add("data/" + ComponentManager.getGameName()); Tag tileDefTop = Tag.findTopTagInFile(tileDefFileName, directories, "Tiles"); if (tileDefTop == null) throw new ConfigurationException(LocalText.getText("NoTilesTag")); List<Tag> tileSetList = tileSetTop.getChildren("Tile"); List<Tag> tileDefList = tileDefTop.getChildren("Tile"); /* * The XML files TileSet.xml and Tiles.xml are read side by side, as * each one configures different tile aspects. The reason for having two * XML files is, that Tiles.xml defines per-tile aspects that are the * same for all games (such as the colour, tracks and stations; this * file is an automatically generated subset of the generic file * tiles/Tiles.xml), whereas TileSet.xml specifies the aspects that are * (or can be) specific to each rails.game (such as the possible * upgrades). <p>TileSet.xml is leading. */ int tileId; TileI tile; // Creates maps to the tile definitions in both files. Map<Integer, Tag> tileSetMap = new HashMap<Integer, Tag>(); Map<Integer, Tag> tileDefMap = new HashMap<Integer, Tag>(); for (Tag tileSetTag : tileSetList) { tileId = tileSetTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTilesetID", String.valueOf(tileId))); } tileSetMap.put(tileId, tileSetTag); tileIds.add(tileId); } for (Tag tileDefTag : tileDefList) { tileId = tileDefTag.getAttributeAsInteger("id"); /* * Check for duplicates (this also covers missing tile ids, as this * returns 0, and we always have a tile numbered 0! */ if (tileDefMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "DuplicateTileID", String.valueOf(tileId))); } else if (!tileSetMap.containsKey(tileId)) { throw new ConfigurationException(LocalText.getText( "TileMissingInTileSet", String.valueOf(tileId))); } tileDefMap.put(tileId, tileDefTag); } // Create the Tile objects (must be done before further parsing) for (Integer id : tileSetMap.keySet()) { tile = new Tile(id); tileMap.put(id, tile); } // Finally, parse the <Tile> subtags for (Integer id : tileMap.keySet()) { tile = tileMap.get(id); tile.configureFromXML(tileSetMap.get(id), tileDefMap.get(id)); } } public TileI getTile(int id) { return tileMap.get(id); } /** Get the tile IDs in the XML definition sequence */ public List<Integer> getTileIds() { return tileIds; } } \ No newline at end of file Index: TrainManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TrainManager.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TrainManager.java 25 Sep 2009 19:13:01 -0000 1.18 --- TrainManager.java 9 Oct 2009 19:03:49 -0000 1.19 *************** *** 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 TrainManagerI, ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected boolean buyAtFaceValueBetweenDifferentPresidents = false; // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes private static TrainManagerI instance = null; protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { instance = this; // Nothing to do here, everything happens when configured. newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special buyAtFaceValueBetweenDifferentPresidents = rulesTag.getChild("FaceValueIfDifferentPresidents") != null; } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void init (GameManagerI gameManager) { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } /** * Make an abbreviated list of trains, like "2(6) 3(5)" etc, to show in the * IPO. * * @param holder The Portfolio for which this list will be made (always * IPO). */ public static String makeAbbreviatedList(Portfolio holder) { StringBuffer b = new StringBuffer(); TrainI[] trains; for (TrainTypeI type : instance.getTrainTypes()) { trains = holder.getTrainsPerType(type); if (trains.length > 0) { if (b.length() > 0) b.append(" "); b.append(type.getName()).append("("); if (type.hasInfiniteAmount()) { b.append("+"); } else { b.append(trains.length); } b.append(")"); } } return b.toString(); } /** * Make a full list of trains, like "2 2 3 3", to show in any field * describing train possessions, except the IPO. * * @param holder The Portfolio for which this list will be made. */ public static String makeFullList(Portfolio holder) { List<TrainI> trains = holder.getTrainList(); if (trains == null || trains.size() == 0) return ""; return makeFullList(trains); } public static String makeFullList(List<TrainI> trains) { StringBuffer b = new StringBuffer(); for (TrainI train : trains) { if (b.length() > 0) b.append(" "); if (train.isObsolete()) b.append("("); b.append(train.toDisplay()); if (train.isObsolete()) b.append(")"); } return b.toString(); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } public boolean buyAtFaceValueBetweenDifferentPresidents() { return buyAtFaceValueBetweenDifferentPresidents; } } \ No newline at end of file --- 1 ---- ! /* $Header$ */ package rails.game; import java.util.*; import rails.game.state.IntegerState; import rails.util.LocalText; import rails.util.Tag; public class TrainManager implements ConfigurableComponentI { // Static attributes protected List<TrainTypeI> lTrainTypes = new ArrayList<TrainTypeI>(); protected Map<String, TrainTypeI> mTrainTypes = new HashMap<String, TrainTypeI>(); protected boolean buyAtFaceValueBetweenDifferentPresidents = false; // Dynamic attributes protected Portfolio unavailable = null; protected IntegerState newTypeIndex; protected boolean trainsHaveRusted = false; protected boolean phaseHasChanged = false; protected boolean trainAvailabilityChanged = false; protected List<PublicCompanyI> companiesWithExcessTrains; protected GameManagerI gameManager = null; protected Bank bank = null; // Non-game attributes private static TrainManager instance = null; protected Portfolio ipo = null; /** * No-args constructor. */ public TrainManager() { instance = this; // Nothing to do here, everything happens when configured. newTypeIndex = new IntegerState("NewTrainTypeIndex", 0); } /** * @see rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element) */ public void configureFromXML(Tag tag) throws ConfigurationException { TrainType defaultType = null; TrainType newType; Tag defaultsTag = tag.getChild("Defaults"); if (defaultsTag != null) { defaultType = new TrainType(false); defaultType.configureFromXML(defaultsTag); } List<Tag> typeTags = tag.getChildren("Train"); for (Tag typeTag : typeTags) { if (defaultType != null) { newType = (TrainType) defaultType.clone(); if (newType == null) { throw new ConfigurationException("Cannot clone traintype " + defaultType.getName()); } } else { newType = new TrainType(true); } lTrainTypes.add(newType); newType.configureFromXML(typeTag); mTrainTypes.put(newType.getName(), newType); } // Special train buying rules Tag rulesTag = tag.getChild("TrainBuyingRules"); if (rulesTag != null) { // A 1851 special buyAtFaceValueBetweenDifferentPresidents = rulesTag.getChild("FaceValueIfDifferentPresidents") != null; } // Finish initialisation of the train types for (TrainTypeI type : lTrainTypes) { if (type.getReleasedTrainTypeName() != null) { type.setReleasedTrainType(mTrainTypes.get(type.getReleasedTrainTypeName())); } if (type.getRustedTrainTypeName() != null) { type.setRustedTrainType(mTrainTypes.get(type.getRustedTrainTypeName())); mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false); } } } public void init (GameManagerI gameManager) { this.gameManager = gameManager; bank = gameManager.getBank(); ipo = bank.getIpo(); unavailable = bank.getUnavailable(); // By default, set the first train type to "available". newTypeIndex.set(0); lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank); } /** * Make an abbreviated list of trains, like "2(6) 3(5)" etc, to show in the * IPO. * * @param holder The Portfolio for which this list will be made (always * IPO). */ public static String makeAbbreviatedList(Portfolio holder) { StringBuffer b = new StringBuffer(); TrainI[] trains; for (TrainTypeI type : instance.getTrainTypes()) { trains = holder.getTrainsPerType(type); if (trains.length > 0) { if (b.length() > 0) b.append(" "); b.append(type.getName()).append("("); if (type.hasInfiniteAmount()) { b.append("+"); } else { b.append(trains.length); } b.append(")"); } } return b.toString(); } /** * Make a full list of trains, like "2 2 3 3", to show in any field * describing train possessions, except the IPO. * * @param holder The Portfolio for which this list will be made. */ public static String makeFullList(Portfolio holder) { List<TrainI> trains = holder.getTrainList(); if (trains == null || trains.size() == 0) return ""; return makeFullList(trains); } public static String makeFullList(List<TrainI> trains) { StringBuffer b = new StringBuffer(); for (TrainI train : trains) { if (b.length() > 0) b.append(" "); if (train.isObsolete()) b.append("("); b.append(train.toDisplay()); if (train.isObsolete()) b.append(")"); } return b.toString(); } /** * This method handles any consequences of new train buying (from the IPO), * such as rusting and phase changes. It must be called <b>after</b> the * train has been transferred. * */ public void checkTrainAvailability(TrainI train, Portfolio from) { trainsHaveRusted = false; phaseHasChanged = false; if (from != ipo) return; TrainTypeI boughtType, nextType; boughtType = train.getType(); if (boughtType == (lTrainTypes.get(newTypeIndex.intValue())) && ipo.getTrainOfType(boughtType) == null) { // Last train bought, make a new type available. newTypeIndex.add(1); nextType = (lTrainTypes.get(newTypeIndex.intValue())); if (nextType != null) { if (!nextType.isAvailable()) nextType.setAvailable(bank); trainAvailabilityChanged = true; ReportBuffer.add("All " + boughtType.getName() + "-trains are sold out, " + nextType.getName() + "-trains now available"); } } if (boughtType.getNumberBoughtFromIPO() == 1) { // First train of a new type bought ReportBuffer.add(LocalText.getText("FirstTrainBought", boughtType.getName())); String newPhase = boughtType.getStartedPhaseName(); if (newPhase != null) { gameManager.getPhaseManager().setPhase(newPhase); phaseHasChanged = true; } TrainTypeI rustedType = boughtType.getRustedTrainType(); if (rustedType != null && !rustedType.hasRusted()) { rustedType.setRusted(train.getHolder()); // Or obsolete, // where applicable ReportBuffer.add(LocalText.getText("TrainsRusted", rustedType.getName())); trainsHaveRusted = true; trainAvailabilityChanged = true; } TrainTypeI releasedType = boughtType.getReleasedTrainType(); if (releasedType != null) { if (!releasedType.isAvailable()) releasedType.setAvailable(bank); ReportBuffer.add(LocalText.getText("TrainsAvailable", releasedType.getName())); trainAvailabilityChanged = true; } } } public List<TrainI> getAvailableNewTrains() { List<TrainI> availableTrains = new ArrayList<TrainI>(); TrainI train; for (TrainTypeI type : lTrainTypes) { if (type.isAvailable()) { train = ipo.getTrainOfType(type); if (train != null) { availableTrains.add(train); } } } return availableTrains; } public TrainTypeI getTypeByName(String name) { return mTrainTypes.get(name); } public List<TrainTypeI> getTrainTypes() { return lTrainTypes; } public boolean hasAvailabilityChanged() { return trainAvailabilityChanged; } public void resetAvailabilityChanged() { trainAvailabilityChanged = false; } public boolean hasPhaseChanged() { return phaseHasChanged; } public boolean buyAtFaceValueBetweenDifferentPresidents() { return buyAtFaceValueBetweenDifferentPresidents; } } \ No newline at end of file Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** GameManager.java 8 Oct 2009 21:14:15 -0000 1.59 --- GameManager.java 9 Oct 2009 19:03:49 -0000 1.60 *************** *** 46,50 **** protected CompanyManagerI companyManager; protected PhaseManager phaseManager; ! protected TrainManagerI trainManager; protected StockMarketI stockMarket; protected MapManager mapManager; --- 46,50 ---- protected CompanyManagerI companyManager; protected PhaseManager phaseManager; ! protected TrainManager trainManager; protected StockMarketI stockMarket; protected MapManager mapManager; *************** *** 376,380 **** CompanyManagerI companyManager, PhaseManager phaseManager, ! TrainManagerI trainManager, StockMarketI stockMarket, MapManager mapManager, --- 376,380 ---- CompanyManagerI companyManager, PhaseManager phaseManager, ! TrainManager trainManager, StockMarketI stockMarket, MapManager mapManager, *************** *** 1007,1011 **** } ! public TrainManagerI getTrainManager () { return trainManager; } --- 1007,1011 ---- } ! public TrainManager getTrainManager () { return trainManager; } --- TileManagerI.java DELETED --- Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Game.java 3 Oct 2009 14:02:28 -0000 1.29 --- Game.java 9 Oct 2009 19:03:49 -0000 1.30 *************** *** 25,29 **** protected PlayerManager playerManager; protected PhaseManager phaseManager; ! protected TrainManagerI trainManager; protected StockMarketI stockMarket; protected MapManager mapManager; --- 25,29 ---- protected PlayerManager playerManager; protected PhaseManager phaseManager; ! protected TrainManager trainManager; protected StockMarketI stockMarket; protected MapManager mapManager; Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** OperatingRound.java 7 Oct 2009 21:03:36 -0000 1.72 --- OperatingRound.java 9 Oct 2009 19:03:49 -0000 1.73 *************** *** 111,115 **** protected boolean doneAllowed = false; ! protected TrainManagerI trainManager = gameManager.getTrainManager(); public static String[] stepNames = --- 111,115 ---- protected boolean doneAllowed = false; ! protected TrainManager trainManager = gameManager.getTrainManager(); public static String[] stepNames = *************** *** 2047,2051 **** if (operatingCompany == null) return; ! TrainManagerI trainMgr = gameManager.getTrainManager(); int cash = operatingCompany.getCash(); --- 2047,2051 ---- if (operatingCompany == null) return; ! TrainManager trainMgr = gameManager.getTrainManager(); int cash = operatingCompany.getCash(); --- TrainManagerI.java DELETED --- Index: GameManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManagerI.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GameManagerI.java 8 Oct 2009 21:14:15 -0000 1.15 --- GameManagerI.java 9 Oct 2009 19:03:49 -0000 1.16 *************** *** 21,25 **** public abstract void init(PlayerManager playerManager, CompanyManagerI companyManager, PhaseManager phaseManager, ! TrainManagerI trainManager, StockMarketI stockMarket, MapManager mapManager, Bank bank); public abstract void startGame(); --- 21,25 ---- public abstract void init(PlayerManager playerManager, CompanyManagerI companyManager, PhaseManager phaseManager, ! TrainManager trainManager, StockMarketI stockMarket, MapManager mapManager, Bank bank); public abstract void startGame(); *************** *** 150,154 **** public void initialiseNewPhase(PhaseI phase); ! public abstract TrainManagerI getTrainManager (); public PlayerManager getPlayerManager(); public StockMarketI getStockMarket(); --- 150,154 ---- public void initialiseNewPhase(PhaseI phase); ! public abstract TrainManager getTrainManager (); public PlayerManager getPlayerManager(); public StockMarketI getStockMarket(); |