From 9e9ac7f2d39893daff8f692537e7528b90680991 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Tue, 8 Jun 2010 01:42:12 +0000 Subject: [PATCH] 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 --- .../com/threerings/stage/data/StageSceneModel.java | 6 +++--- .../threerings/stage/tools/xml/StageSceneWriter.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/stage/data/StageSceneModel.java b/src/java/com/threerings/stage/data/StageSceneModel.java index 68444eba..8ec134e6 100644 --- a/src/java/com/threerings/stage/data/StageSceneModel.java +++ b/src/java/com/threerings/stage/data/StageSceneModel.java @@ -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 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); } diff --git a/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java b/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java index c0e566f1..75b99888 100644 --- a/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java +++ b/src/java/com/threerings/stage/tools/xml/StageSceneWriter.java @@ -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 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");