Went into an insane bugfixing mode in the core

This commit is contained in:
Obique
2015-02-17 01:13:52 -06:00
committed by Obique
parent 2a086ddb38
commit 61604f715c
14 changed files with 222 additions and 105 deletions
@@ -9,7 +9,7 @@ import resources.objects.intangible.IntangibleObject;
import resources.player.Player;
import utilities.Encoder;
public class WaypointObject extends IntangibleObject implements Encodable{
public class WaypointObject extends IntangibleObject implements Encodable {
private static final long serialVersionUID = 1L;
@@ -55,8 +55,7 @@ public class WaypointObject extends IntangibleObject implements Encodable{
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
@@ -81,6 +80,22 @@ public class WaypointObject extends IntangibleObject implements Encodable{
return bb.array();
}
@Override
public boolean equals(Object o) {
if (!super.equals(o))
return false;
if (o instanceof WaypointObject) {
WaypointObject wp = (WaypointObject) o;
return wp.name.equals(name) && wp.cellNumber == cellNumber && wp.color == color && wp.active == active;
}
return false;
}
@Override
public int hashCode() {
return ((super.hashCode() * 7 + name.hashCode()) * 13 + color.getValue()) * 17 + cellNumber;
}
public enum WaypointColor{
BLUE(1), GREEN(2), ORANGE(3), YELLOW(4), PURPLE(5), WHITE(6), MULTICOLOR(7);