From c8cd17fb7e3989c7536bd8cb6d3bb10a7ca9cf6a Mon Sep 17 00:00:00 2001 From: tmpillbox Date: Thu, 28 Aug 2014 19:41:33 -0500 Subject: [PATCH] CoordTuple requires equals() method for use as Hashkey --- src/mantle/world/CoordTuple.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mantle/world/CoordTuple.java b/src/mantle/world/CoordTuple.java index 45274ae..b09a516 100644 --- a/src/mantle/world/CoordTuple.java +++ b/src/mantle/world/CoordTuple.java @@ -26,6 +26,15 @@ public class CoordTuple implements Comparable else return false; } + + public boolean equals (Object obj) { + if (!(obj instanceof CoordTuple)) { + return false; + } + + CoordTuple that = (CoordTuple)obj; + return this.x == that.x && this.y == that.y && this.z == that.z; + } @Override public int hashCode ()