diff --git a/src/java/com/threerings/whirled/data/SceneModel.java b/src/java/com/threerings/whirled/data/SceneModel.java index 1329441c4..d56561476 100644 --- a/src/java/com/threerings/whirled/data/SceneModel.java +++ b/src/java/com/threerings/whirled/data/SceneModel.java @@ -1,5 +1,5 @@ // -// $Id: SceneModel.java,v 1.2 2001/11/29 00:15:48 mdb Exp $ +// $Id: SceneModel.java,v 1.3 2001/11/29 19:32:06 mdb Exp $ package com.threerings.whirled.data; @@ -7,6 +7,7 @@ import java.io.IOException; import java.io.DataInputStream; import java.io.DataOutputStream; +import com.samskivert.util.StringUtil; import com.threerings.presents.io.Streamable; /** @@ -80,4 +81,25 @@ public class SceneModel implements Streamable model.version = 0; model.neighborIds = new int[0]; } + + /** + * Generates a string representation of this scene model. + */ + public String toString () + { + StringBuffer buf = new StringBuffer("["); + toString(buf); + return buf.append("]").toString(); + } + + /** + * Derived classes override this to tack their toString + * data on to the string buffer. + */ + protected void toString (StringBuffer buf) + { + buf.append("sceneId=").append(sceneId); + buf.append(", version=").append(version); + buf.append(", neighborIds=").append(StringUtil.toString(neighborIds)); + } } diff --git a/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java b/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java index 6473f7d02..21fe280ba 100644 --- a/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java +++ b/src/java/com/threerings/whirled/spot/data/SpotSceneModel.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneModel.java,v 1.2 2001/11/29 00:16:46 mdb Exp $ +// $Id: SpotSceneModel.java,v 1.3 2001/11/29 19:32:06 mdb Exp $ package com.threerings.whirled.spot.data; @@ -7,6 +7,7 @@ import java.io.IOException; import java.io.DataInputStream; import java.io.DataOutputStream; +import com.samskivert.util.StringUtil; import com.threerings.whirled.data.SceneModel; /** @@ -155,4 +156,20 @@ public class SpotSceneModel extends SceneModel model.portalIds = new int[0]; model.targetLocIds = new int[0]; } + + // documentation inherited + protected void toString (StringBuffer buf) + { + super.toString(buf); + buf.append(", locationIds=").append(StringUtil.toString(locationIds)); + buf.append(", locationX=").append(StringUtil.toString(locationX )); + buf.append(", locationY=").append(StringUtil.toString(locationY)); + buf.append(", locationOrients="). + append(StringUtil.toString(locationOrients)); + buf.append(", locationClusters="). + append(StringUtil.toString(locationClusters)); + buf.append(", defaultEntranceId=").append(defaultEntranceId); + buf.append(", portalIds=").append(StringUtil.toString(portalIds)); + buf.append(", targetLocIds=").append(StringUtil.toString(targetLocIds)); + } }