int (final Point source, final Point point) { if(source.y <= point.y){ return Integer.MAX_VALUE; } else{ final int scale = (point.x - source.x) <= 0 ? 3 : 4; return (source.y - point.y) + Math.abs(point.x - source.x) * scale; } }