@Override
    public Point[] getPath(int x1, int y1, int x2, int y2) {

        startX = x1;
        startY = y1;
        finishX = x2;
        finishY = y2;

        /* here we add points, which are already marked with wave
        * to spread next front of wave from them too*/
        //points.add(Panel.tiles[x1][y1]);
        //points.add(Panel.tiles[x2][y2]);


        points.add(new Point(x1,y1));
        /*Problem is that this loop is infinite - points.size seem to
        * increase constantly*/


            for (int i = 0; i<points.size(); i++)
            {
                if (finished) break;
                makeWave(i);
                /*HashSet hashSet = new HashSet();
                hashSet.addAll(points);
                points.clear();
                points.addAll(hashSet); */

            }
     Point[] path = new Point[points.size()];

     return path;
    }