From: Kimmo R. <ki...@us...> - 2011-10-26 17:16:47
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/core/engine In directory vz-cvs-4.sog:/tmp/cvs-serv15550/src/games/stendhal/server/core/engine Modified Files: ZoneAttributes.java Log Message: Load zone attributes from xml Index: ZoneAttributes.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/core/engine/ZoneAttributes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ZoneAttributes.java 2 Oct 2011 21:27:03 -0000 1.1 --- ZoneAttributes.java 26 Oct 2011 17:16:45 -0000 1.2 *************** *** 18,21 **** --- 18,23 ---- import java.io.IOException; import java.util.Calendar; + import java.util.Map; + import java.util.Map.Entry; import marauroa.common.game.RPObject; *************** *** 73,87 **** * @param value */ ! public void put(String key, String value) { ! attr.put(key, value); invalidate(); } /** * Call this, if the zone should be colored by the daylight. The attributes * will set the appropriate blend mode, and keep updating the the color * value as needed. */ ! public void setColorByDaytime() { put("color_method", "multiply"); colorByDaytime = true; --- 75,105 ---- * @param value */ ! private void put(String key, String value) { ! // Interpret special values ! if ("color_method".equals(key) && "time".equals(value)) { ! setColorByDaytime(); ! } else { ! attr.put(key, value); ! } invalidate(); } /** + * Set all attributes. + * + * @param map map of attributes + */ + public void putAll(Map<String, String> map) { + for (Entry<String, String> entry : map.entrySet()) { + put(entry.getKey(), entry.getValue()); + } + } + + /** * Call this, if the zone should be colored by the daylight. The attributes * will set the appropriate blend mode, and keep updating the the color * value as needed. */ ! private void setColorByDaytime() { put("color_method", "multiply"); colorByDaytime = true; |