@Override
    public ArrayList<Locations> getPath(Locations begin, Locations end) {

        int startRow = begin.getRow();
        int startColumn = begin.getColumn();

        int endRow = end.getRow();
        int endColumn = end.getColumn();

        ArrayList<Locations> list = new ArrayList<Locations>();
        if (startRow < endRow) {
            if (startColumn < endColumn) {
                for (int i = 1; i <= endRow - startRow; i++) {
                    list.add(new Locations(startRow + i, startColumn + i));
                }
            } else {
                for (int i = 1; i <= endRow - startRow; i++) {
                    list.add(new Locations(startRow + i, startColumn - i));
                }
            }
        } else {
            if (startColumn < endColumn) {
                for (int i = 1; i <= startRow - endRow; i++) {
                    list.add(new Locations(startRow - i, startColumn + i));
                }
            } else {
                for (int i = 1; i <= startRow - endRow; i++) {
                    list.add(new Locations(startRow - i, startColumn - i));
                }
            }
        }


        return list;
    }