The fancy equals() turned out not to be useful based on the semantics of
List.indexOf(), etc. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@747 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,10 +1,8 @@
|
|||||||
//
|
//
|
||||||
// $Id: Location.java,v 1.4 2001/12/05 09:06:30 mdb Exp $
|
// $Id: Location.java,v 1.5 2001/12/05 09:14:29 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.whirled.spot.data;
|
package com.threerings.whirled.spot.data;
|
||||||
|
|
||||||
import java.awt.Point;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A location represents a place to stand in a scene. More specifically,
|
* A location represents a place to stand in a scene. More specifically,
|
||||||
* it is a geometric location in a scene with an orientation that would be
|
* it is a geometric location in a scene with an orientation that would be
|
||||||
@@ -32,11 +30,7 @@ public class Location
|
|||||||
public int clusterIndex;
|
public int clusterIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location equality is determined by location id. Locations will
|
* Location equality is determined by location id.
|
||||||
* claim to be equal to an <code>Integer</code> object with a value
|
|
||||||
* equal to the location id and will claim to be equal to a
|
|
||||||
* <code>Point</code> object with x and y coordinates equal to the x
|
|
||||||
* and y coordinates of the location.
|
|
||||||
*/
|
*/
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
@@ -44,13 +38,6 @@ public class Location
|
|||||||
Location oloc = (Location)other;
|
Location oloc = (Location)other;
|
||||||
return locationId == oloc.locationId;
|
return locationId == oloc.locationId;
|
||||||
|
|
||||||
} else if (other instanceof Integer) {
|
|
||||||
return locationId == ((Integer)other).intValue();
|
|
||||||
|
|
||||||
} else if (other instanceof Point) {
|
|
||||||
Point p = (Point)other;
|
|
||||||
return (x == p.x && y == p.y);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user