// Path: core/src/com/galvarez/ttw/utils/FloatPair.java
// public final class FloatPair {
// 
//   public final float x, y;
// 
//   public FloatPair(float x, float y) {
//     this.x = x;
//     this.y = y;
//   }
// 
//   @Override
//   public boolean equals(Object obj) {
//     if (obj instanceof FloatPair)
//       return equals((FloatPair) obj);
//     return false;
//   }
// 
//   public boolean equals(FloatPair p) {
//     return x == p.x && y == p.y;
//   }
// 
//   @Override
//   public String toString() {
//     return "(" + x + "," + y + ")";
//   }
// }
// 
// Path: core/src/com/galvarez/ttw/utils/MyMath.java
// public class MyMath {
// 	public static int min(int a, int b) {
// 		if (a < b) return a;
// 		return b;
// 	}
// 	
// 	public static int min(int a, int b, int c) {
// 		if (min(a,b) < c) return min(a,b);
// 		return c;
// 	}
// 	
// 	public static int max(int a, int b) {
// 		if (a > b) return a;
// 		return b;
// 	}
// 	
// 	public static int pow(int a, int b) {
// 		if (b > 1) return a*pow(a,b-1);
// 		else return a;
// 	}
// }


import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector3;
import com.galvarez.ttw.utils.FloatPair;
import com.galvarez.ttw.utils.MyMath;
    TOP_RIGHT {
      @Override
      public MapPosition getNeighbor(int x, int y) {
        return new MapPosition(x + 1, y + (x % 2));
      }
    };

    abstract public MapPosition getNeighbor(int x, int y);

    public final MapPosition getNeighbor(MapPosition pos) {
      return getNeighbor(pos.x, pos.y);
    }
  }

  public static int distance(MapPosition p0, MapPosition p1) {
    int x0 = p0.x;
    int y0 = p0.y;
    int x1 = p1.x;
    int y1 = p1.y;

    int dx = Math.abs(x1 - x0);
    int dy = Math.abs(y1 - y0);

    // The distance can be tricky, because of how the columns are shifted.
    // Different cases must be considered, because the dx and dy above
    // are not sufficient to determine distance.

    if ((dx) % 2 == 0) {
      // distance from even->even or odd->odd column
      // important to know since evens and odds are offset
// Path: core/src/com/galvarez/ttw/utils/FloatPair.java
// public final class FloatPair {
// 
//   public final float x, y;
// 
//   public FloatPair(float x, float y) {
//     this.x = x;
//     this.y = y;
//   }
// 
//   @Override
//   public boolean equals(Object obj) {
//     if (obj instanceof FloatPair)
//       return equals((FloatPair) obj);
//     return false;
//   }
// 
//   public boolean equals(FloatPair p) {
//     return x == p.x && y == p.y;
//   }
// 
//   @Override
//   public String toString() {
//     return "(" + x + "," + y + ")";
//   }
// }
// 
// Path: core/src/com/galvarez/ttw/utils/MyMath.java
// public class MyMath {
// 	public static int min(int a, int b) {
// 		if (a < b) return a;
// 		return b;
// 	}
// 	
// 	public static int min(int a, int b, int c) {
// 		if (min(a,b) < c) return min(a,b);
// 		return c;
// 	}
// 	
// 	public static int max(int a, int b) {
// 		if (a > b) return a;
// 		return b;
// 	}
// 	
// 	public static int pow(int a, int b) {
// 		if (b > 1) return a*pow(a,b-1);
// 		else return a;
// 	}
// }


// Path: core/src/com/galvarez/ttw/model/map/MapTools.java
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector3;
import com.galvarez.ttw.utils.FloatPair;
import com.galvarez.ttw.utils.MyMath;

    TOP_RIGHT {
      @Override
      public MapPosition getNeighbor(int x, int y) {
        return new MapPosition(x + 1, y + (x % 2));
      }
    };

    abstract public MapPosition getNeighbor(int x, int y);

    public final MapPosition getNeighbor(MapPosition pos) {
      return getNeighbor(pos.x, pos.y);
    }
  }

  public static int distance(MapPosition p0, MapPosition p1) {
    int x0 = p0.x;
    int y0 = p0.y;
    int x1 = p1.x;
    int y1 = p1.y;

    int dx = Math.abs(x1 - x0);
    int dy = Math.abs(y1 - y0);

    // The distance can be tricky, because of how the columns are shifted.
    // Different cases must be considered, because the dx and dy above
    // are not sufficient to determine distance.

    if ((dx) % 2 == 0) {
      // distance from even->even or odd->odd column
      // important to know since evens and odds are offset
      return MyMath.max(dx, dx / 2 + dy);