예제 #1
0
 @Override
 public int hashCode() {
   if (data instanceof Tile) {
     Tile tile = (Tile) data;
     int result = tile.getPos().getX();
     result = 31 * result + tile.getPos().getY();
     return result;
   } else {
     return getId();
   }
 }
예제 #2
0
 public Node(Tile data) {
   Position pos = data.getPos();
   this.id = pos.getX() * 31 + pos.getY();
   this.data = (T) data;
 }