@Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + (flipHorizontally ? 1231 : 1237);
    result = prime * result + (flipVertically ? 1231 : 1237);
    result = prime * result + (objToBgPriority ? 1231 : 1237);
    result = prime * result + ((palette == null) ? 0 : palette.hashCode());
    result = prime * result + ((upperTile == null) ? 0 : upperTile.hashCode());
    result = prime * result + ((lowerTile == null) ? 0 : lowerTile.hashCode());
    result = prime * result + x;
    result = prime * result + y;
    return result;
  }