/** * 2 Actions are considered equals if they share the same Entity, no matter the action identity or state. This is because 1 Entity can only have one action at a time. * * @param o Object to test for equality. * @return <code>true</code> if the test object is an action with the same Entity as this object. */ @Override public final boolean equals(final Object o) { return o instanceof Action && this.id.equals(((Action) o).id); }
/** * @param id Player to check. * @return <code>true</code> if the player is world. */ public boolean isWorld(final PlayerId id) { return Player.WORLD.id.equals(id); }
@Override public int hashCode() { int result = entity.hashCode(); result = 31 * result + hitPoint; return result; } }
/** * @return The hash code computed from the id. */ @Override public int hashCode() { return this.id.hashCode(); }
@Override public boolean equals(final Object o) { return this == o || o instanceof BaseEntity && this.id.equals(((BaseEntity) o).id); }
public static Version beta(int major, int minor, int sub, int rev) { return new Version(VersionType.BETA, major, minor, sub, rev); }
@Override public int hashCode() { int result = version.hashCode(); result = 31 * result + (int) (serverTime ^ (serverTime >>> 32)); return result; } }
@Override public int hashCode() { int result = major; result = 31 * result + minor; result = 31 * result + sub; result = 31 * result + rev; result = 31 * result + type.hashCode(); return result; }
/** * @return The used Entity hashCode. */ @Override public final int hashCode() { return this.id.hashCode(); }
/** * Retrieve an Id from a value. * * @param value Id value to get, positive and negative values are allowed, -1 is WORLD. * @return The Id with the internal value correspond to the parameter. */ public static WorldId valueOf(final int value) { if (!WorldId.LIST.containsKey(value)) { WorldId.LIST.put(value, new WorldId(value)); } return WorldId.LIST.get(value); }
@Override public final boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof Session)) { return false; } Session other = (Session) obj; return this.player.equals(other.player); } }
@Override public final int hashCode() { return this.id.hashCode(); }
@Override public final int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.player == null) ? 0 : this.player.hashCode()); return result; }
public static Version release(int major, int minor, int sub, int rev) { return new Version(VersionType.RELEASE, major, minor, sub, rev); }
/** * Check if 2 Actions are the same type and coming from the same module. * * @param a Other action to test. * @return <code>true</code> if the 2 actions have the same type. */ public final boolean isSameType(final Action a) { return this.id.equals(a.id); }
public static Version alpha(int major, int minor, int sub, int rev) { return new Version(VersionType.ALPHA, major, minor, sub, rev); }