Added default equals method to MapTile.
This commit is contained in:
parent
9fea1eafdb
commit
1755411545
1 changed files with 9 additions and 0 deletions
|
|
@ -25,4 +25,13 @@ public abstract class MapTile {
|
|||
public int 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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue