Пример #1
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    CompoundMoveAction that = (CompoundMoveAction) o;

    if (startingCoords != null
        ? !startingCoords.equals(that.startingCoords)
        : that.startingCoords != null) return false;
    return !(moveInstructions != null
        ? !moveInstructions.equals(that.moveInstructions)
        : that.moveInstructions != null);
  }
Пример #2
0
 @Override
 public int hashCode() {
   int result = startingCoords != null ? startingCoords.hashCode() : 0;
   result = 31 * result + (moveInstructions != null ? moveInstructions.hashCode() : 0);
   return result;
 }