From: Stefan F. <ste...@us...> - 2010-06-24 21:48:16
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25799/rails/util Modified Files: Config.java Log Message: Refactoring of HexMap classes to remove zoom problems Added autoscrolling support Added gamespecific config settings Index: Config.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Config.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Config.java 15 May 2010 22:44:46 -0000 1.12 --- Config.java 24 Jun 2010 21:48:08 -0000 1.13 *************** *** 7,10 **** --- 7,12 ---- import org.apache.log4j.Logger; + import rails.game.GameManager; + /** * This is a simple utility class with a collection of static functions to load *************** *** 39,42 **** --- 41,62 ---- } + /** + * First tries to return {key}.{gameName}, if undefined returns {key} + */ + public static String getGameSpecific(String key) { + return Config.getSpecific(key, GameManager.getInstance().getGameName()); + } + + /** + * First tries to return {key}.{appendix}, if undefined returns {key} + */ + public static String getSpecific(String key, String appendix) { + String value = Config.get(key + "." + appendix); + if (value == "") { + value = Config.get(key); + } + return value; + } + public static String get(String key) { |