Waffle waffle. Changed MisoScene back to returning lists rather than

arrays for locations, portals and clusters.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@355 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-09-28 01:31:32 +00:00
parent b567223419
commit cdaea4bbab
7 changed files with 63 additions and 59 deletions
@@ -1,9 +1,9 @@
//
// $Id: ClusterUtil.java,v 1.2 2001/09/21 02:30:35 mdb Exp $
// $Id: ClusterUtil.java,v 1.3 2001/09/28 01:31:32 mdb Exp $
package com.threerings.miso.scene.util;
import java.util.ArrayList;
import java.util.List;
import com.threerings.miso.Log;
import com.threerings.miso.scene.*;
@@ -22,11 +22,11 @@ public class ClusterUtil
* @param clusters the cluster list.
* @param loc the location.
*/
public static int getClusterIndex (Cluster[] clusters, Location loc)
public static int getClusterIndex (List clusters, Location loc)
{
int size = clusters.length;
int size = clusters.size();
for (int ii = 0; ii < size; ii++) {
Cluster cluster = clusters[ii];
Cluster cluster = (Cluster)clusters.get(ii);
if (cluster.contains(loc)) {
return ii;
}
@@ -40,7 +40,7 @@ public class ClusterUtil
* @param clusters the cluster array.
* @param loc the location.
*/
public static void remove (ArrayList clusters, Location loc)
public static void remove (List clusters, Location loc)
{
int size = clusters.size();
for (int ii = 0; ii < size; ii++) {
@@ -78,8 +78,7 @@ public class ClusterUtil
* @param clusteridx the cluster index, or -1 to remove the location
* from any cluster.
*/
public static void regroup (ArrayList clusters, Location loc,
int clusteridx)
public static void regroup (List clusters, Location loc, int clusteridx)
{
// just remove the location if clusteridx is -1
if (clusteridx == -1) {
@@ -1,8 +1,10 @@
//
// $Id: MisoSceneUtil.java,v 1.1 2001/09/21 02:30:35 mdb Exp $
// $Id: MisoSceneUtil.java,v 1.2 2001/09/28 01:31:32 mdb Exp $
package com.threerings.miso.scene.util;
import java.util.List;
import com.threerings.miso.scene.*;
/**
@@ -25,10 +27,10 @@ public class MisoSceneUtil
*/
public static Location getLocation (MisoScene scene, int x, int y)
{
Location[] locs = scene.getLocations();
int size = locs.length;
List locs = scene.getLocations();
int size = locs.size();
for (int ii = 0; ii < size; ii++) {
Location loc = locs[ii];
Location loc = (Location)locs.get(ii);
if (loc.x == x && loc.y == y) {
return loc;
}
@@ -47,10 +49,10 @@ public class MisoSceneUtil
*/
public static Portal getPortal (MisoScene scene, String name)
{
Portal[] portals = scene.getPortals();
int size = portals.length;
List portals = scene.getPortals();
int size = portals.size();
for (int ii = 0; ii < size; ii++) {
Portal portal = portals[ii];
Portal portal = (Portal)portals.get(ii);
if (portal.name.equals(name)) {
return portal;
}