private int distBetweenPoints(int x1,int z1,int x2,int z2,boolean bAllowDiags){
  int w=Math.abs(x2 - x1);
  int h=Math.abs(z2 - z1);
  if (bAllowDiags) {
    if (w < h)     w=0;
 else     h=0;
  }
  return w + h + 1;
}

private int distBetweenPoints ( int x1 , int z1 , int x2 , int z2 , boolean bAllowDiags ) { int w = Math . abs ( x2 - x1 ) ; int h = Math . abs ( z2 - z1 ) ; if ( bAllowDiags ) { if ( w < h ) w = 0 ; else h = 0 ; } return w + h + 1 ; }
calculate the number of cells on the shortest path between ( x1 , z1 ) and ( x2 , z2 )
