public boolean findPath(final PathSource pathSource,
                            final PathDestination pathDestination,
                            int sx, int sy)
    {
        clear();

        HashSet <Point> marks = new HashSet <Point> ();
        ArrayList <Node> queue = new ArrayList <Node> ();

        queue.add(new Node(sx, sy));
        marks.add(new Point(sx, sy));

        Node p;

        do {
            p = (Node)queue.remove(0);

            if(pathDestination.isDestinationReached(p.x, p.y)) {
                // Hajo: destination found
                // unwind path

                Stack <Node> stack = new Stack <Node> ();

                while(p.link != null) {
                    stack.push(p);
                    p = p.link;
                }

                // Hajo: Push starting node
                stack.push(p);

                // Hajo: Setup path
                while(stack.isEmpty() == false) {
                    p = stack.pop();
                    addStep(p.x, p.y);
                }

                return true;
            } else {
                // Recursive pathfinding in the 4 cardinal directions.
                checkMove(pathSource, marks, queue, p, 1, 0);
                checkMove(pathSource, marks, queue, p, 0, 1);
                checkMove(pathSource, marks, queue, p, -1, 0);
                checkMove(pathSource, marks, queue, p, 0, -1);

                if(useDiagonals) {
                    checkMove(pathSource, marks, queue, p, 1, 1);
                    checkMove(pathSource, marks, queue, p, 1, -1);
                    checkMove(pathSource, marks, queue, p, -1, 1);
                    checkMove(pathSource, marks, queue, p, -1, -1);
                }
            }
         } while(queue.isEmpty() == false);

        return false;
    }