From: Erik V. <ev...@us...> - 2010-02-05 19:55:20
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5423/rails/game Modified Files: MapHex.java Log Message: Added fixed infoText. To include city name is known. Index: MapHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/MapHex.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** MapHex.java 3 Feb 2010 20:16:40 -0000 1.35 --- MapHex.java 5 Feb 2010 19:55:01 -0000 1.36 *************** *** 12,17 **** import rails.game.move.Moveable; import rails.game.move.TileMove; ! import rails.util.LocalText; ! import rails.util.Tag; /** --- 12,16 ---- import rails.game.move.Moveable; import rails.game.move.TileMove; ! import rails.util.*; /** *************** *** 64,67 **** --- 63,67 ---- protected int[] tileCost; protected String cityName; + protected String infoText; /** Neighbouring hexes <i>to which track may be laid</i>. */ *************** *** 107,111 **** Pattern namePattern = Pattern.compile("(\\D)(\\d+)"); ! name = tag.getAttributeAsString("name"); Matcher m = namePattern.matcher(name); if (!m.matches()) { --- 107,111 ---- Pattern namePattern = Pattern.compile("(\\D)(\\d+)"); ! infoText = name = tag.getAttributeAsString("name"); Matcher m = namePattern.matcher(name); if (!m.matches()) { *************** *** 168,171 **** --- 168,174 ---- // City name cityName = tag.getAttributeAsString("city", ""); + if (Util.hasValue(cityName)) { + infoText += " " + cityName; + } } *************** *** 927,930 **** --- 930,937 ---- } + public String getInfo () { + return infoText; + } + public boolean equals(MapHex hex) { if (hex.getName().equals(getName()) && hex.row == row |