Added support for visiting just the interesting objects.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2933 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-01-11 12:21:17 +00:00
parent 0315c4316f
commit 197067593f
@@ -1,5 +1,5 @@
// //
// $Id: SparseMisoSceneModel.java,v 1.9 2003/05/27 19:04:29 mdb Exp $ // $Id: SparseMisoSceneModel.java,v 1.10 2004/01/11 12:21:17 mdb Exp $
package com.threerings.miso.data; package com.threerings.miso.data;
@@ -256,6 +256,17 @@ public class SparseMisoSceneModel extends MisoSceneModel
* Informs the supplied visitor of each object in this scene. * Informs the supplied visitor of each object in this scene.
*/ */
public void visitObjects (ObjectVisitor visitor) public void visitObjects (ObjectVisitor visitor)
{
visitObjects(visitor, false);
}
/**
* Informs the supplied visitor of each object in this scene.
*
* @param interestingOnly if true, only the interesting objects will
* be visited.
*/
public void visitObjects (ObjectVisitor visitor, boolean interestingOnly)
{ {
for (Iterator iter = getSections(); iter.hasNext(); ) { for (Iterator iter = getSections(); iter.hasNext(); ) {
Section sect = (Section)iter.next(); Section sect = (Section)iter.next();
@@ -263,6 +274,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
ObjectInfo oinfo = sect.objectInfo[oo]; ObjectInfo oinfo = sect.objectInfo[oo];
visitor.visit(oinfo); visitor.visit(oinfo);
} }
if (!interestingOnly) {
ObjectInfo info = new ObjectInfo(); ObjectInfo info = new ObjectInfo();
for (int oo = 0; oo < sect.objectTileIds.length; oo++) { for (int oo = 0; oo < sect.objectTileIds.length; oo++) {
info.tileId = sect.objectTileIds[oo]; info.tileId = sect.objectTileIds[oo];
@@ -272,6 +284,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
} }
} }
} }
}
// documentation inherited // documentation inherited
public int getBaseTileId (int col, int row) public int getBaseTileId (int col, int row)