Added default equals method to MapTile.

This commit is contained in:
FrozenCow 2011-03-01 01:58:33 +01:00
parent 9fea1eafdb
commit 1755411545

View File

@ -25,4 +25,13 @@ public abstract class MapTile {
public int hashCode() { public int hashCode() {
return getFilename().hashCode() ^ getWorld().hashCode(); return getFilename().hashCode() ^ getWorld().hashCode();
} }
@Override
public boolean equals(Object obj) {
if (obj instanceof MapTile) {
MapTile t = (MapTile)obj;
return getFilename().equals(t.getFilename()) && getWorld().equals(t.getWorld());
}
return super.equals(obj);
}
} }