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: Stefan F. <ste...@us...> - 2010-05-11 21:47:30
|
Update of /cvsroot/rails/18xx/rails/algorithms In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14662/rails/algorithms Modified Files: NetworkTrain.java RevenueAdapter.java NetworkEdge.java NetworkVertex.java NetworkGraphBuilder.java RevenueCalculator.java NetworkIterator.java Added Files: RevenueBonus.java RevenueBonusTemplate.java Log Message: Added VertexVisitedSets and RevenueBonuses, several other improvements to the RC Index: NetworkVertex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkVertex.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NetworkVertex.java 20 Apr 2010 22:07:09 -0000 1.8 --- NetworkVertex.java 11 May 2010 21:47:21 -0000 1.9 *************** *** 4,12 **** import java.util.Collection; import java.util.Comparator; - import java.util.HashSet; - import java.util.List; - import java.util.Set; ! import rails.game.BaseToken; import rails.game.City; import rails.game.MapHex; --- 4,10 ---- import java.util.Collection; import java.util.Comparator; ! import org.apache.log4j.Logger; ! import rails.game.City; import rails.game.MapHex; *************** *** 14,18 **** import rails.game.PublicCompanyI; import rails.game.Station; - import rails.game.TokenI; import rails.ui.swing.hexmap.EWHexMap; import rails.ui.swing.hexmap.GUIHex; --- 12,15 ---- *************** *** 21,32 **** public final class NetworkVertex implements Comparable<NetworkVertex> { private static enum VertexType { STATION, SIDE, ! HQ } ! private final VertexType type; ! private final MapHex hex; --- 18,45 ---- public final class NetworkVertex implements Comparable<NetworkVertex> { + protected static Logger log = + Logger.getLogger(NetworkVertex.class.getPackage().getName()); + private static enum VertexType { STATION, SIDE, ! HQ, } ! ! // vertex types and flag for virtual (thus not related to a rails object) private final VertexType type; ! private final boolean virtual; ! ! // vertex properties (for virtual vertexes) ! private final String virtualId; ! ! // general vertex properties ! private boolean major = false; ! private boolean minor = false; ! private int value = 0; ! private boolean sink = false; ! private String cityName = null; ! ! // references to rails objects, if not virtual private final MapHex hex; *************** *** 35,88 **** private final int side; - private PhaseI phase; ! private boolean tokenable; ! private Set<PublicCompanyI> companiesHaveToken; ! private int tokenSlots; ! public NetworkVertex(MapHex hex, Station station) { - this(hex, station, null); - } - - public NetworkVertex(MapHex hex, Station station, PhaseI phase) { this.type = VertexType.STATION; this.hex = hex; this.station = station; ! this.side = 0; ! ! this.phase = phase; ! ! String t = station.getType(); ! if (t.equals(Station.TOWN)){ ! this.tokenable = false; ! this.city = null; } else { ! this.tokenable = true; ! // find tokens ! List<TokenI> tokens = null; ! this.tokenSlots = 0; ! List<City> cities = hex.getCities(); ! City foundCity = null; ! for (City city:cities) { ! if (station == city.getRelatedStation()) { ! foundCity = city; ! tokens = city.getTokens(); ! this.tokenSlots = city.getSlots(); ! break; ! } ! } ! this.city = foundCity; ! this.companiesHaveToken = new HashSet<PublicCompanyI>(); ! if (tokens != null) { ! for (TokenI token:tokens) { ! if (token instanceof BaseToken) { ! BaseToken baseToken = (BaseToken)token; ! this.companiesHaveToken.add(baseToken.getCompany()); ! } ! } ! } } } public NetworkVertex(MapHex hex, int side) { this.type = VertexType.SIDE; --- 48,70 ---- private final int side; ! /** constructor for station on mapHex */ public NetworkVertex(MapHex hex, Station station) { this.type = VertexType.STATION; this.hex = hex; this.station = station; ! this.side = -1; ! this.city = hex.getRelatedCity(station); ! if (city != null) { ! log.info("Found city " + city); } else { ! log.info("No city found"); } + + this.virtual = false; + this.virtualId = null; } + /** constructor for side on mapHex */ public NetworkVertex(MapHex hex, int side) { this.type = VertexType.SIDE; *************** *** 92,112 **** this.side = (side % 6); ! this.phase = null; ! this.tokenable = false; ! this.companiesHaveToken = null; ! this.tokenSlots = 0; } public NetworkVertex(PublicCompanyI company) { ! this.type = VertexType.HQ; this.hex = null; this.station = null; this.city = null; ! this.side = 0; ! ! this.phase = null; ! this.tokenable = false; ! this.companiesHaveToken = null; ! this.tokenSlots = 0; } --- 74,110 ---- this.side = (side % 6); ! this.virtual = false; ! this.virtualId = null; } + /** constructor for public company hq */ public NetworkVertex(PublicCompanyI company) { ! this(VertexType.HQ, "HQ"); ! } ! ! private NetworkVertex(VertexType type, String name) { ! this.type = type; this.hex = null; this.station = null; this.city = null; ! this.side = -1; ! ! this.virtual = true; ! this.virtualId = name; ! } ! ! /** factory method for virtual vertex ! */ ! public static NetworkVertex getVirtualVertex(VertexType type, String name) { ! NetworkVertex vertex = new NetworkVertex(type, name); ! return vertex; ! } ! ! void addToRevenueCalculator(RevenueCalculator rc, int vertexId) { ! rc.setVertex(vertexId, major, minor); ! } ! ! public boolean isVirtual() { ! return virtual; } *************** *** 123,217 **** } ! public boolean isTownType(){ ! return isStation() && station.getType().equals(Station.TOWN); } ! public boolean isCityType(){ ! return isStation() && ! (station.getType().equals(Station.CITY) || station.getType().equals(Station.OFF_MAP_AREA)); } ! public boolean isOffBoardType() { ! return isStation() && station.getType().equals(Station.OFF_MAP_AREA); } ! ! public MapHex getHex(){ ! return hex; } ! ! public Station getStation(){ ! return station; } ! public City getCity() { ! return city; } ! public int getSide(){ ! return side; } ! public int getValue(PhaseI phase){ ! if (isOffBoardType()) { ! return hex.getCurrentOffBoardValue(phase); ! } else if (isStation()) { ! return station.getValue(); ! } else { ! return 0; ! } } ! public int getValue() { ! return getValue(this.phase); } ! ! public PhaseI getPhase(){ ! return phase; } ! public void setPhase(PhaseI phase){ ! this.phase = phase; } ! /** ! * Checks if a vertex is fully tokened ! * If it cannot be tokened, always returns false ! */ ! public boolean isFullyTokened(){ ! return tokenable && companiesHaveToken.size() >= tokenSlots; } ! /** ! * Checks if a public company can pass through a vertex ! */ ! public boolean canCompanyRunThrough(PublicCompanyI company) { ! return !isFullyTokened() || companiesHaveToken.contains(company); } ! /** ! * Checks if a vertex contains a token of the given public company ! */ ! public boolean hasCompanyToken(PublicCompanyI company) { ! return !(company == null) && companiesHaveToken.contains(company); } ! /** ! * Checks if a given company can add a token ! * */ ! public boolean canCompanyAddToken(PublicCompanyI company) { ! return (tokenable && companiesHaveToken.size() < tokenSlots && company != null && ! !companiesHaveToken.contains(company)); } ! public String printTokens(){ ! if (!tokenable) return "Not tokenable"; ! ! StringBuffer result = new StringBuffer("Tokens:"); ! for (PublicCompanyI company:companiesHaveToken) ! result.append(" " + company.getName()); ! if (isFullyTokened()) result.append(", fully tokened"); ! return result.toString(); } --- 121,247 ---- } ! ! public boolean isMajor(){ ! return major; } ! public NetworkVertex setMajor(boolean major) { ! this.major = major; ! return this; } ! public boolean isMinor(){ ! return minor; } ! ! public NetworkVertex setMinor(boolean minor) { ! this.minor = minor; ! return this; } ! ! public int getValue() { ! return value; } ! public int getValueByTrain(NetworkTrain train) { ! int valueByTrain; ! if (major) { ! valueByTrain = value * train.getMultiplyMajors(); ! } else if (minor) { ! if (train.ignoresMinors()) { ! valueByTrain = 0; ! } else { ! valueByTrain = value * train.getMultiplyMinors(); ! } ! } else { ! valueByTrain = value; ! } ! return valueByTrain; } + public NetworkVertex setValue(int value) { + this.value = value; + return this; + } ! public boolean isSink() { ! return sink; } ! public NetworkVertex setSink(boolean sink) { ! this.sink = sink; ! return this; } ! public String getCityName() { ! return cityName; } ! ! public NetworkVertex setCityName(String locationName) { ! this.cityName = locationName; ! return this; } ! // getter for rails objects ! public MapHex getHex(){ ! return hex; } ! public Station getStation(){ ! return station; } ! public City getCity() { ! return city; } ! public int getSide(){ ! return side; } ! ! /** ! * Initialize for rails vertexes */ ! public void initRailsVertex(PublicCompanyI company) { ! // side vertices use the defaults, virtuals cannot use this function ! if (virtual || type == VertexType.SIDE) return; ! ! log.info("Init of vertex " + this); ! ! // check if it is a major or minor ! if (station.getType().equals(Station.CITY) || station.getType().equals(Station.OFF_MAP_AREA)) { ! major = true; ! } else if (station.getType().equals(Station.TOWN) || station.getType().equals(Station.PORT) ! || station.getType().equals(Station.HALT)) { ! minor = true; ! } ! ! // check if it is a sink ! if (company == null) { // if company == null, then all sinks are deactivated ! sink = false; ! } else if (station.getType().equals(Station.OFF_MAP_AREA) || ! station.getType().equals(Station.CITY) && !city.hasTokenSlotsLeft() && !city.hasTokenOf(company)) { ! sink = true; ! } ! ! // define locationName ! if (station.getType().equals(Station.OFF_MAP_AREA)) { ! cityName = hex.getCityName(); ! } else { ! cityName = station.getCityName(); ! } } ! public void setRailsVertexValue(PhaseI phase) { ! // side vertices and virtuals cannot use this function ! if (virtual || type == VertexType.SIDE) return; ! ! // define value ! if (station.getType().equals(Station.OFF_MAP_AREA)) { ! value = hex.getCurrentOffBoardValue(phase); ! } else { ! value = station.getValue(); ! } } *************** *** 225,243 **** } - public String getVertexName(){ - StringBuffer name = new StringBuffer(); - if (isStation()) { - // if (hex.getCityName() != null && !hex.getCityName().equals("")) - // name.append(hex.getCityName()); - // else - // name.append("Station"); - // if (station.getNumber() != 1) - // name.append("." + station.getNumber()); - name.append(this.getValue()); - } else - name.append(hex.getOrientationName(side)); - return name.toString(); - } - @Override public String toString(){ --- 255,258 ---- *************** *** 249,253 **** else message.append("HQ"); ! if (isFullyTokened()) message.append("/*"); return message.toString(); --- 264,268 ---- else message.append("HQ"); ! if (isSink()) message.append("/*"); return message.toString(); *************** *** 268,281 **** } ! public static void setPhaseForAll(Collection<NetworkVertex> vertexes, PhaseI phase) { ! for (NetworkVertex v:vertexes) ! v.setPhase(phase); } public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); ! if (vertex.isCityType()) { return guiHex.getCityPoint2D(vertex.getCity()); ! } else if (vertex.isTownType()) { return guiHex.getCenterPoint2D(); } else if (vertex.isSide()) { --- 283,301 ---- } ! public static void initAllRailsVertices(Collection<NetworkVertex> vertices, ! PublicCompanyI company, PhaseI phase) { ! for (NetworkVertex v:vertices) { ! if (company != null) ! v.initRailsVertex(company); ! if (phase != null) ! v.setRailsVertexValue(phase); ! } } public static Point2D getVertexPoint2D(HexMap map, NetworkVertex vertex) { GUIHex guiHex = map.getHexByName(vertex.getHex().getName()); ! if (vertex.isMajor()) { return guiHex.getCityPoint2D(vertex.getCity()); ! } else if (vertex.isMinor()) { return guiHex.getCenterPoint2D(); } else if (vertex.isSide()) { Index: RevenueCalculator.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueCalculator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RevenueCalculator.java 2 May 2010 17:33:00 -0000 1.10 --- RevenueCalculator.java 11 May 2010 21:47:21 -0000 1.11 *************** *** 8,12 **** private final int nbVertexes; - private final int maxNeighbors; private final int nbTrains; --- 8,11 ---- *************** *** 15,19 **** --- 14,22 ---- private final boolean[] vertexMajor; private final boolean[] vertexMinor; + private final int[] vertexNbNeighbors; + private final int[] vertexNbBlocks; + private final int[][] vertexNeighbors; + private final int[][] vertexVisitSets; // start vertexes *************** *** 79,90 **** ! public RevenueCalculator (RevenueAdapter revenueAdapter, int nbVertexes, int maxNeighbors, int nbTrains) { this.revenueAdapter = revenueAdapter; this.nbVertexes = nbVertexes; ! this.maxNeighbors = maxNeighbors; this.nbTrains = nbTrains; - log.debug("RC defined: nbVertexes = " + nbVertexes + ", maxNeighbors = " + maxNeighbors + ", nbTrains = " + nbTrains); // initialize all required variables --- 82,95 ---- ! public RevenueCalculator (RevenueAdapter revenueAdapter, int nbVertexes, int maxNeighbors, int maxBlocks, int nbTrains) { + log.info("RC defined: nbVertexes = " + nbVertexes + ", maxNeighbors = " + maxNeighbors + + ", maxBlocks = " + maxBlocks + ", nbTrains = " + nbTrains); + this.revenueAdapter = revenueAdapter; this.nbVertexes = nbVertexes; ! this.nbTrains = nbTrains; // initialize all required variables *************** *** 92,96 **** vertexMajor = new boolean[nbVertexes]; vertexMinor = new boolean[nbVertexes]; ! vertexNeighbors = new int[nbVertexes][maxNeighbors]; edgeGreedy = new boolean[nbVertexes][nbVertexes]; --- 97,104 ---- vertexMajor = new boolean[nbVertexes]; vertexMinor = new boolean[nbVertexes]; ! vertexNbNeighbors = new int[nbVertexes]; ! vertexNbBlocks = new int[nbVertexes]; ! vertexNeighbors = new int[nbVertexes][maxNeighbors]; ! vertexVisitSets = new int[nbVertexes][maxBlocks]; edgeGreedy = new boolean[nbVertexes][nbVertexes]; *************** *** 116,126 **** } ! void setVertex(int id, int value, boolean major, boolean minor, int[] neighbors) { ! for (int j=0; j < nbTrains; j++) { ! vertexValueByTrain[id][j] = value; ! } vertexMajor[id] = major; vertexMinor[id] = minor; ! vertexNeighbors[id] = neighbors; } --- 124,154 ---- } ! void setVertex(int id, boolean major, boolean minor) { vertexMajor[id] = major; vertexMinor[id] = minor; ! // default neighbors && blocks ! vertexNbNeighbors[id] = 0; ! vertexNbBlocks[id] = 0; ! } ! ! void setVertexValue(int vertexId, int trainId, int value) { ! vertexValueByTrain[vertexId][trainId] = value; ! } ! ! void setVertexNeighbors(int id, int[] neighbors) { ! // copy neighbors ! for (int j=0; j < neighbors.length; j++) { ! vertexNeighbors[id][j] = neighbors[j]; ! } ! vertexNbNeighbors[id] = neighbors.length; ! ! } ! ! void setVertexVisitSets(int id, int[] blocks) { ! // copy blocks ! for (int j=0; j < blocks.length; j++) { ! vertexVisitSets[id][j] = blocks[j]; ! } ! vertexNbBlocks[id] = blocks.length; } *************** *** 129,132 **** --- 157,161 ---- } + void setEdge(int vertexLo, int vertexHi, boolean greedy, int distance) { edgeGreedy[vertexLo][vertexHi] = greedy; *************** *** 134,159 **** } ! void setTrain(int id, int majors, int minors, boolean ignoreMinors, int multiplyMajors, int multiplyMinors) { trainMaxMajors[id] = majors; trainMaxMinors[id] = minors; trainIgnoreMinors[id] = ignoreMinors; - - for (int j=0; j < nbVertexes; j++) { - if (vertexMajor[j]) { - vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMajors; - } else if (vertexMinor[j]) { - if (ignoreMinors) { - vertexValueByTrain[j][id] = 0; - } else { - vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMinors; - } - } - } } - // void setPredictionData(int[] maxMajorRevenues, int[] maxMinorRevenues) { - // } - int[][] getOptimalRun() { return currentBestRun; } --- 163,174 ---- } ! void setTrain(int id, int majors, int minors, boolean ignoreMinors) { trainMaxMajors[id] = majors; trainMaxMinors[id] = minors; trainIgnoreMinors[id] = ignoreMinors; } int[][] getOptimalRun() { + log.info("RC: currentBestRun = " + Arrays.deepToString(currentBestRun)); return currentBestRun; } *************** *** 269,273 **** this.startTrain = startTrain; this.finalTrain = finalTrain; ! runTrain(startTrain); --- 284,289 ---- this.startTrain = startTrain; this.finalTrain = finalTrain; ! currentBestValue = 0; ! runTrain(startTrain); *************** *** 312,319 **** // and all edges of it if (trainTerminated == Terminated.NotYet) { ! for (int j = 0; j < maxNeighbors; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of startVertex is " + neighborId); - if (neighborId == -1) break; // no more neighbors if (travelEdge(vertexId, neighborId, true)) { trainStartEdge[trainId] = j; // store edge --- 328,334 ---- // and all edges of it if (trainTerminated == Terminated.NotYet) { ! for (int j = 0; j < vertexNbNeighbors[vertexId]; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of startVertex is " + neighborId); if (travelEdge(vertexId, neighborId, true)) { trainStartEdge[trainId] = j; // store edge *************** *** 349,356 **** trainVertexStack[trainId][trainStackPos[trainId]++] = vertexId; // push to stack ! for (int j = trainStartEdge[trainId] + 1; j < maxNeighbors; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of bottomVertex is " + neighborId); - if (neighborId == -1) break; // no more neighbors if (trainVisited[trainId][neighborId]) { log.debug(" RC: Hex already visited"); --- 364,370 ---- trainVertexStack[trainId][trainStackPos[trainId]++] = vertexId; // push to stack ! for (int j = trainStartEdge[trainId] + 1; j < vertexNbNeighbors[vertexId]; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of bottomVertex is " + neighborId); if (trainVisited[trainId][neighborId]) { log.debug(" RC: Hex already visited"); *************** *** 392,399 **** // 2a. visit neighbors, if train has not terminated if (trainTerminated == Terminated.NotYet) { ! for (int j = 0; j < maxNeighbors; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of " + vertexId + " is " + neighborId); - if (neighborId == -1) break; // no more neighbors if (trainVisited[trainId][neighborId]) { log.debug("RC: Hex already visited"); --- 406,412 ---- // 2a. visit neighbors, if train has not terminated if (trainTerminated == Terminated.NotYet) { ! for (int j = 0; j < vertexNbNeighbors[vertexId]; j++) { int neighborId = vertexNeighbors[vertexId][j]; log.debug("RC: Testing Neighbor Nr. " + j + " of " + vertexId + " is " + neighborId); if (trainVisited[trainId][neighborId]) { log.debug("RC: Hex already visited"); *************** *** 455,458 **** --- 468,480 ---- countVisits--; } + + // check blocks + for (int j=0; j < vertexNbBlocks[vertexId]; j++) { + if (vertexVisitSets[vertexId][j] != -1) { + trainVisited[trainId][vertexVisitSets[vertexId][j]] = arrive; + log.debug("RC: visited = " + arrive + " for vertex " + vertexVisitSets[vertexId][j] + " due to block rule"); + } + } + log.debug("RC: Count Visits = " + countVisits); return valueVertex; *************** *** 552,566 **** currentBestValue = totalValue; // exceed thus deep copy of vertex stack ! for (int j = 0; j <= finalTrain; j++) ! for (int v = 0; v < nbVertexes; v++) ! if (v < trainStackPos[j]) currentBestRun[j][v] = trainVertexStack[j][v]; ! else { currentBestRun[j][v] = -1; // terminator break; } log.info("RC: Found better run with " + totalValue); // inform revenue listener via adapter notifyRevenueAdapter(currentBestValue, false); } } --- 574,590 ---- currentBestValue = totalValue; // exceed thus deep copy of vertex stack ! for (int j = 0; j <= finalTrain; j++) { ! for (int v = 0; v < nbVertexes; v++) { ! if (v < trainStackPos[j]) { currentBestRun[j][v] = trainVertexStack[j][v]; ! } else { currentBestRun[j][v] = -1; // terminator break; } + } log.info("RC: Found better run with " + totalValue); // inform revenue listener via adapter notifyRevenueAdapter(currentBestValue, false); + } } } --- NEW FILE: RevenueBonusTemplate.java --- package rails.algorithms; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import rails.game.ConfigurationException; import rails.game.GameManagerI; import rails.game.MapHex; import rails.game.PhaseI; import rails.game.PhaseManager; import rails.game.TrainManager; import rails.game.TrainTypeI; import rails.util.Tag; /** * defines a template for a revenue bonus at creation time of rails objects * will be converted to a true RevenueBonus object during each revenue calculation * @author freystef */ public class RevenueBonusTemplate { protected static Logger log = Logger.getLogger(RevenueBonusTemplate.class.getPackage().getName()); // bonus value private final int value; // template condition attributes private final List<Integer> identVertices; private final List<String> identTrainTypes; private final List<String> identPhases; public RevenueBonusTemplate(Tag tag) throws ConfigurationException { value = tag.getAttributeAsInteger("value"); identVertices = new ArrayList<Integer>(); identTrainTypes = new ArrayList<String>(); identPhases = new ArrayList<String>(); // check for vertices List<Tag> vertexTags = tag.getChildren("Vertex"); if (vertexTags != null) { for (Tag vertexTag:vertexTags) { Integer id = vertexTag.getAttributeAsInteger("id"); if (id != null) { identVertices.add(id); } } } // check for train (types) List<Tag> trainTags = tag.getChildren("Train"); if (trainTags != null) { for (Tag trainTag:trainTags) { String type = trainTag.getAttributeAsString("type"); if (type != null) { identTrainTypes.add(type); } } } // check for phases List<Tag> phaseTags = tag.getChildren("phase"); if (phaseTags != null) { for (Tag phaseTag:phaseTags) { String type = phaseTag.getAttributeAsString("name"); if (type != null) { identPhases.add(type); } } } log.info("Created " + this); } public RevenueBonus toRevenueBonus(MapHex hex, GameManagerI gm, NetworkGraphBuilder ngb) { log.info("Convert " + this); RevenueBonus bonus = new RevenueBonus(value); if (!convertVertices(bonus, ngb, hex)) { log.info("Not all vertices found"); return null; } convertTrainTypes(bonus, gm.getTrainManager()); convertPhases(bonus, gm.getPhaseManager()); log.info("Converted to " + bonus); return bonus; } private boolean convertVertices(RevenueBonus bonus, NetworkGraphBuilder ngb, MapHex hex) { for (Integer identVertex:identVertices) { NetworkVertex vertex = ngb.getVertex(hex, identVertex); if (vertex == null) { return false; } else { bonus.addVertex(vertex); } } return true; } private void convertTrainTypes(RevenueBonus bonus, TrainManager tm) { for (String identTrainType:identTrainTypes) { TrainTypeI trainType = tm.getTypeByName(identTrainType); if (trainType != null) { bonus.addTrainType(trainType); } } } private void convertPhases(RevenueBonus bonus, PhaseManager pm) { for (String identPhase:identPhases) { PhaseI phase = pm.getPhaseByName(identPhase); if (phase != null) { bonus.addPhase(phase); } } } public String toString() { StringBuffer s = new StringBuffer(); s.append("RevenueBonusTemplate with value " + value); s.append(", identVertices = " + identVertices); s.append(", identTrainTypes = " + identTrainTypes); s.append(", identPhases = " + identPhases); return s.toString(); } } Index: NetworkIterator.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkIterator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NetworkIterator.java 27 Apr 2010 23:24:50 -0000 1.5 --- NetworkIterator.java 11 May 2010 21:47:21 -0000 1.6 *************** *** 28,32 **** private Map<NetworkVertex, greedyState> seen = new HashMap<NetworkVertex, greedyState>(); - private final PublicCompanyI company; private final Graph<NetworkVertex, NetworkEdge> graph; --- 28,31 ---- *************** *** 55,59 **** this.graph = graph; this.startVertex = startVertex; - this.company = company; } --- 54,57 ---- *************** *** 151,155 **** private void addUnseenChildrenOf(NetworkVertex vertex, boolean greedy) { ! if (company != null && !vertex.canCompanyRunThrough(company)) return; for (NetworkEdge edge : graph.edgesOf(vertex)) { --- 149,153 ---- private void addUnseenChildrenOf(NetworkVertex vertex, boolean greedy) { ! if (vertex.isSink()) return; for (NetworkEdge edge : graph.edgesOf(vertex)) { --- NEW FILE: RevenueBonus.java --- package rails.algorithms; import java.util.List; import java.util.ArrayList; import org.apache.log4j.Logger; import rails.game.PhaseI; import rails.game.TrainTypeI; public final class RevenueBonus { protected static Logger log = Logger.getLogger(RevenueBonus.class.getPackage().getName()); // bonus values private final int value; // internal attributes private List<NetworkVertex> vertices; private List<TrainTypeI> trainTypes; private List<PhaseI> phases; public RevenueBonus(int value) { this.value = value; vertices = new ArrayList<NetworkVertex>(); trainTypes = new ArrayList<TrainTypeI>(); phases = new ArrayList<PhaseI>(); } public void addVertex(NetworkVertex vertex) { vertices.add(vertex); } public void addTrainType(TrainTypeI trainType) { trainTypes.add(trainType); } public void addPhase(PhaseI phase) { phases.add(phase); } public int getValue() { return value; } public List<NetworkVertex> getVertices() { return vertices; } public List<TrainTypeI> getTrainTypes() { return trainTypes; } public List<PhaseI> getPhases() { return phases; } public boolean isSimpleBonus() { return (vertices.size() == 1); } public boolean checkSimpleBonus(NetworkVertex vertex, TrainTypeI trainType, PhaseI phase) { return (isSimpleBonus() && vertices.contains(vertex) && checkConditions(trainType, phase)); } public boolean checkConditions(TrainTypeI trainType, PhaseI phase) { boolean result = true; // check trainTypes if (!trainTypes.isEmpty()) { if (trainType == null) { result = false; } else { result = result && trainTypes.contains(trainType); } } // check phase if (!phases.isEmpty()) { if (phase == null) { result = false; } else { result = result && phases.contains(phase); } } return result; } @Override public String toString() { StringBuffer s = new StringBuffer(); s.append("RevenueBonus with value " + value); s.append(", vertices = " + vertices); s.append(", trainTypes = " + trainTypes); s.append(", phases = " + phases); return s.toString(); } } Index: RevenueAdapter.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueAdapter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RevenueAdapter.java 1 May 2010 16:07:05 -0000 1.9 --- RevenueAdapter.java 11 May 2010 21:47:21 -0000 1.10 *************** *** 11,23 **** import java.util.Map; - import org.apache.log4j.Logger; import org.jgrapht.Graphs; import org.jgrapht.graph.SimpleGraph; import rails.game.MapHex; import rails.game.PhaseI; import rails.game.PublicCompanyI; import rails.game.TrainI; import rails.ui.swing.hexmap.HexMap; --- 11,24 ---- import java.util.Map; import org.apache.log4j.Logger; import org.jgrapht.Graphs; import org.jgrapht.graph.SimpleGraph; + import rails.game.GameManagerI; import rails.game.MapHex; import rails.game.PhaseI; import rails.game.PublicCompanyI; import rails.game.TrainI; + import rails.game.TrainTypeI; import rails.ui.swing.hexmap.HexMap; *************** *** 28,35 **** --- 29,41 ---- Logger.getLogger(RevenueAdapter.class.getPackage().getName()); + private GameManagerI gameManager; + private NetworkGraphBuilder graphBuilder; + private PublicCompanyI company; + private PhaseI phase; private SimpleGraph<NetworkVertex, NetworkEdge> graph; private RevenueCalculator rc; private int maxNeighbors; + private int maxBlocks; private List<NetworkVertex> vertexes; *************** *** 37,56 **** private List<NetworkVertex> startVertexes; private List<NetworkTrain> trains; // revenue listener private RevenueListener revenueListener; - ! public RevenueAdapter(SimpleGraph<NetworkVertex, NetworkEdge> graph){ ! this.graph = graph; this.vertexes = new ArrayList<NetworkVertex>(graph.vertexSet()); this.edges = new ArrayList<NetworkEdge>(graph.edgeSet()); this.trains = new ArrayList<NetworkTrain>(); this.startVertexes = new ArrayList<NetworkVertex>(); } public void initRevenueCalculator(){ if (rc == null) { // define the maximum number of vertexes maxNeighbors = 0; --- 43,136 ---- private List<NetworkVertex> startVertexes; private List<NetworkTrain> trains; + private Map<NetworkVertex, List<NetworkVertex>> vertexVisitSets; + private List<RevenueBonus> revenueBonuses; // revenue listener private RevenueListener revenueListener; ! public RevenueAdapter(GameManagerI gameManager, NetworkGraphBuilder graphBuilder, PublicCompanyI company){ ! this.gameManager = gameManager; ! this.graphBuilder = graphBuilder; + this.graph = NetworkGraphBuilder.optimizeGraph(graphBuilder.getRailRoadGraph(company)); this.vertexes = new ArrayList<NetworkVertex>(graph.vertexSet()); this.edges = new ArrayList<NetworkEdge>(graph.edgeSet()); this.trains = new ArrayList<NetworkTrain>(); this.startVertexes = new ArrayList<NetworkVertex>(); + this.vertexVisitSets = new HashMap<NetworkVertex, List<NetworkVertex>>(); + this.revenueBonuses = new ArrayList<RevenueBonus>(); + } + + private void defineRevenueBonuses() { + // check each vertex hex for a potential revenue bonus + for (NetworkVertex vertex:vertexes) { + MapHex hex = vertex.getHex(); + if (hex == null) continue; + + List<RevenueBonusTemplate> bonuses = new ArrayList<RevenueBonusTemplate>(); + List<RevenueBonusTemplate> hexBonuses = hex.getRevenueBonuses(); + if (hexBonuses != null) bonuses.addAll(hexBonuses); + // List<RevenueBonusTemplate> tileBonuses = hex.getCurrentTile().getRevenueBonuses(); + // if (tileBonuses != null) bonuses.addAll(hexBonuses); + + if (bonuses == null) continue; + for (RevenueBonusTemplate bonus:bonuses) { + revenueBonuses.add(bonus.toRevenueBonus(hex, gameManager, graphBuilder)); + } + } + log.info("RevenueBonuses = " + revenueBonuses); } + private int defineVertexVisitSets() { + // define map of all locationNames + Map<String, List<NetworkVertex>> locations = new HashMap<String, List<NetworkVertex>>(); + for (NetworkVertex vertex:vertexes) { + String ln = vertex.getCityName(); + if (ln == null) continue; + if (locations.containsKey(ln)) { + locations.get(ln).add(vertex); + } else { + List<NetworkVertex> v = new ArrayList<NetworkVertex>(); + v.add(vertex); + locations.put(ln, v); + } + } + log.info("Locations = " + locations); + // transfer those locationNames to vertexBlocks + int maxBlocks = 0; + for (List<NetworkVertex> location:locations.values()) { + if (location.size() >= 2) { + for (NetworkVertex vertex:location){ + if (vertexVisitSets.containsKey(vertex)) { + for (NetworkVertex v:location) { + if (v != vertex && !vertexVisitSets.get(vertex).contains(v)) { + vertexVisitSets.get(vertex).add(v); + } + } + } else { + List<NetworkVertex> blocks = new ArrayList<NetworkVertex>(); + for (NetworkVertex v:location) { + if (v != vertex) { + blocks.add(v); + } + } + vertexVisitSets.put(vertex, blocks); + } + } + maxBlocks = Math.max(maxBlocks, location.size()); + } + } + log.info("RA: Block of " + vertexVisitSets + ", maxBlocks = " + maxBlocks); + return maxBlocks; + } + public void initRevenueCalculator(){ if (rc == null) { + // define blocks and return those + maxBlocks = defineVertexVisitSets(); + + // define revenueBonuses + defineRevenueBonuses(); + // define the maximum number of vertexes maxNeighbors = 0; *************** *** 59,63 **** maxNeighbors = Math.max(maxNeighbors, graph.edgesOf(vertex).size()); ! this.rc = new RevenueCalculator(this, vertexes.size(), ++maxNeighbors, trains.size()); // increase maxEdges to allow for cutoff } } --- 139,144 ---- maxNeighbors = Math.max(maxNeighbors, graph.edgesOf(vertex).size()); ! log.info("maxNeighbors = " + maxNeighbors); ! this.rc = new RevenueCalculator(this, vertexes.size(), maxNeighbors, maxBlocks, trains.size()); } } *************** *** 67,83 **** // refresh startVertexes this.startVertexes = new ArrayList<NetworkVertex>(); ! } ! ! ! private int[] revenueList(List<NetworkVertex> vertexes, int maxLength) { ! Collections.sort(vertexes, new NetworkVertex.ValueOrder()); ! ! int[] revenue = new int[maxLength + 1]; ! revenue[0] = 0; ! for (int j=1; j <= maxLength; j++) { ! revenue[j] = revenue[j-1] + vertexes.get(j-1).getValue(); ! } ! ! return revenue; } --- 148,153 ---- // refresh startVertexes this.startVertexes = new ArrayList<NetworkVertex>(); ! // refresh revenueBonuses ! this.revenueBonuses = new ArrayList<RevenueBonus>(); } *************** *** 88,93 **** List<NetworkVertex> towns = new ArrayList<NetworkVertex>(); for (NetworkVertex vertex: vertexes) { ! if (vertex.isCityType()) cities.add(vertex); ! if (vertex.isTownType()) towns.add(vertex); } --- 158,163 ---- List<NetworkVertex> towns = new ArrayList<NetworkVertex>(); for (NetworkVertex vertex: vertexes) { ! if (vertex.isMajor()) cities.add(vertex); ! if (vertex.isMinor()) towns.add(vertex); } *************** *** 98,131 **** int maxCityLength = 0, maxTownLength = 0; for (NetworkTrain train: trains) { ! int trainTowns = train.getTowns(); ! if (train.getCities() > maxCities) { ! trainTowns = trainTowns+ train.getCities() - maxCities; ! train.setCities(maxCities); } ! train.setTowns(Math.min(trainTowns, maxTowns)); ! maxCityLength = Math.max(maxCityLength, train.getCities()); ! maxTownLength = Math.max(maxTownLength, train.getTowns()); } - // if (activatePrediction) { - // // get max revenue results - // int[] maxCityRevenues = revenueList(cities, maxCityLength); - // int[] maxTownRevenues = revenueList(towns, maxTownLength); - // - // // set revenue results in revenue calculator - // rc.setPredictionData(maxCityRevenues, maxTownRevenues); - // } } ! ! public void populateRevenueCalculator(PublicCompanyI company, PhaseI phase, boolean activatePrediction){ if (rc == null) initRevenueCalculator(); ! // prepare and optionaly activate revenue prediction prepareRevenuePrediction(activatePrediction); // Define ordering on vertexes by value ! NetworkVertex.setPhaseForAll(vertexes, phase); Collections.sort(vertexes, new NetworkVertex.ValueOrder()); --- 168,195 ---- int maxCityLength = 0, maxTownLength = 0; for (NetworkTrain train: trains) { ! int trainTowns = train.getMinors(); ! if (train.getMajors() > maxCities) { ! trainTowns = trainTowns+ train.getMajors() - maxCities; ! train.setMajors(maxCities); } ! train.setMinors(Math.min(trainTowns, maxTowns)); ! maxCityLength = Math.max(maxCityLength, train.getMajors()); ! maxTownLength = Math.max(maxTownLength, train.getMinors()); } } ! public void populateRevenueCalculator(PhaseI phase, boolean activatePrediction){ ! // store phase ! this.phase = phase; ! if (rc == null) initRevenueCalculator(); ! // prepare and optionally activate revenue prediction prepareRevenuePrediction(activatePrediction); // Define ordering on vertexes by value ! NetworkVertex.initAllRailsVertices(vertexes, company, phase); Collections.sort(vertexes, new NetworkVertex.ValueOrder()); *************** *** 133,155 **** NetworkVertex v = vertexes.get(id); if (v.isHQ()) { ! // HQ is not added to list, but used to assign startVertexes startVertexes.addAll(Graphs.neighborListOf(graph, v)); ! } else { ! // prepare values ! int value = v.getValue(); ! boolean city = v.isCityType(); ! boolean town = v.isTownType(); ! int j = 0, e[] = new int[maxNeighbors]; ! if (v.canCompanyRunThrough(company)) { ! for (NetworkVertex n:Graphs.neighborListOf(graph, v)){ ! if (!n.isHQ()) { ! e[j++] = vertexes.lastIndexOf(n); ! } ! } } // sort by value order ! Arrays.sort(e, 0, j); ! e[j] = -1; // stop ! rc.setVertex(id, value, city, town, e); } } --- 197,230 ---- NetworkVertex v = vertexes.get(id); if (v.isHQ()) { ! // HQ is not added to list, but used to assign startVertexes startVertexes.addAll(Graphs.neighborListOf(graph, v)); ! continue; ! } ! // add to revenue calculator ! v.addToRevenueCalculator(rc, id); ! for (int trainId=0; trainId < trains.size(); trainId++) { ! NetworkTrain train = trains.get(trainId); ! rc.setVertexValue(id, trainId, getVertexValue(v, train, phase)); ! } ! ! // set neighbors ! if (!v.isSink()) { ! List<NetworkVertex> neighbors = Graphs.neighborListOf(graph, v); ! int j=0, neighborsArray[] = new int[neighbors.size()]; ! for (NetworkVertex n:neighbors){ ! neighborsArray[j++] = vertexes.indexOf(n); } // sort by value order ! neighborsArray = Arrays.copyOfRange(neighborsArray, 0, j); ! Arrays.sort(neighborsArray); ! rc.setVertexNeighbors(id, neighborsArray); ! } ! // set blocks ! if (vertexVisitSets.containsKey(v)) { ! int b = 0, blocks[] = new int[vertexVisitSets.get(v).size()]; ! for (NetworkVertex n: vertexVisitSets.get(v)) { ! blocks[b++] = vertexes.indexOf(n); ! } ! rc.setVertexVisitSets(id, blocks); } } *************** *** 162,166 **** Arrays.sort(sv); // sort by value order rc.setStartVertexes(sv); ! // set edges for (int id=0; id < edges.size(); id++) { --- 237,241 ---- Arrays.sort(sv); // sort by value order rc.setStartVertexes(sv); ! // set edges for (int id=0; id < edges.size(); id++) { *************** *** 182,233 **** train.addToRevenueCalculator(rc, id); } } public void addDefaultTrain(int cities) { String trainName = Integer.valueOf(cities).toString(); ! NetworkTrain train =new NetworkTrain(cities, 0, false, 1, 1, trainName); trains.add(train); } public void addTrain(TrainI railsTrain){ ! int cities = railsTrain.getMajorStops(); ! int towns = railsTrain.getMinorStops(); ! boolean townsCostNothing = (railsTrain.getTownCountIndicator() == 0); ! int multiplyCities = railsTrain.getCityScoreFactor(); ! int multiplyTowns = railsTrain.getTownScoreFactor(); ! String trainName = railsTrain.getName(); ! ! if (cities > 0 || towns > 0) { // protection against pullman ! NetworkTrain networkTrain = new NetworkTrain(cities, towns, townsCostNothing, multiplyCities, multiplyTowns, trainName); ! trains.add(networkTrain); ! } } public void addTrainByString(String trainString) { String t = trainString.trim(); ! ! int cities = 0; int towns = 0; boolean ignoreTowns = false; int multiplyCities = 1; int multiplyTowns = 1; ! if (t.equals("D")) { ! cities = 99; // diesel ! } else if (t.contains("+")) { ! cities = Integer.parseInt(t.split("\\+")[0]); // + train ! towns = Integer.parseInt(t.split("\\+")[1]); ! } else if (t.contains("E")) { ! // express train ! cities = Integer.parseInt(t.replace("E", "")); ! ignoreTowns = true; ! multiplyTowns = 0; ! } else if (t.contains("D")) { ! // double (express) train ! cities = Integer.parseInt(t.replace("D", "")); ! ignoreTowns = true; ! multiplyCities = 2; ! multiplyTowns = 0; ! } else { ! // default train ! cities = Integer.parseInt(t); } - NetworkTrain networkTrain = new NetworkTrain(cities, towns, ignoreTowns, multiplyCities, multiplyTowns, t); - trains.add(networkTrain); } --- 257,322 ---- train.addToRevenueCalculator(rc, id); } + + } + public int getVertexValue(NetworkVertex vertex, NetworkTrain train, PhaseI phase) { + + // base value + int value = vertex.getValueByTrain(train); + + // add potential revenueBonuses + for (RevenueBonus bonus:revenueBonuses) { + if (bonus.checkSimpleBonus(vertex, train.getRailsTrainType(), phase)) { + value += bonus.getValue(); + } + } + + return value; + } + public void addDefaultTrain(int cities) { String trainName = Integer.valueOf(cities).toString(); ! NetworkTrain train =new NetworkTrain(cities, 0, false, 1, 1, trainName, null); trains.add(train); } public void addTrain(TrainI railsTrain){ ! NetworkTrain train = NetworkTrain.createFromRailsTrain(railsTrain); ! if (train != null) trains.add(train); } public void addTrainByString(String trainString) { String t = trainString.trim(); ! TrainTypeI trainType = gameManager.getTrainManager().getTypeByName(trainString); ! if (trainType != null) { // string defines available trainType ! TrainI railsTrain = trainType.cloneTrain(); ! addTrain(railsTrain); ! log.info("RA: found trainType" + trainType); ! } else { // otherwise interpret the train ! int cities = 0; int towns = 0; boolean ignoreTowns = false; int multiplyCities = 1; int multiplyTowns = 1; ! if (t.equals("D")) { ! cities = 99; // diesel ! } else if (t.contains("+")) { ! cities = Integer.parseInt(t.split("\\+")[0]); // + train ! towns = Integer.parseInt(t.split("\\+")[1]); ! } else if (t.contains("E")) { ! // express train ! cities = Integer.parseInt(t.replace("E", "")); ! ignoreTowns = true; ! multiplyTowns = 0; ! } else if (t.contains("D")) { ! // double (express) train ! cities = Integer.parseInt(t.replace("D", "")); ! ignoreTowns = true; ! multiplyCities = 2; ! multiplyTowns = 0; ! } else { ! // default train ! cities = Integer.parseInt(t); ! } ! NetworkTrain networkTrain = new NetworkTrain(cities, towns, ignoreTowns, multiplyCities, multiplyTowns, t, null); ! trains.add(networkTrain); } } *************** *** 236,239 **** --- 325,332 ---- } + public void addRevenueBonus(RevenueBonus bonus) { + revenueBonuses.add(bonus); + } + public Map<NetworkTrain, List<NetworkVertex>> getOptimalRun() { int[][] optimalRunRaw = rc.getOptimalRun(); *************** *** 287,290 **** --- 380,384 ---- } + public String getOptimalRunPrettyPrint() { StringBuffer runPrettyPrint = new StringBuffer(); *************** *** 310,316 **** runPrettyPrint.append(","); } ! runPrettyPrint.append(vertex.getVertexName()); } ! runPrettyPrint.append(")\n"); } return runPrettyPrint.toString(); --- 404,417 ---- runPrettyPrint.append(","); } ! if (vertex.isStation()) { ! runPrettyPrint.append(getVertexValue(vertex, train, phase)); ! } else { ! runPrettyPrint.append(currentHex.getOrientationName(vertex.getSide())); ! } } ! if (currentHex != null) { ! runPrettyPrint.append(")"); ! } ! runPrettyPrint.append("\n"); } return runPrettyPrint.toString(); Index: NetworkGraphBuilder.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/NetworkGraphBuilder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NetworkGraphBuilder.java 1 May 2010 16:07:05 -0000 1.8 --- NetworkGraphBuilder.java 11 May 2010 21:47:21 -0000 1.9 *************** *** 20,24 **** import org.jgrapht.Graphs; import org.jgrapht.ext.JGraphModelAdapter; - import org.jgrapht.graph.Multigraph; import org.jgrapht.graph.SimpleGraph; import org.jgrapht.graph.Subgraph; --- 20,23 ---- *************** *** 30,33 **** --- 29,33 ---- import rails.game.BaseToken; import rails.game.City; + import rails.game.GameManagerI; import rails.game.MapHex; import rails.game.PublicCompanyI; *************** *** 44,48 **** --- 44,50 ---- private SimpleGraph<NetworkVertex, NetworkEdge> mapGraph; + private Map<String, NetworkVertex> mapVertexes; + private NetworkIterator iterator; *************** *** 51,55 **** } ! public void generateGraph(List<MapHex> mHexes) { mapGraph = new SimpleGraph<NetworkVertex, NetworkEdge>(NetworkEdge.class); --- 53,57 ---- } ! public void generateGraph(List<MapHex> mHexes ) { mapGraph = new SimpleGraph<NetworkVertex, NetworkEdge>(NetworkEdge.class); *************** *** 67,71 **** mapGraph.addVertex(stationVertex); mapVertexes.put(stationVertex.getIdentifier(), stationVertex); ! log.debug("Added " + stationVertex + " / " + stationVertex.printTokens()); } --- 69,73 ---- mapGraph.addVertex(stationVertex); mapVertexes.put(stationVertex.getIdentifier(), stationVertex); ! log.info("Added " + stationVertex); } *************** *** 76,80 **** mapGraph.addVertex(sideVertex); mapVertexes.put(sideVertex.getIdentifier(), sideVertex); ! log.debug("Added " + sideVertex); } } --- 78,82 ---- mapGraph.addVertex(sideVertex); mapVertexes.put(sideVertex.getIdentifier(), sideVertex); ! log.info("Added " + sideVertex); } } *************** *** 91,95 **** NetworkVertex startVertex = getVertexRotated(hex, points[0]); NetworkVertex endVertex = getVertexRotated(hex, points[1]); ! log.debug("Track: " + track); NetworkEdge edge = new NetworkEdge(startVertex, endVertex, false); if (startVertex == endVertex) { --- 93,97 ---- NetworkVertex startVertex = getVertexRotated(hex, points[0]); NetworkVertex endVertex = getVertexRotated(hex, points[1]); ! log.info("Track: " + track); NetworkEdge edge = new NetworkEdge(startVertex, endVertex, false); if (startVertex == endVertex) { *************** *** 97,101 **** } else { mapGraph.addEdge(startVertex, endVertex, edge); ! log.debug("Added edge " + edge.getConnection()); } } --- 99,103 ---- } else { mapGraph.addEdge(startVertex, endVertex, edge); ! log.info("Added edge " + edge.getConnection()); } } *************** *** 106,110 **** MapHex neighborHex = hex.getNeighbor(side); if (neighborHex == null) { ! log.debug("No connection for Hex " + hex.getName() + " at " + hex.getOrientationName(side) + ", No Neighbor"); continue; --- 108,112 ---- MapHex neighborHex = hex.getNeighbor(side); if (neighborHex == null) { ! log.info("No connection for Hex " + hex.getName() + " at " + hex.getOrientationName(side) + ", No Neighbor"); continue; *************** *** 112,123 **** NetworkVertex otherVertex = getVertex(neighborHex, side + 3); if (vertex == null && otherVertex == null){ ! log.debug("Hex " + hex.getName() + " has no track at " + hex.getOrientationName(side)); ! log.debug("And Hex " + neighborHex.getName() + " has no track at " + neighborHex.getOrientationName(side + 3)); continue; } else if (vertex == null && otherVertex != null) { ! log.debug("Deadend connection for Hex " + neighborHex.getName() + " at " + neighborHex.getOrientationName(side + 3) + ", NeighborHex " + hex.getName() + " has no track at side " + --- 114,125 ---- NetworkVertex otherVertex = getVertex(neighborHex, side + 3); if (vertex == null && otherVertex == null){ ! log.info("Hex " + hex.getName() + " has no track at " + hex.getOrientationName(side)); ! log.info("And Hex " + neighborHex.getName() + " has no track at " + neighborHex.getOrientationName(side + 3)); continue; } else if (vertex == null && otherVert... [truncated message content] |
From: Stefan F. <ste...@us...> - 2010-05-11 21:47:30
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14662/data/1889 Modified Files: Game.xml Map.xml Log Message: Added VertexVisitedSets and RevenueBonuses, several other improvements to the RC Index: Map.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Map.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Map.xml 3 Feb 2010 20:01:28 -0000 1.2 --- Map.xml 11 May 2010 21:47:21 -0000 1.3 *************** *** 24,28 **** <Hex name="E8" tile="0"/> ! <Hex name="F1" tile="-902" orientation="2" value="30,60,100" city="Imabari"/> <!-- TODO: 3rd value is for diesel only--> <Hex name="F3" tile="-10" city="Saijou"/> <Hex name="F5" tile="0" cost="80"/> --- 24,30 ---- <Hex name="E8" tile="0"/> ! <Hex name="F1" tile="-902" orientation="2" value="30,60" city="Imabari"> ! <RevenueBonus value="40"> <Vertex id="-1"/> <Train type="D"/> </RevenueBonus> ! </Hex> <Hex name="F3" tile="-10" city="Saijou"/> <Hex name="F5" tile="0" cost="80"/> *************** *** 51,55 **** <Hex name="I12" tile="-1" city="Muki"/> ! <Hex name="J1" tile="-902" orientation="2" value="20,40,80" city="Sakaide & Okoyama"/> <!-- TODO: 3rd value is for diesel only--> <Hex name="J3" tile="0"/> <Hex name="J5" tile="-1" city="Ritsurin Kouen"/> --- 53,59 ---- <Hex name="I12" tile="-1" city="Muki"/> ! <Hex name="J1" tile="-902" orientation="2" value="20,40" city="Sakaide & Okoyama"> ! <RevenueBonus value="40"> <Vertex id="-1"/> <Train type="D"/> </RevenueBonus> ! </Hex> <Hex name="J3" tile="0"/> <Hex name="J5" tile="-1" city="Ritsurin Kouen"/> *************** *** 62,66 **** <Hex name="K8" tile="-10" city="Tokushima"/> ! <Hex name="L7" tile="-902" orientation="3" value="20,40,80" city="Naruto & Awaji"/> <!-- TODO: 3rd value is for diesel only--> </Map> --- 66,72 ---- <Hex name="K8" tile="-10" city="Tokushima"/> ! <Hex name="L7" tile="-902" orientation="3" value="20,40" city="Naruto & Awaji"> ! <RevenueBonus value="40"> <Vertex id="-1"/> <Train type="D"/> </RevenueBonus> ! </Hex> </Map> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Game.xml 23 Feb 2010 22:38:01 -0000 1.8 --- Game.xml 11 May 2010 21:47:21 -0000 1.9 *************** *** 129,135 **** <Phase name="D"> <Tiles colour="yellow,green,brown"/> - <!-- TODO: Offboard revenue only for diesels changes, other trains remain at step 2, - but not relevant as long as revenue calculation is not supported. --> - <OffBoardRevenue step="3"/> </Phase> </Component> --- 129,132 ---- |
From: Stefan F. <ste...@us...> - 2010-05-11 21:47:29
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14662/rails/game Modified Files: TrainType.java MapHex.java Station.java Tile.java Log Message: Added VertexVisitedSets and RevenueBonuses, several other improvements to the RC Index: TrainType.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TrainType.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TrainType.java 4 Mar 2010 22:08:09 -0000 1.31 --- TrainType.java 11 May 2010 21:47:21 -0000 1.32 *************** *** 497,499 **** --- 497,503 ---- b.append(text); } + + public String toString() { + return name; + } } Index: Tile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Tile.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Tile.java 4 Apr 2010 22:02:53 -0000 1.38 --- Tile.java 11 May 2010 21:47:21 -0000 1.39 *************** *** 127,131 **** if (stationTags != null) { tracksPerStation = new HashMap<Integer, List<Track>>(); ! String sid, type; int number, value, slots, position; Station station; --- 127,131 ---- if (stationTags != null) { tracksPerStation = new HashMap<Integer, List<Track>>(); ! String sid, type, cityName; int number, value, slots, position; Station station; *************** *** 149,155 **** slots = stationTag.getAttributeAsInteger("slots", 0); position = stationTag.getAttributeAsInteger("position", 0); station = new Station(this, number, sid, type, value, slots, ! position); stations.add(station); stationMap.put(sid, station); --- 149,156 ---- slots = stationTag.getAttributeAsInteger("slots", 0); position = stationTag.getAttributeAsInteger("position", 0); + cityName = stationTag.getAttributeAsString("city"); station = new Station(this, number, sid, type, value, slots, ! position, cityName); stations.add(station); stationMap.put(sid, station); Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** MapHex.java 15 Apr 2010 19:49:02 -0000 1.43 --- MapHex.java 11 May 2010 21:47:21 -0000 1.44 *************** *** 8,11 **** --- 8,12 ---- import org.apache.log4j.Logger; + import rails.algorithms.RevenueBonusTemplate; import rails.game.action.LayTile; import rails.game.model.ModelObject; *************** *** 108,111 **** --- 109,115 ---- /** Tokens that are not bound to a Station (City), such as Bonus tokens */ protected List<TokenI> offStationTokens; + + /** Storage of revenueBonus that are bound to the hex */ + protected List<RevenueBonusTemplate> revenueBonuses = null; protected MapManager mapManager = null; *************** *** 193,197 **** setBlockedForTokenLays(tag.getAttributeAsBoolean("unlaidHomeBlocksTokens", false)); } ! } --- 197,209 ---- setBlockedForTokenLays(tag.getAttributeAsBoolean("unlaidHomeBlocksTokens", false)); } ! ! // revenue bonus ! List<Tag> bonusTags = tag.getChildren("RevenueBonus"); ! if (bonusTags != null) { ! revenueBonuses = new ArrayList<RevenueBonusTemplate>(); ! for (Tag bonusTag:bonusTags) { ! revenueBonuses.add(new RevenueBonusTemplate(bonusTag)); ! } ! } } *************** *** 892,895 **** --- 904,917 ---- return mCities.get(cityNumber); } + + public City getRelatedCity(Station station) { + City foundCity = null; + for (City city:mCities.values()) { + if (station == city.getRelatedStation()) { + foundCity = city; + } + } + return foundCity; + } public void addHome(PublicCompanyI company, int cityNumber) { *************** *** 1037,1040 **** --- 1059,1066 ---- } + public List<RevenueBonusTemplate> getRevenueBonuses() { + return revenueBonuses; + } + public boolean equals(MapHex hex) { if (hex.getName().equals(getName()) && hex.row == row Index: Station.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Station.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Station.java 25 Sep 2009 19:13:01 -0000 1.11 --- Station.java 11 May 2010 21:47:21 -0000 1.12 *************** *** 31,34 **** --- 31,35 ---- private TileI tile; private int position; + private String cityName; private int x; private int y; *************** *** 55,59 **** public Station(TileI tile, int number, String id, String type, int value, ! int slots, int position) { this.tile = tile; this.number = number; --- 56,60 ---- public Station(TileI tile, int number, String id, String type, int value, ! int slots, int position, String cityName) { this.tile = tile; this.number = number; *************** *** 63,66 **** --- 64,68 ---- this.baseSlots = slots; this.position = position; + this.cityName = cityName; convertPosition(); // log.debug(toString()+": x="+x+" y="+y); *************** *** 71,74 **** --- 73,80 ---- + tile.getName(); } + + public String getCityName() { + return cityName; + } /** |
From: Erik V. <ev...@us...> - 2010-05-11 19:48:48
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv28854/data/1856 Modified Files: StockMarket.xml Log Message: Fixed typo that prevented 1856 companies to close on stock space B11 Index: StockMarket.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/StockMarket.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StockMarket.xml 31 Jan 2010 22:15:59 -0000 1.6 --- StockMarket.xml 11 May 2010 19:48:38 -0000 1.7 *************** *** 34,38 **** <StockSpace name="B10" price="30" type="orange"/> <StockSpace name="B11" price="0"> ! <closesCompany/> </StockSpace> <StockSpace name="C1" price="80" /> --- 34,38 ---- <StockSpace name="B10" price="30" type="orange"/> <StockSpace name="B11" price="0"> ! <ClosesCompany/> </StockSpace> <StockSpace name="C1" price="80" /> |
From: Erik V. <ev...@us...> - 2010-05-09 22:00:35
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20479/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Fixed message (parameter missing) Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** StockRound_18EU.java 2 Apr 2010 20:03:54 -0000 1.37 --- StockRound_18EU.java 9 May 2010 22:00:26 -0000 1.38 *************** *** 419,422 **** --- 419,423 ---- cert2.getShare(), company.getName(), + ipo.getName(), minor.getName() )); } else { |
From: Freek D. <mac...@us...> - 2010-05-08 22:05:34
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24020 Modified Files: build.xml Log Message: Add jgraph and junit libraries to class path Index: build.xml =================================================================== RCS file: /cvsroot/rails/18xx/build.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** build.xml 4 Apr 2010 22:46:20 -0000 1.18 --- build.xml 8 May 2010 22:05:26 -0000 1.19 *************** *** 21,24 **** --- 21,25 ---- <pathelement location="lib/jgraph5/jgraph.jar"/> <pathelement location="lib/jgrapht-0.7.3/jgrapht-jdk1.5.jar"/> + <pathelement location="lib/junit_3.8.2/junit.jar"/> </path> <target depends="clean" name="init"> *************** *** 107,111 **** <manifest> <attribute name="Main-Class" value="rails.util.RunGame" /> ! <attribute name="Class-Path" value="./my.properties ./LocalisedText.properties ./lib/log4j-1.2/log4j-1.2.14.jar ./lib/batik-1.6/lib/batik-transcoder.jar ./lib/batik-1.6/batik.jar ./lib/batik-1.6/lib/batik-util.jar ./lib/batik-1.6/lib/batik-script.jar ./lib/batik-1.6/lib/batik-bridge.jar ./lib/batik-1.6/lib/batik-ext.jar ./lib/batik-1.6/lib/batik-awt-util.jar ./lib/batik-1.6/lib/batik-dom.jar ./lib/batik-1.6/lib/batik-gvt.jar" /> </manifest> </jar> --- 108,112 ---- <manifest> <attribute name="Main-Class" value="rails.util.RunGame" /> ! <attribute name="Class-Path" value="./my.properties ./LocalisedText.properties ./lib/log4j-1.2/log4j-1.2.14.jar ./lib/batik-1.6/lib/batik-transcoder.jar ./lib/batik-1.6/batik.jar ./lib/batik-1.6/lib/batik-util.jar ./lib/batik-1.6/lib/batik-script.jar ./lib/batik-1.6/lib/batik-bridge.jar ./lib/batik-1.6/lib/batik-ext.jar ./lib/batik-1.6/lib/batik-awt-util.jar ./lib/batik-1.6/lib/batik-dom.jar ./lib/batik-1.6/lib/batik-gvt.jar ./lib/jgraph5/jgraph.jar ./lib/jgrapht-0.7.3/jgrapht-jdk1.5.jar" /> </manifest> </jar> |
From: Erik V. <ev...@us...> - 2010-05-08 14:52:58
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6806/data Modified Files: GamesList.xml Log Message: 1835 marked "Almost playable". Description updated. Sequence reorganized to put games in playability order. Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GamesList.xml 8 May 2010 14:23:21 -0000 1.33 --- GamesList.xml 8 May 2010 14:52:50 -0000 1.34 *************** *** 2,17 **** <!-- Supported games --> <GamesList> - <Game name="1825"> - <Note>Experimental</Note> - <Description>1825 Unit 1 - (c) 1994 Hartland Trefoil Ltd. - Designed by Francis Tresham - - Limitation: - - No random assignment of private companies (players should do this off-line and enter the result) - </Description> - <Players minimum="3" maximum="5" /><Option name="UnlimitedTiles" type="toggle" default="no"> - </Option> - </Game> <Game name="1830"> <Note>Fully playable</Note> --- 2,5 ---- *************** *** 42,73 **** <Players minimum="3" maximum="6"/> </Game> - <Game name="1835"> - <Note>Partly playable</Note> - <Description>1835 (Germany) - Designed by Michael Meier-Bachl - Published 1990 by Hans im Glück Verlag - - Initial version. - Rules not yet implemented include: - - Sequential availability of companies. All companies are buyable from the start, including the Prussian. - - Prussian formation. - - Distance-based token cost. - - ... etc. - - For the start packet sale, three variants have been implemented: - - Standard - - Clemens - - Snake - Variant selection effects on SR and OR have not been implemented yet. - </Description> - <Option name="Variant" values="Standard,Clemens,Snake"/> - <Option name="NoMapMode" type="toggle" default="no" /> - <Option name="UnlimitedTiles" type="toggle" default="no"/> - <Option name="BYFloatsAt" values="50%,20%" default="50%"/> - <Option name="LDIncome" values="20M,30M" default="20M"/> - <Option name="MinorsRequireFloatedBY" type="toggle" default="no"/> - <Players minimum="3" maximum="7"/> - </Game> <Game name="1851"> <Note>Fully playable</Note> --- 30,34 ---- *************** *** 83,86 **** --- 44,48 ---- <Players minimum="3" maximum="5"/> </Game> + <Game name="1856"> <Note>Fully playable</Note> *************** *** 98,114 **** <Players minimum="3" maximum="6"/> </Game> - <Game name="1870"> - <Note>Partly playable</Note> - <Description>1870 - Railroading across the Trans Mississippi - (c) 1992, 1995 Mayfair Games, Inc. - Designed by Bill Dixon - Aspects not present in 1830 have not been implemented yet. - </Description> - <Option name="UnlimitedTiles" type="toggle" default="no"/> - <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> - <Players minimum="2" maximum="6"/> - </Game> - <Game name="1889"> <Note>Fully playable</Note> --- 60,64 ---- *************** *** 127,131 **** </Game> ! <Game name="18AL"> <Note>Fully playable</Note> <Description>18AL - The Railroads come to Alabama --- 77,81 ---- </Game> ! <Game name="18AL"> <Note>Fully playable</Note> <Description>18AL - The Railroads come to Alabama *************** *** 144,147 **** --- 94,98 ---- <Players minimum="3" maximum="5"/> </Game> + <Game name="18EU"> <Note>Fully playable</Note> *************** *** 159,162 **** --- 110,114 ---- <Players minimum="2" maximum="6"/> </Game> + <Game name="18Kaas"> <Note>Fully playable</Note> *************** *** 173,176 **** --- 125,180 ---- <Players minimum="3" maximum="6"/> </Game> + + <Game name="1835"> + <Note>Almost playable</Note> + <Description>1835 (Germany) + Designed by Michael Meier-Bachl + Published 1990 by Hans im Glück Verlag + + Three variants have been implemented: + - Standard + - Clemens + - Snake + + Known bugs: + - Game hangs in OR if Start Packet has not been sold and minors run. + Workaround: select option "Minors don't run if BY has not floated". + - OBB and PfB do not always close when required. + Workaround: use Correction mode. + </Description> + <Option name="Variant" values="Standard,Clemens,Snake"/> + <Option name="NoMapMode" type="toggle" default="no" /> + <Option name="UnlimitedTiles" type="toggle" default="no"/> + <Option name="BYFloatsAt" values="50%,20%" default="50%"/> + <Option name="LDIncome" values="20M,30M" default="20M"/> + <Option name="MinorsRequireFloatedBY" type="toggle" default="no"/> + <Players minimum="3" maximum="7"/> + </Game> + + <Game name="1870"> + <Note>Partly playable</Note> + <Description>1870 - Railroading across the Trans Mississippi + (c) 1992, 1995 Mayfair Games, Inc. + Designed by Bill Dixon + + Aspects not present in 1830 have not been implemented yet. + </Description> + <Option name="UnlimitedTiles" type="toggle" default="no"/> + <Option name="LeaveAuctionOnPass" type="toggle" default="no"/> + <Players minimum="2" maximum="6"/> + </Game> + + <Game name="1825"> + <Note>Experimental</Note> + <Description>1825 Unit 1 + (c) 1994 Hartland Trefoil Ltd. + Designed by Francis Tresham + + Limitation: + - No random assignment of private companies (players should do this off-line and enter the result) + </Description> + <Players minimum="3" maximum="5" /><Option name="UnlimitedTiles" type="toggle" default="no"> + </Option> + </Game> <Credits>Rails is a computer implementation of a number of railroad board games, |
From: Erik V. <ev...@us...> - 2010-05-08 14:33:40
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv4573/rails/game/specific/_1835 Modified Files: OperatingRound_1835.java Log Message: Honoured option: Minors don't run if BY has not floated Index: OperatingRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/OperatingRound_1835.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OperatingRound_1835.java 8 May 2010 13:57:31 -0000 1.7 --- OperatingRound_1835.java 8 May 2010 14:33:32 -0000 1.8 *************** *** 53,60 **** /** Can a public company operate? (1835 special version) */ protected boolean canCompanyOperateThisRound (PublicCompanyI company) { ! return company.hasFloated() && !company.isClosed() ! // 1835 special: in some variants minors don't run if BY has not floated ! && (!gameManager.getGameOption(GameOption.VARIANT).equalsIgnoreCase("Clemens") ! || companyManager.getPublicCompany(GameManager_1835.BY_ID).hasFloated()); } --- 53,68 ---- /** Can a public company operate? (1835 special version) */ protected boolean canCompanyOperateThisRound (PublicCompanyI company) { ! if (!company.hasFloated() || company.isClosed()) { ! return false; ! } ! // 1835 specials ! // Majors always operate ! if (company.hasStockPrice()) return true; ! // In some variants minors don't run if BY has not floated ! if (gameManager.getGameOption(GameOption.VARIANT).equalsIgnoreCase("Clemens") ! || gameManager.getGameOption("MinorsRequireFloatedBY").equalsIgnoreCase("yes")) { ! return companyManager.getPublicCompany(GameManager_1835.BY_ID).hasFloated(); ! } ! return true; } |
From: Erik V. <ev...@us...> - 2010-05-08 14:23:29
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv3201 Modified Files: LocalisedText.properties Log Message: Added new 1835 options: - BY floats at 50% or 20% - Minors don't run if BY has not floated - LD income is 20M or 30M Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** LocalisedText.properties 7 May 2010 20:03:49 -0000 1.130 --- LocalisedText.properties 8 May 2010 14:23:21 -0000 1.131 *************** *** 51,54 **** --- 51,55 ---- BuysTrain={0} buys a {1}-train from {2} for {3}. BuysTrainUsingSP={0} buys a {1}-train from {2} for {3} using {4}. + BYFloatsAt=Bayern floats at CASH=Cash CanOperate={0} can operate this round *************** *** 270,273 **** --- 271,275 ---- LaysTileAt={0} lays tile #{1} at hex {2}/{3} LaysTileAtFor={0} lays tile #{1} at hex {2}/{3} for {4} + LDIncome=LD income is LeaveAuctionOnPass=Leave private auction on pass LoadFailed=Load failed, reason: {0} *************** *** 292,295 **** --- 294,298 ---- Minor=Minor MinorCloses=Minor {0} is closed + MinorsRequireFloatedBY=Minors don't run if BY has not floated MonetiseTreasuryShares={0} puts 5 shares from Treasury in the Pool and receives {1} from the Bank MoreLoansNotAllowed={0} would exceed loans limit of {1} |
From: Erik V. <ev...@us...> - 2010-05-08 14:23:29
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv3201/data Modified Files: GamesList.xml Log Message: Added new 1835 options: - BY floats at 50% or 20% - Minors don't run if BY has not floated - LD income is 20M or 30M Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GamesList.xml 21 Apr 2010 21:30:40 -0000 1.32 --- GamesList.xml 8 May 2010 14:23:21 -0000 1.33 *************** *** 65,68 **** --- 65,71 ---- <Option name="NoMapMode" type="toggle" default="no" /> <Option name="UnlimitedTiles" type="toggle" default="no"/> + <Option name="BYFloatsAt" values="50%,20%" default="50%"/> + <Option name="LDIncome" values="20M,30M" default="20M"/> + <Option name="MinorsRequireFloatedBY" type="toggle" default="no"/> <Players minimum="3" maximum="7"/> </Game> |
From: Erik V. <ev...@us...> - 2010-05-08 14:23:29
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv3201/data/1835 Modified Files: Game.xml CompanyManager.xml Log Message: Added new 1835 options: - BY floats at 50% or 20% - Minors don't run if BY has not floated - LD income is 20M or 30M Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/CompanyManager.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CompanyManager.xml 21 Mar 2010 17:43:50 -0000 1.32 --- CompanyManager.xml 8 May 2010 14:23:21 -0000 1.33 *************** *** 72,76 **** </ClosingConditions> </Company> ! <Company name="LD" longname="Leipzig-Dresdner Bahn" type="Private" basePrice="190" revenue="20"> <Info key="ComesWithPresidency" parm="Sax,20"/> <ClosingConditions> --- 72,82 ---- </ClosingConditions> </Company> ! <Company name="LD" longname="Leipzig-Dresdner Bahn" type="Private" basePrice="190"> ! <IfOption name="LDIncome" value="20M"> ! <Attributes revenue="20"/> ! </IfOption> ! <IfOption name="LDIncome" value="30M"> ! <Attributes revenue="30"/> ! </IfOption> <Info key="ComesWithPresidency" parm="Sax,20"/> <ClosingConditions> *************** *** 152,155 **** --- 158,164 ---- <Company name="Bay" longname="Bayerische Eisenbahn" type="Major" startspace="C3" tokens="5" fgColour="FFFFFF" bgColour="0000FF"> <Home hex="O15"/> + <IfOption name="BYFloatsAt" value="20%"> + <Float percentage="20"/> + </IfOption> </Company> <Company name="Sax" longname="Sächsische Eisenbahn" type="Major" startspace="C4" tokens="3" fgColour="FFFFFF" bgColour="FF0000"> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Game.xml 2 Apr 2010 20:03:54 -0000 1.31 --- Game.xml 8 May 2010 14:23:21 -0000 1.32 *************** *** 7,10 **** --- 7,13 ---- <GameOption name="NoMapMode" type="toggle" default="no" /> <GameOption name="UnlimitedTiles" type="toggle" default="no"/> + <GameOption name="BYFloatsAt" values="50%,20%" default="50%"/> + <GameOption name="LDIncome" values="20M,30M" default="20M"/> + <GameOption name="MinorsRequireFloatedBY" type="toggle" default="no"/> <GameParameters> <PlayerShareLimit percentage="100"/> |
From: Erik V. <ev...@us...> - 2010-05-08 13:57:39
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32531/rails/game Modified Files: Round.java Log Message: In the Clemens variant, minors will not run if BY has not floated Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Round.java 22 Apr 2010 19:09:58 -0000 1.39 --- Round.java 8 May 2010 13:57:31 -0000 1.40 *************** *** 261,265 **** int minorNo = 0; for (PublicCompanyI company : companies) { ! if (!company.hasFloated() || company.isClosed()) continue; // Key must put companies in reverse operating order, because sort // is ascending. --- 261,266 ---- int minorNo = 0; for (PublicCompanyI company : companies) { ! if (!canCompanyOperateThisRound(company)) continue; ! // Key must put companies in reverse operating order, because sort // is ascending. *************** *** 280,283 **** --- 281,289 ---- } + /** Can a public company operate? (Default version) */ + protected boolean canCompanyOperateThisRound (PublicCompanyI company) { + return company.hasFloated() && !company.isClosed(); + } + /** * Check if a company must be floated, and if so, do it. <p>This method is |
From: Erik V. <ev...@us...> - 2010-05-08 13:57:39
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32531/rails/game/specific/_1835 Modified Files: OperatingRound_1835.java Log Message: In the Clemens variant, minors will not run if BY has not floated Index: OperatingRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/OperatingRound_1835.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OperatingRound_1835.java 7 May 2010 20:03:48 -0000 1.6 --- OperatingRound_1835.java 8 May 2010 13:57:31 -0000 1.7 *************** *** 6,9 **** --- 6,10 ---- import java.util.List; import java.util.Map; + import java.util.TreeMap; import rails.game.Bank; *************** *** 12,15 **** --- 13,17 ---- import rails.game.GameDef; import rails.game.GameManagerI; + import rails.game.GameOption; import rails.game.OperatingRound; import rails.game.PhaseI; *************** *** 20,23 **** --- 22,26 ---- import rails.game.PublicCompanyI; import rails.game.ReportBuffer; + import rails.game.StockSpaceI; import rails.game.action.DiscardTrain; import rails.game.action.LayTile; *************** *** 48,51 **** --- 51,62 ---- } + /** Can a public company operate? (1835 special version) */ + protected boolean canCompanyOperateThisRound (PublicCompanyI company) { + return company.hasFloated() && !company.isClosed() + // 1835 special: in some variants minors don't run if BY has not floated + && (!gameManager.getGameOption(GameOption.VARIANT).equalsIgnoreCase("Clemens") + || companyManager.getPublicCompany(GameManager_1835.BY_ID).hasFloated()); + } + protected void privatesPayOut() { int count = 0; |
From: Erik V. <ev...@us...> - 2010-05-08 13:56:39
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32432/rails/game Modified Files: StartRound.java GameManager.java GameOption.java Log Message: Moved "Variant" game option name to GameOption Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** StartRound.java 31 Jan 2010 22:22:28 -0000 1.35 --- StartRound.java 8 May 2010 13:56:30 -0000 1.36 *************** *** 62,66 **** public void start() { ! this.variant = gameManager.getGameOption(GameManager.VARIANT_KEY); if (variant == null) variant = ""; numPlayers = gameManager.getNumberOfPlayers(); --- 62,66 ---- public void start() { ! this.variant = gameManager.getGameOption(GameOption.VARIANT); if (variant == null) variant = ""; numPlayers = gameManager.getNumberOfPlayers(); Index: GameOption.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameOption.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GameOption.java 23 Feb 2010 22:21:39 -0000 1.11 --- GameOption.java 8 May 2010 13:56:30 -0000 1.12 *************** *** 23,26 **** --- 23,30 ---- // A default option that will always be set public static final String NUMBER_OF_PLAYERS = "NumberOfPlayers"; + + // Some other common game options + public static final String VARIANT = "Variant"; + public GameOption(String name) { Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** GameManager.java 9 Apr 2010 21:26:12 -0000 1.99 --- GameManager.java 8 May 2010 13:56:30 -0000 1.100 *************** *** 190,196 **** new ArrayList<GameOption>(); - /* Some standard tags for conditional attributes */ - public static final String VARIANT_KEY = "Variant"; - protected static Logger log = Logger.getLogger(GameManager.class.getPackage().getName()); --- 190,193 ---- |
From: Erik V. <ev...@us...> - 2010-05-07 20:03:57
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20269 Modified Files: LocalisedText.properties Log Message: 1835: Implemented denial of dividend for PR shares received in exchange for precursors that have operated before in the same OR. This required some refactoring of the dividend payout code. Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** LocalisedText.properties 18 Apr 2010 20:52:32 -0000 1.129 --- LocalisedText.properties 7 May 2010 20:03:49 -0000 1.130 *************** *** 310,313 **** --- 310,314 ---- NoDumping=Cannot dump presidency NoGameOptions=This game has no options + NoIncomeForPreviousOperation={0} gets no income for {1}% {2} shares as precursors have operated NoMapMode=No map mode (for ftf play) NoMoney=Not enough money |
From: Erik V. <ev...@us...> - 2010-05-07 20:03:57
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20269/rails/game Modified Files: PublicCompanyI.java OperatingRound.java PublicCompany.java Log Message: 1835: Implemented denial of dividend for PR shares received in exchange for precursors that have operated before in the same OR. This required some refactoring of the dividend payout code. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** OperatingRound.java 5 May 2010 21:44:51 -0000 1.127 --- OperatingRound.java 7 May 2010 20:03:49 -0000 1.128 *************** *** 13,16 **** --- 13,17 ---- import rails.game.state.IntegerState; import rails.util.LocalText; + import rails.util.SequenceUtil; /** *************** *** 919,923 **** ReportBuffer.add(LocalText.getText("CompanyDoesNotPayDividend", operatingCompany.getName())); ! operatingCompany.withhold(amount); } else if (revenueAllocation == SetDividend.PAYOUT) { --- 920,924 ---- ReportBuffer.add(LocalText.getText("CompanyDoesNotPayDividend", operatingCompany.getName())); ! withhold(amount); } else if (revenueAllocation == SetDividend.PAYOUT) { *************** *** 926,930 **** operatingCompany.getName(), Bank.format(amount) )); ! operatingCompany.payout(amount); } else if (revenueAllocation == SetDividend.SPLIT) { --- 927,931 ---- operatingCompany.getName(), Bank.format(amount) )); ! payout(amount); } else if (revenueAllocation == SetDividend.SPLIT) { *************** *** 933,937 **** operatingCompany.getName(), Bank.format(amount) )); ! operatingCompany.splitRevenue(amount); } else if (revenueAllocation == SetDividend.WITHHOLD) { --- 934,938 ---- operatingCompany.getName(), Bank.format(amount) )); ! splitRevenue(amount); } else if (revenueAllocation == SetDividend.WITHHOLD) { *************** *** 941,945 **** Bank.format(amount) )); ! operatingCompany.withhold(amount); } --- 942,946 ---- Bank.format(amount) )); ! withhold(amount); } *************** *** 952,955 **** --- 953,1058 ---- } + /** + * Distribute the dividend amongst the shareholders. + * + * @param amount + */ + public void payout(int amount) { + + if (amount == 0) return; + + int part; + int shares; + + Map<CashHolder, Integer> sharesPerRecipient = countSharesPerRecipient(); + + // Calculate, round up, report and add the cash + + // Define a precise sequence for the reporting + Set<CashHolder> recipientSet = sharesPerRecipient.keySet(); + for (CashHolder recipient : SequenceUtil.sortCashHolders(recipientSet)) { + if (recipient instanceof Bank) continue; + shares = (sharesPerRecipient.get(recipient)); + if (shares == 0) continue; + part = (int) Math.ceil(amount * shares * operatingCompany.getShareUnit() / 100.0); + ReportBuffer.add(LocalText.getText("Payout", + recipient.getName(), + Bank.format(part), + shares, + operatingCompany.getShareUnit())); + new CashMove(bank, recipient, part); + } + + // Move the token + operatingCompany.payout(amount); + + } + + protected Map<CashHolder, Integer> countSharesPerRecipient () { + + Map<CashHolder, Integer> sharesPerRecipient = new HashMap<CashHolder, Integer>(); + + // Changed to accomodate the CGR 5% share roundup rule. + // For now it is assumed, that actual payouts are always rounded up + // (the withheld half of split revenues is not handled here, see splitRevenue()). + + // First count the shares per recipient + for (PublicCertificateI cert : operatingCompany.getCertificates()) { + CashHolder recipient = getBeneficiary(cert); + if (!sharesPerRecipient.containsKey(recipient)) { + sharesPerRecipient.put(recipient, cert.getShares()); + } else { + sharesPerRecipient.put(recipient, + sharesPerRecipient.get(recipient) + cert.getShares()); + } + } + return sharesPerRecipient; + } + + /** Who gets the per-share revenue? */ + protected CashHolder getBeneficiary(PublicCertificateI cert) { + + Portfolio holder = cert.getPortfolio(); + CashHolder beneficiary = holder.getOwner(); + // Special cases apply if the holder is the IPO or the Pool + if (operatingCompany.paysOutToTreasury(cert)) { + beneficiary = operatingCompany; + } + return beneficiary; + } + + /** + * Withhold a given amount of revenue (and store it). + * + * @param The revenue amount. + */ + public void withhold(int amount) { + if (amount > 0) new CashMove(bank, operatingCompany, amount); + // Move the token + operatingCompany.withhold(amount); + } + + /** Split a dividend. TODO Optional rounding down the payout + * + * @param amount + */ + public void splitRevenue(int amount) { + + if (amount > 0) { + // Withhold half of it + // For now, hardcode the rule that payout is rounded up. + int numberOfShares = operatingCompany.getNumberOfShares(); + int withheld = + (amount / (2 * numberOfShares)) * numberOfShares; + new CashMove(bank, operatingCompany, withheld); + ReportBuffer.add(operatingCompany.getName() + " receives " + Bank.format(withheld)); + + // Payout the remainder + int payed = amount - withheld; + payout(payed); + } + + } + /** Default version, to be overridden if need be */ protected int checkForDeductions (SetDividend action) { *************** *** 1155,1159 **** operatingCompany.initTurn(); trainsBoughtThisTurn.clear(); - // setStep (GameDef.OrStep.LAY_TRACK); duplication } --- 1258,1261 ---- Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** PublicCompany.java 22 Apr 2010 19:09:58 -0000 1.95 --- PublicCompany.java 7 May 2010 20:03:49 -0000 1.96 *************** *** 1245,1271 **** } - /** Split a dividend. TODO Optional rounding down the payout - * - * @param amount - */ - public void splitRevenue(int amount) { - - if (amount > 0) { - // Withhold half of it - // For now, hardcode the rule that payout is rounded up. - int withheld = - (amount / (2 * getNumberOfShares())) * getNumberOfShares(); - new CashMove(bank, this, withheld); - ReportBuffer.add(name + " receives " + Bank.format(withheld)); - - // Payout the remainder - int payed = amount - withheld; - payout(payed); - } - - } - /** ! * Distribute the dividend amongst the shareholders. * * @param amount --- 1245,1250 ---- } /** ! * Determine if the price token must be moved after a dividend payout. * * @param amount *************** *** 1275,1313 **** if (amount == 0) return; - int part; - int shares; - Map<CashHolder, Integer> sharesPerRecipient = new HashMap<CashHolder, Integer>(); - - // Changed to accomodate the CGR 5% share roundup rule. - // For now it is assumed, that actual payouts are always rounded up - // (the withheld half of split revenues is not handled here, see splitRevenue()). - - // First count the shares per recipient - for (PublicCertificateI cert : certificates) { - CashHolder recipient = getBeneficiary(cert); - if (!sharesPerRecipient.containsKey(recipient)) { - sharesPerRecipient.put(recipient, cert.getShares()); - } else { - sharesPerRecipient.put(recipient, - sharesPerRecipient.get(recipient) + cert.getShares()); - } - } - - // Calculate, round up, report and add the cash - - // Define a precise sequence for the reporting - Set<CashHolder> recipientSet = sharesPerRecipient.keySet(); - for (CashHolder recipient : SequenceUtil.sortCashHolders(recipientSet)) { - if (recipient instanceof Bank) continue; - shares = (sharesPerRecipient.get(recipient)); - 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); - } - // Move the token if (hasStockPrice --- 1254,1257 ---- *************** *** 1319,1343 **** } ! /** Who gets the per-share revenue? */ ! protected CashHolder getBeneficiary(PublicCertificateI cert) { Portfolio holder = cert.getPortfolio(); - CashHolder beneficiary = holder.getOwner(); - // Special cases apply if the holder is the IPO or the Pool if (holder == bank.getIpo() && ipoPaysOut || holder == bank.getPool() && poolPaysOut) { ! beneficiary = this; } ! return beneficiary; } /** ! * Withhold a given amount of revenue (and store it). * * @param The revenue amount. */ public void withhold(int amount) { - if (amount > 0) new CashMove(bank, this, amount); - // Move the token if (hasStockPrice) stockMarket.withhold(this); } --- 1263,1282 ---- } ! public boolean paysOutToTreasury (PublicCertificateI cert) { Portfolio holder = cert.getPortfolio(); if (holder == bank.getIpo() && ipoPaysOut || holder == bank.getPool() && poolPaysOut) { ! return true; } ! return false; } /** ! * Determine if the price token must be moved after a withheld dividend. * * @param The revenue amount. */ public void withhold(int amount) { if (hasStockPrice) stockMarket.withhold(this); } Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** PublicCompanyI.java 22 Apr 2010 19:09:58 -0000 1.53 --- PublicCompanyI.java 7 May 2010 20:03:49 -0000 1.54 *************** *** 214,225 **** public int getFloatPercentage(); - //public Portfolio getPortfolio(); - public void payout(int amount); - public void splitRevenue(int amount); - public void withhold(int amount); public boolean isSoldOut(); --- 214,223 ---- public int getFloatPercentage(); public void payout(int amount); public void withhold(int amount); + public boolean paysOutToTreasury (PublicCertificateI cert); + public boolean isSoldOut(); *************** *** 231,234 **** --- 229,233 ---- public int getShareUnit(); public int getShareUnitsForSharePrice(); + public int getNumberOfShares(); /** |
From: Erik V. <ev...@us...> - 2010-05-07 20:03:56
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20269/rails/game/specific/_1835 Modified Files: FoldIntoPrussian.java OperatingRound_1835.java PrussianFormationRound.java Log Message: 1835: Implemented denial of dividend for PR shares received in exchange for precursors that have operated before in the same OR. This required some refactoring of the dividend payout code. Index: PrussianFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/PrussianFormationRound.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PrussianFormationRound.java 18 Apr 2010 20:52:32 -0000 1.11 --- PrussianFormationRound.java 7 May 2010 20:03:48 -0000 1.12 *************** *** 232,235 **** --- 232,236 ---- while (folding) { + // TODO Some validation needed break; } *************** *** 246,250 **** // Execute ! if (folding) executeExchange (action.getFoldedCompanies(), false, false); return folding; --- 247,251 ---- // Execute ! if (folding) executeExchange (folded, false, false); return folding; Index: OperatingRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/OperatingRound_1835.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OperatingRound_1835.java 5 May 2010 21:44:51 -0000 1.5 --- OperatingRound_1835.java 7 May 2010 20:03:48 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- import rails.game.Portfolio; import rails.game.PrivateCompanyI; + import rails.game.PublicCertificateI; import rails.game.PublicCompanyI; import rails.game.ReportBuffer; *************** *** 71,82 **** int share = efs.getShare(); Player player = (Player) recipient; ! if (!deniedIncomeShare.containsKey(player)) { ! //deniedIncomeShare.put(player, share); ! new MapChange<Player, Integer> (deniedIncomeShare, player, share); ! } else { ! //deniedIncomeShare.put(player, share + deniedIncomeShare.get(player)); ! new MapChange<Player, Integer> (deniedIncomeShare, player, ! share + deniedIncomeShare.get(player)); ! } } --- 72,76 ---- int share = efs.getShare(); Player player = (Player) recipient; ! addIncomeDenialShare (player, share); } *************** *** 90,93 **** --- 84,137 ---- } + private void addIncomeDenialShare (Player player, int share) { + + if (!deniedIncomeShare.containsKey(player)) { + new MapChange<Player, Integer> (deniedIncomeShare, player, share); + } else { + new MapChange<Player, Integer> (deniedIncomeShare, player, + share + deniedIncomeShare.get(player)); + } + //log.debug("+++ Denied "+share+"% share of PR income to "+player.getName()); + } + + /** Count the number of shares per revenue recipient<p> + * A special rule applies to 1835 to prevent black privates and minors providing + * income twice during an OR. + */ + protected Map<CashHolder, Integer> countSharesPerRecipient () { + + Map<CashHolder, Integer> sharesPerRecipient = super.countSharesPerRecipient(); + + if (operatingCompany.getName().equalsIgnoreCase(GameManager_1835.PR_ID)) { + for (Player player : deniedIncomeShare.keySet()) { + int share = deniedIncomeShare.get(player); + int shares = share / operatingCompany.getShareUnit(); + sharesPerRecipient.put (player, sharesPerRecipient.get(player) - shares); + ReportBuffer.add(LocalText.getText("NoIncomeForPreviousOperation", + player.getName(), + share, + GameManager_1835.PR_ID)); + + } + } + + return sharesPerRecipient; + } + + /** + * Register black minors as having operated + * for the purpose of denying income after conversion to a PR share + */ + protected void initTurn() { + + super.initTurn(); + + List<SpecialPropertyI> sps = operatingCompany.getSpecialProperties(); + if (sps != null && !sps.isEmpty()) { + ExchangeForShare efs = (ExchangeForShare) sps.get(0); + addIncomeDenialShare (operatingCompany.getPresident(), efs.getShare()); + } + } + @Override public void resume() { Index: FoldIntoPrussian.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1835/FoldIntoPrussian.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FoldIntoPrussian.java 28 Feb 2010 21:38:06 -0000 1.1 --- FoldIntoPrussian.java 7 May 2010 20:03:48 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import rails.game.*; import rails.game.action.PossibleAction; + import rails.util.Util; public class FoldIntoPrussian extends PossibleAction { *************** *** 90,94 **** } } ! if (foldedCompanyNames != null) { foldedCompanies = new ArrayList<CompanyI>(); for (String name : foldedCompanyNames.split(",")) { --- 91,95 ---- } } ! if (Util.hasValue(foldedCompanyNames)) { foldedCompanies = new ArrayList<CompanyI>(); for (String name : foldedCompanyNames.split(",")) { |
From: Erik V. <ev...@us...> - 2010-05-02 20:18:40
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv29623/rails/ui/swing/hexmap Modified Files: GUITile.java Log Message: Fix tile 209 (1835 green Berlin) laying ptoblem (no valid orientation). Index: GUITile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUITile.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GUITile.java 18 Apr 2010 15:09:58 -0000 1.23 --- GUITile.java 2 May 2010 20:18:31 -0000 1.24 *************** *** 199,202 **** --- 199,204 ---- // If connected cities do not correspond, skip // (this is the "OO brown upgrade get-right" feature) + // Only apply this check if the number of cities has not decreased + if (getTile().getNumStations() < prevTile.getNumStations()) continue; log.debug("Compare "+oldCities.get(kkk)+"/"+oldCities.get(lll) +" ~ "+newCities.get(kk)+"/"+newCities.get(ll)); |
From: Stefan F. <ste...@us...> - 2010-05-02 17:33:10
|
Update of /cvsroot/rails/18xx/rails/algorithms In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10835/rails/algorithms Modified Files: RevenueCalculator.java Log Message: Fixed problem with ignoreMinor vertexValues Index: RevenueCalculator.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/algorithms/RevenueCalculator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RevenueCalculator.java 1 May 2010 16:07:05 -0000 1.9 --- RevenueCalculator.java 2 May 2010 17:33:00 -0000 1.10 *************** *** 140,148 **** for (int j=0; j < nbVertexes; j++) { ! if (vertexMajor[id]) { vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMajors; ! } ! if (vertexMinor[id]) { ! vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMinors; } } --- 140,151 ---- for (int j=0; j < nbVertexes; j++) { ! if (vertexMajor[j]) { vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMajors; ! } else if (vertexMinor[j]) { ! if (ignoreMinors) { ! vertexValueByTrain[j][id] = 0; ! } else { ! vertexValueByTrain[j][id] = vertexValueByTrain[j][id] * multiplyMinors; ! } } } *************** *** 160,163 **** --- 163,175 ---- } + String getStatistics() { + StringBuffer statistics = new StringBuffer(); + statistics.append(nbEvaluations + " evaluations"); + if (useRevenuePrediction) + statistics.append(", " + nbPredictions + " predictions"); + statistics.append(" and " + nbEdges + " edges travelled."); + return statistics.toString(); + } + private void notifyRevenueAdapter(final int revenue, final boolean finalResult) { String modifier; *************** *** 166,175 **** else modifier = "new best"; ! StringBuffer statistics = new StringBuffer(); ! statistics.append(nbEvaluations + " evaluations"); ! if (useRevenuePrediction) ! statistics.append(", " + nbPredictions + " predictions"); ! statistics.append(" and " + nbEdges + " edges travelled."); ! log.info("Report " + modifier + " result of " + revenue + " after " + statistics.toString()); revenueAdapter.notifyRevenueListener(revenue, finalResult); } --- 178,182 ---- else modifier = "new best"; ! log.info("Report " + modifier + " result of " + revenue + " after " + getStatistics()); revenueAdapter.notifyRevenueListener(revenue, finalResult); } *************** *** 215,218 **** --- 222,227 ---- if (startTrain > finalTrain) return; + + nbEvaluations = 0; nbPredictions = 0; nbEdges = 0; useRevenuePrediction = true; *************** *** 233,237 **** currentBestValue = 0; runTrain(j); ! log.info("RC: Best prediction run of train number " + j + " value = " + currentBestValue); maxSingleTrainRevenues[j] = currentBestValue; cumulatedRevenues += currentBestValue; --- 242,247 ---- currentBestValue = 0; runTrain(j); ! log.info("RC: Best prediction run of train number " + j + " value = " + currentBestValue + ! " after " + getStatistics()); maxSingleTrainRevenues[j] = currentBestValue; cumulatedRevenues += currentBestValue; *************** *** 247,251 **** currentBestValue = 0; runTrain(j); ! log.info("RC: Best prediction run until train nb. " + j + " value = " + currentBestValue); maxCumulatedTrainRevenues[j] = currentBestValue; maxCumulatedTrainRevenues[j-1] = currentBestValue + maxSingleTrainRevenues[j-1]; --- 257,262 ---- currentBestValue = 0; runTrain(j); ! log.info("RC: Best prediction run until train nb. " + j + " value = " + currentBestValue + ! " after " + getStatistics()); maxCumulatedTrainRevenues[j] = currentBestValue; maxCumulatedTrainRevenues[j-1] = currentBestValue + maxSingleTrainRevenues[j-1]; *************** *** 255,260 **** int calculateRevenue(int startTrain, int finalTrain) { log.info("RC: calculateRevenue trains from " + startTrain + " to " + finalTrain); - - nbEvaluations = 0; nbPredictions = 0; nbEdges = 0; this.startTrain = startTrain; --- 266,269 ---- |
From: Stefan F. <ste...@us...> - 2010-05-02 17:32:12
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10717/rails/game Modified Files: OperatingRound.java Log Message: Fixed closePrivate functionality Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** OperatingRound.java 1 May 2010 16:08:13 -0000 1.125 --- OperatingRound.java 2 May 2010 17:32:04 -0000 1.126 *************** *** 1037,1042 **** protected boolean executeClosePrivate(ClosePrivate action) { ! PrivateCompanyI priv = action.getPrivateCompany(); String errMsg = null; --- 1037,1044 ---- protected boolean executeClosePrivate(ClosePrivate action) { ! PrivateCompanyI priv = action.getPrivateCompany(); + + log.debug("Executed close private action for private " + priv.getName()); String errMsg = null; |
From: Stefan F. <ste...@us...> - 2010-05-02 17:32:12
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv10717/rails/game/correct Modified Files: ClosePrivate.java Log Message: Fixed closePrivate functionality Index: ClosePrivate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/ClosePrivate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClosePrivate.java 24 Feb 2010 21:09:22 -0000 1.3 --- ClosePrivate.java 2 May 2010 17:32:04 -0000 1.4 *************** *** 9,14 **** /** ! * Action that allows the closure of a private company ! * used for NoMapMode */ --- 9,13 ---- /** ! * Action that allows manual closure of a private company */ |
From: Erik V. <ev...@us...> - 2010-05-01 19:32:47
|
Update of /cvsroot/rails/18xx/tiles In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20976/tiles Modified Files: TileDictionary.18t Tiles.xml Log Message: Fixed tile -803 (Hamburg 1835: one city had 20 revenue) Index: TileDictionary.18t =================================================================== RCS file: /cvsroot/rails/18xx/tiles/TileDictionary.18t,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TileDictionary.18t 11 Mar 2010 23:09:30 -0000 1.10 --- TileDictionary.18t 1 May 2010 19:32:39 -0000 1.11 *************** *** 12816,12820 **** JunType = jtCity Position = tp2SideF ! Revenue = 20 RevenuePosition = tpCenter end --- 12816,12820 ---- JunType = jtCity Position = tp2SideF ! Revenue = 40 RevenuePosition = tpCenter end Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/tiles/Tiles.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Tiles.xml 30 Apr 2010 15:22:42 -0000 1.28 --- Tiles.xml 1 May 2010 19:32:39 -0000 1.29 *************** *** 3090,3094 **** </Tile> <Tile colour="green" id="-803" name="Hamburg"> ! <Station id="city1" position="502" slots="1" type="City" value="20"/> <Station id="city2" position="052" slots="1" type="City" value="40"/> <Station id="city3" position="302" slots="1" type="City" value="40"/> --- 3090,3094 ---- </Tile> <Tile colour="green" id="-803" name="Hamburg"> ! <Station id="city1" position="502" slots="1" type="City" value="40"/> <Station id="city2" position="052" slots="1" type="City" value="40"/> <Station id="city3" position="302" slots="1" type="City" value="40"/> |
From: Erik V. <ev...@us...> - 2010-05-01 19:32:47
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv20976/data/1835 Modified Files: Tiles.xml Log Message: Fixed tile -803 (Hamburg 1835: one city had 20 revenue) Index: Tiles.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Tiles.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Tiles.xml 8 Jan 2010 20:47:08 -0000 1.8 --- Tiles.xml 1 May 2010 19:32:39 -0000 1.9 *************** *** 1,419 **** ! <?xml version="1.0" encoding="UTF-8"?><Tiles><Tile colour="white" id="0" name="empty"/><Tile colour="white" id="-1" name="1 village"> ! <Station id="city1" position="002" type="Town"/> ! </Tile><Tile colour="white" id="-2" name="2 villages"> ! <Station id="city1" position="102" type="Town"/> ! <Station id="city2" position="302" type="Town"/> ! </Tile><Tile colour="fixed" id="-3" name="MF 3"> ! <Station id="city1" position="252" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="fixed" id="-7" name="MF 7"> ! <Track from="side2" gauge="normal" to="side1"/> ! </Tile><Tile colour="fixed" id="-8" name="MF 8"> ! <Track from="side2" gauge="normal" to="side0"/> ! </Tile><Tile colour="white" id="-10" name="1 city"> ! <Station id="city1" position="302" slots="1" type="City"/> ! </Tile><Tile colour="fixed" id="-39" name="-39"> ! <Track from="side3" gauge="normal" to="side1"/> ! <Track from="side1" gauge="normal" to="side2"/> ! <Track from="side2" gauge="normal" to="side3"/> ! </Tile><Tile colour="fixed" id="-41" name="-41"> ! <Track from="side0" gauge="normal" to="side3"/> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side3"/> ! </Tile><Tile colour="fixed" id="-58" name="MF 58"> ! <Station id="city1" position="301" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile><Tile colour="fixed" id="-114" name="Braunschweig"> ! <Station id="city1" position="501" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="side2" gauge="normal" to="side2"/> ! </Tile><Tile colour="fixed" id="-143" name="-143"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="fixed" id="-800" name="Rostock"> ! <Station id="city1" position="302" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="fixed" id="-801" name="Emden"> ! <Station id="city1" position="352" type="Town" value="10"/> ! <Station id="city2" position="202" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side2"/> ! </Tile><Tile colour="fixed" id="-802" name="Bremerhaven"> ! <Station id="city1" position="101" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side4"/> ! </Tile><Tile colour="green" id="-803" name="Hamburg"> ! <Station id="city1" position="502" slots="1" type="City" value="20"/> ! <Station id="city2" position="052" slots="1" type="City" value="40"/> ! <Station id="city3" position="302" slots="1" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city3" gauge="normal" to="side3"/> ! </Tile><Tile colour="fixed" id="-804" name="Schwerin"> ! <Station id="city1" position="002" slots="1" type="City" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="fixed" id="-805" name="Oldenburg"> ! <Station id="city1" position="051" slots="1" type="City" value="10"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="-806" name="Berlin"> ! <Station id="city1" position="402" slots="1" type="City" value="30"/> ! <Station id="city2" position="001" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile><Tile colour="yellow" id="-807" name="XX"> ! <Station id="city1" position="102" slots="1" type="City"/> ! <Station id="city2" position="302" slots="1" type="City"/> ! </Tile><Tile colour="fixed" id="-808" name="Koblenz"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side1" gauge="normal" to="side2"/> ! </Tile><Tile colour="green" id="-809" name="Frankfurt"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="green" id="-810" name="Nurnberg"> ! <Station id="city1" position="552" slots="1" type="City" value="30"/> ! <Station id="city2" position="252" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile><Tile colour="red" id="-901" name="OM 1 way"> ! <Station id="city1" position="0" type="OffMapCity" value="-1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="1" name="1"> ! <Station id="city1" position="408" type="Town" value="10"/> ! <Station id="city2" position="108" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile><Tile colour="yellow" id="2" name="2"> ! <Station id="city1" position="302" type="Town" value="10"/> ! <Station id="city2" position="109" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="3" name="3"> ! <Station id="city1" position="352" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile><Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile><Tile colour="yellow" id="5" name="5"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="6" name="6"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="7" name="7"> ! <Track from="side3" gauge="normal" to="side4"/> ! </Tile><Tile colour="yellow" id="8" name="8"> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile><Tile colour="yellow" id="9" name="9"> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="yellow" id="55" name="55"> ! <Station id="city1" position="202" type="Town" value="10"/> ! <Station id="city2" position="302" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side0"/> ! </Tile><Tile colour="yellow" id="56" name="56"> ! <Station id="city1" position="407" type="Town" value="10"/> ! <Station id="city2" position="108" type="Town" value="10"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="yellow" id="57" name="57"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile><Tile colour="yellow" id="58" name="58"> ! <Station id="city1" position="401" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="yellow" id="69" name="69"> ! <Station id="city1" position="407" type="Town" value="10"/> ! <Station id="city2" position="002" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile><Tile colour="yellow" id="201" name="201"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="yellow" id="202" name="202"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile><Tile colour="green" id="12" name="12"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile><Tile colour="green" id="13" name="13"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile><Tile colour="green" id="14" name="14"> ! <Station id="city1" position="0" slots="2" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="15" name="15"> ! <Station id="city1" position="0" slots="2" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="16" name="16"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="18" name="18"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="19" name="19"> ! <Track from="side5" gauge="normal" to="side1"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile><Tile colour="green" id="20" name="20"> ! <Track from="side1" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="23" name="23"> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile><Tile colour="green" id="24" name="24"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="25" name="25"> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="26" name="26"> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile><Tile colour="green" id="27" name="27"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="green" id="28" name="28"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="29" name="29"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="87" name="87"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="88" name="88"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="203" name="203"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile><Tile colour="green" id="204" name="204"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="205" name="205"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="206" name="206"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="207" name="207"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="208" name="208"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="209" name="209"> ! <Station id="city1" position="0" slots="3" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="210" name="210"> ! <Station id="city1" position="502" slots="1" type="City" value="30"/> ! <Station id="city2" position="052" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! </Tile><Tile colour="green" id="211" name="211"> ! <Station id="city1" position="252" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="212" name="212"> ! <Station id="city1" position="152" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="213" name="213"> ! <Station id="city1" position="151" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="214" name="214"> ! <Station id="city1" position="251" slots="1" type="City" value="30"/> ! <Station id="city2" position="552" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile><Tile colour="green" id="215" name="215"> ! <Station id="city1" position="507" slots="1" type="City" value="30"/> ! <Station id="city2" position="207" slots="1" type="City" value="30"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="39" name="39"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="40" name="40"> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="41" name="41"> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side3"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile><Tile colour="brown" id="42" name="42"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side5" gauge="normal" to="side0"/> ! </Tile><Tile colour="brown" id="43" name="43"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile><Tile colour="brown" id="44" name="44"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side1" gauge="normal" to="side4"/> ! </Tile><Tile colour="brown" id="45" name="45"> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="brown" id="46" name="46"> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile><Tile colour="brown" id="47" name="47"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side1"/> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side1"/> ! </Tile><Tile colour="brown" id="63" name="63"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="70" name="70"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile><Tile colour="brown" id="216" name="216"> ! <Station id="city1" position="0" slots="2" type="City" value="50"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="217" name="217"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="218" name="218"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="219" name="219"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="220" name="220"> ! <Station id="city1" position="0" slots="3" type="City" value="60"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile><Tile colour="brown" id="221" name="221"> ! <Station id="city1" position="0" slots="3" type="City" value="60"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile></Tiles> \ No newline at end of file --- 1,508 ---- ! <?xml version="1.0" encoding="UTF-8"?> ! <Tiles> ! <Tile colour="white" id="0" name="empty"/> ! <Tile colour="white" id="-1" name="1 village"> ! <Station id="city1" position="002" type="Town"/> ! </Tile> ! <Tile colour="white" id="-2" name="2 villages"> ! <Station id="city1" position="102" type="Town"/> ! <Station id="city2" position="302" type="Town"/> ! </Tile> ! <Tile colour="fixed" id="-3" name="MF 3"> ! <Station id="city1" position="252" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="fixed" id="-7" name="MF 7"> ! <Track from="side2" gauge="normal" to="side1"/> ! </Tile> ! <Tile colour="fixed" id="-8" name="MF 8"> ! <Track from="side2" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="white" id="-10" name="1 city"> ! <Station id="city1" position="302" slots="1" type="City"/> ! </Tile> ! <Tile colour="fixed" id="-39" name="-39"> ! <Track from="side3" gauge="normal" to="side1"/> ! <Track from="side1" gauge="normal" to="side2"/> ! <Track from="side2" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="fixed" id="-41" name="-41"> ! <Track from="side0" gauge="normal" to="side3"/> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="fixed" id="-58" name="MF 58"> ! <Station id="city1" position="301" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="fixed" id="-114" name="Braunschweig"> ! <Station id="city1" position="501" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="side2" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="fixed" id="-143" name="-143"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="fixed" id="-800" name="Rostock"> ! <Station id="city1" position="302" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="fixed" id="-801" name="Emden"> ! <Station id="city1" position="352" type="Town" value="10"/> ! <Station id="city2" position="202" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="fixed" id="-802" name="Bremerhaven"> ! <Station id="city1" position="101" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="green" id="-803" name="Hamburg"> ! <Station id="city1" position="502" slots="1" type="City" value="40"/> ! <Station id="city2" position="052" slots="1" type="City" value="40"/> ! <Station id="city3" position="302" slots="1" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city3" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="fixed" id="-804" name="Schwerin"> ! <Station id="city1" position="002" slots="1" type="City" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="fixed" id="-805" name="Oldenburg"> ! <Station id="city1" position="051" slots="1" type="City" value="10"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="-806" name="Berlin"> ! <Station id="city1" position="402" slots="1" type="City" value="30"/> ! <Station id="city2" position="001" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="yellow" id="-807" name="XX"> ! <Station id="city1" position="102" slots="1" type="City"/> ! <Station id="city2" position="302" slots="1" type="City"/> ! </Tile> ! <Tile colour="fixed" id="-808" name="Koblenz"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="side1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="green" id="-809" name="Frankfurt"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="green" id="-810" name="Nurnberg"> ! <Station id="city1" position="552" slots="1" type="City" value="30"/> ! <Station id="city2" position="252" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="red" id="-901" name="OM 1 way"> ! <Station id="city1" position="0" type="OffMapCity" value="-1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="1" name="1"> ! <Station id="city1" position="408" type="Town" value="10"/> ! <Station id="city2" position="108" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="yellow" id="2" name="2"> ! <Station id="city1" position="302" type="Town" value="10"/> ! <Station id="city2" position="109" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="3" name="3"> ! <Station id="city1" position="352" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="yellow" id="4" name="4"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="yellow" id="5" name="5"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="6" name="6"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="7" name="7"> ! <Track from="side3" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="yellow" id="8" name="8"> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="yellow" id="9" name="9"> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="yellow" id="55" name="55"> ! <Station id="city1" position="202" type="Town" value="10"/> ! <Station id="city2" position="302" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="yellow" id="56" name="56"> ! <Station id="city1" position="407" type="Town" value="10"/> ! <Station id="city2" position="108" type="Town" value="10"/> ! <Track from="city2" gauge="normal" to="side1"/> ! <Track from="city2" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="yellow" id="57" name="57"> ! <Station id="city1" position="0" slots="1" type="City" value="20"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="yellow" id="58" name="58"> ! <Station id="city1" position="401" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="yellow" id="69" name="69"> ! <Station id="city1" position="407" type="Town" value="10"/> ! <Station id="city2" position="002" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="yellow" id="201" name="201"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="yellow" id="202" name="202"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! </Tile> ! <Tile colour="green" id="12" name="12"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="green" id="13" name="13"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="green" id="14" name="14"> ! <Station id="city1" position="0" slots="2" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="15" name="15"> ! <Station id="city1" position="0" slots="2" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city1" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="16" name="16"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="18" name="18"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="19" name="19"> ! <Track from="side5" gauge="normal" to="side1"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="green" id="20" name="20"> ! <Track from="side1" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="23" name="23"> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="green" id="24" name="24"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="25" name="25"> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="26" name="26"> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="green" id="27" name="27"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="green" id="28" name="28"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="29" name="29"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="87" name="87"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="88" name="88"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="203" name="203"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="green" id="204" name="204"> ! <Station id="city1" position="0" type="Town" value="10"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="205" name="205"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="206" name="206"> ! <Station id="city1" position="0" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="207" name="207"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="208" name="208"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="209" name="209"> ! <Station id="city1" position="0" slots="3" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="210" name="210"> ! <Station id="city1" position="502" slots="1" type="City" value="30"/> ! <Station id="city2" position="052" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side1"/> ! </Tile> ! <Tile colour="green" id="211" name="211"> ! <Station id="city1" position="252" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="212" name="212"> ! <Station id="city1" position="152" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="213" name="213"> ! <Station id="city1" position="151" slots="1" type="City" value="30"/> ! <Station id="city2" position="452" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city2" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="214" name="214"> ! <Station id="city1" position="251" slots="1" type="City" value="30"/> ! <Station id="city2" position="552" slots="1" type="City" value="30"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="green" id="215" name="215"> ! <Station id="city1" position="507" slots="1" type="City" value="30"/> ! <Station id="city2" position="207" slots="1" type="City" value="30"/> ! <Track from="city2" gauge="normal" to="side0"/> ! <Track from="city2" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="39" name="39"> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="40" name="40"> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="41" name="41"> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side3"/> ! <Track from="side0" gauge="normal" to="side3"/> ! </Tile> ! <Tile colour="brown" id="42" name="42"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side5" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="brown" id="43" name="43"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side5"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="brown" id="44" name="44"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side1" gauge="normal" to="side4"/> ! </Tile> ! <Tile colour="brown" id="45" name="45"> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side1" gauge="normal" to="side3"/> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="brown" id="46" name="46"> ! <Track from="side1" gauge="normal" to="side5"/> ! <Track from="side1" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="brown" id="47" name="47"> ! <Track from="side3" gauge="normal" to="side0"/> ! <Track from="side3" gauge="normal" to="side1"/> ! <Track from="side4" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side1"/> ! </Tile> ! <Tile colour="brown" id="63" name="63"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="70" name="70"> ! <Track from="side3" gauge="normal" to="side5"/> ! <Track from="side3" gauge="normal" to="side4"/> ! <Track from="side5" gauge="normal" to="side0"/> ! <Track from="side4" gauge="normal" to="side0"/> ! </Tile> ! <Tile colour="brown" id="216" name="216"> ! <Station id="city1" position="0" slots="2" type="City" value="50"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="217" name="217"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="218" name="218"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="219" name="219"> ! <Station id="city1" position="0" slots="2" type="City" value="40"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="220" name="220"> ! <Station id="city1" position="0" slots="3" type="City" value="60"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! <Tile colour="brown" id="221" name="221"> ! <Station id="city1" position="0" slots="3" type="City" value="60"/> ! <Track from="city1" gauge="normal" to="side0"/> ! <Track from="city1" gauge="normal" to="side1"/> ! <Track from="city1" gauge="normal" to="side2"/> ! <Track from="city1" gauge="normal" to="side3"/> ! <Track from="city1" gauge="normal" to="side4"/> ! <Track from="city1" gauge="normal" to="side5"/> ! </Tile> ! </Tiles> \ No newline at end of file |
From: Stefan F. <ste...@us...> - 2010-05-01 16:12:56
|
Update of /cvsroot/rails/18xx/data/1870 In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25174/data/1870 Modified Files: CompanyManager.xml Log Message: Some minor fixes to the 1870 companies Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1870/CompanyManager.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.25 --- CompanyManager.xml 1 May 2010 16:12:48 -0000 1.26 *************** *** 1,6 **** --- 1,9 ---- <?xml version="1.0"?> + <!-- 1870 CompanyManager.xml --> <CompanyManager> + <CompanyType name="Private" class="rails.game.PrivateCompany"> </CompanyType> + <CompanyType name="Public" class="rails.game.PublicCompany"> <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/> *************** *** 23,35 **** <Company name="GRSC" type="Private" basePrice="20" revenue="5" longname="Great River Shipping Company"/> <Company name="Brdg" type="Private" basePrice="40" revenue="10" longname="Mississippi River Bridge Company" /> <Company name="Cattl" type="Private" tokens="1" basePrice="50" revenue="10" longname="The Southern Cattle Company" /> <Company name="Gulf" type="Private" tokens="2" tokenValue="20/10,10" basePrice="80" revenue="15" longname="The Gulf Shipping Company" /> <Company name="MKT" type="Private" basePrice="160" revenue="20" longname="Missouri-Kansas-Texas Railroad"> ! <Info key="ComesWithCertificate" parm="KATY,10"></Info></Company> <Company name="KATY" type="Public" tokens="4" fgColour="FFFFFF" --- 26,43 ---- <Company name="GRSC" type="Private" basePrice="20" revenue="5" longname="Great River Shipping Company"/> + <Company name="Brdg" type="Private" basePrice="40" revenue="10" longname="Mississippi River Bridge Company" /> + <Company name="Cattl" type="Private" tokens="1" basePrice="50" revenue="10" longname="The Southern Cattle Company" /> + <Company name="Gulf" type="Private" tokens="2" tokenValue="20/10,10" basePrice="80" revenue="15" longname="The Gulf Shipping Company" /> + <Company name="MKT" type="Private" basePrice="160" revenue="20" longname="Missouri-Kansas-Texas Railroad"> ! <Info key="ComesWithCertificate" parm="KATY,10"></Info> ! </Company> <Company name="KATY" type="Public" tokens="4" fgColour="FFFFFF" *************** *** 38,41 **** --- 46,50 ---- <Destination hex="N1" /> </Company> + <Company name="MP" type="Public" tokens="4" fgColour="FFFFFF" bgColour="FF0000" longname="Missouri Pacific Railroad"> *************** *** 43,46 **** --- 52,56 ---- <Destination hex="J5" /> </Company> + <Company name="ATSF" type="Public" tokens="4" fgColour="FFFFFF" bgColour="0000FF" longname="Atchison, Topeka & Santa Fe Railway"> *************** *** 48,51 **** --- 58,62 ---- <Destination hex="N1" /> </Company> + <Company name="SP" type="Public" tokens="4" fgColour="FF8000" bgColour="000000" longname="Southern Pacific Railroad"> *************** *** 53,56 **** --- 64,68 ---- <Destination hex="N17" /> </Company> + <Company name="GMO" type="Public" tokens="3" fgColour="FFFFFF" bgColour="ff0040" longname="Gulf, Mobile & Ohio Railroad"> *************** *** 58,66 **** <Destination hex="C18" /> </Company> <Company name="SLSF" type="Public" tokens="4" fgColour="FFFFFF" ! bgColour="d04000" floatPerc="20" longname="St. Louis-San Francisco Railway"> <Home hex="E12" /> <Destination hex="M22" /> </Company> <Company name="TP" type="Public" tokens="3" fgColour="FFFFFF" bgColour="000000" longname="Texas & Pacific Railway"> --- 70,81 ---- <Destination hex="C18" /> </Company> + <Company name="SLSF" type="Public" tokens="4" fgColour="FFFFFF" ! bgColour="d04000" longname="St. Louis-San Francisco Railway"> <Home hex="E12" /> + <Float percentage="20"/> <Destination hex="M22" /> </Company> + <Company name="TP" type="Public" tokens="3" fgColour="FFFFFF" bgColour="000000" longname="Texas & Pacific Railway"> *************** *** 68,71 **** --- 83,87 ---- <Destination hex="N17" /> </Company> + <Company name="FW" type="Public" tokens="3" fgColour="FF0000" bgColour="000000" longname="Fort Worth & Denver City Railway"> *************** *** 73,76 **** --- 89,93 ---- <Destination hex="A2" /> </Company> + <Company name="SSW" type="Public" tokens="3" fgColour="FFFFFF" bgColour="6000ff" longname="St. Louis Southwestern Railway"> *************** *** 78,81 **** --- 95,99 ---- <Destination hex="J3" /> </Company> + <Company name="IC" type="Public" tokens="3" fgColour="000000" bgColour="c0ff40" longname="Illinois Central Railroad"> *************** *** 90,95 **** <Item name="Cattl" type="Private" basePrice="50"/> <Item name="Gulf" type="Private" basePrice="80"/> ! <Item name="SLSF" type="Public" president="yes" basePrice="140"/> ! <Item name="MKT" type="Private" basePrice="160"/> ! </StartPacket> </CompanyManager> --- 108,115 ---- <Item name="Cattl" type="Private" basePrice="50"/> <Item name="Gulf" type="Private" basePrice="80"/> ! <Item name="SLSF" type="Public" president="yes" basePrice="140"/> ! <Item name="MKT" type="Private" basePrice="160"> ! <SubItem name="KATY" type="Public" /> ! </Item> ! </StartPacket> </CompanyManager> |
From: Stefan F. <ste...@us...> - 2010-05-01 16:08:21
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23647/rails/game Modified Files: OperatingRound.java PrivateCompany.java PrivateCompanyI.java Log Message: Adds CloseManually Tag for Privates Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** OperatingRound.java 30 Apr 2010 09:35:35 -0000 1.124 --- OperatingRound.java 1 May 2010 16:08:13 -0000 1.125 *************** *** 2162,2165 **** --- 2162,2171 ---- setGameSpecificPossibleActions(); + // Private Company manually closure + for (PrivateCompanyI priv: companyManager.getAllPrivateCompanies()) { + if (!priv.isClosed() && priv.closesManually()) + possibleActions.add(new ClosePrivate(priv)); + } + // Can private companies be bought? if (getCurrentPhase().isPrivateSellingAllowed()) { *************** *** 2317,2325 **** // } - // Private Company Closure - for (PrivateCompanyI priv: companyManager.getAllPrivateCompanies()) { - if ((!priv.isClosed()) && (priv.closesIfAllExercised() || priv.closesIfAnyExercised())) - possibleActions.add(new ClosePrivate(priv)); - } } --- 2323,2326 ---- Index: PrivateCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PrivateCompanyI.java 21 Mar 2010 17:43:50 -0000 1.11 --- PrivateCompanyI.java 1 May 2010 16:08:13 -0000 1.12 *************** *** 40,43 **** --- 40,44 ---- public boolean closesIfAnyExercised(); public boolean closesAtEndOfTurn(); + public boolean closesManually(); public void checkClosingIfExercised(boolean endOfOR); } Index: PrivateCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PrivateCompany.java 21 Apr 2010 19:16:44 -0000 1.41 --- PrivateCompany.java 1 May 2010 16:08:13 -0000 1.42 *************** *** 30,33 **** --- 30,35 ---- // Close at start of phase protected String closeAtPhaseName = null; + // Manual close possible + protected boolean closeManually = false; protected String blockedHexesString = null; *************** *** 96,100 **** } } ! /* start sfy 1889 */ List<Tag> preventTags = closureTag.getChildren("PreventClosing"); if (preventTags != null) { --- 98,103 ---- } } ! ! /* conditions that prevent closing */ List<Tag> preventTags = closureTag.getChildren("PreventClosing"); if (preventTags != null) { *************** *** 106,110 **** } } ! /* end sfy 1889 */ // Close at start of phase --- 109,118 ---- } } ! ! /* allow manual closure */ ! Tag manualTag = closureTag.getChild("CloseManually"); ! if (manualTag != null) { ! closeManually = true; ! } // Close at start of phase *************** *** 350,353 **** --- 358,365 ---- return closeAtEndOfTurn; } + + public boolean closesManually() { + return closeManually; + } public void checkClosingIfExercised (boolean endOfTurn) { |