Change a StreamableIntIntMap into a more standard StreamableHashMap
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@920 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
package com.threerings.stage.data;
|
||||
|
||||
import com.threerings.util.StreamableIntIntMap;
|
||||
import com.threerings.util.StreamableHashMap;
|
||||
|
||||
import com.threerings.whirled.data.SceneModel;
|
||||
import com.threerings.whirled.spot.data.SpotSceneModel;
|
||||
@@ -44,7 +44,7 @@ public class StageSceneModel extends SceneModel
|
||||
|
||||
/** If non-null, contains default colorizations to use for objects
|
||||
* that do not have colorizations defined. */
|
||||
public StreamableIntIntMap defaultColors;
|
||||
public StreamableHashMap<Integer, Integer> defaultColors;
|
||||
|
||||
/**
|
||||
* Get the default color to use for the specified colorization
|
||||
@@ -74,7 +74,7 @@ public class StageSceneModel extends SceneModel
|
||||
|
||||
} else {
|
||||
if (defaultColors == null) {
|
||||
defaultColors = new StreamableIntIntMap();
|
||||
defaultColors = StreamableHashMap.newMap();
|
||||
}
|
||||
defaultColors.put(classId, colorId);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
package com.threerings.stage.tools.xml;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
|
||||
@@ -65,14 +67,12 @@ public class StageSceneWriter extends SceneWriter
|
||||
StageSceneModel sscene = (StageSceneModel)scene;
|
||||
if (sscene.defaultColors != null) {
|
||||
writer.startElement("zations");
|
||||
int[] keys = sscene.defaultColors.getKeys();
|
||||
for (int key : keys) {
|
||||
int value = sscene.defaultColors.get(key);
|
||||
for (Map.Entry<Integer, Integer> entry : sscene.defaultColors.entrySet()) {
|
||||
AttributesImpl attrs = new AttributesImpl();
|
||||
attrs.addAttribute("", "classId", "", "",
|
||||
String.valueOf(key));
|
||||
String.valueOf(entry.getKey()));
|
||||
attrs.addAttribute("", "colorId", "", "",
|
||||
String.valueOf(value));
|
||||
String.valueOf(entry.getValue()));
|
||||
writer.emptyElement("", "zation", "", attrs);
|
||||
}
|
||||
writer.endElement("zations");
|
||||
|
||||
Reference in New Issue
Block a user