public int checkPath(Locations start, Locations end, boolean attacking) {

        int row = start.getRow();
        int column = start.getColumn();
        ArrayList<Locations> list = board[row][column].getPath(start, end);

        ColorTeam team = board[row][column].getColorTeam();

        for (Locations x : list) {
            if (board[x.getRow()][x.getColumn()] != null) {
                ColorTeam temp = board[x.getRow()][x.getColumn()].getColorTeam();
                if (team.equals(temp) && !(board[x.getRow()][x.getColumn()] instanceof Knight)) {
                    //team mate in the way - doesn't apply to knights
                    return 0;
                }
            }
        }

        for (int i = 0; i < list.size() - 1; ++i) {
            Locations x = list.get(i);
            if (board[x.getRow()][x.getColumn()] != null) {
                ColorTeam temp = board[x.getRow()][x.getColumn()].getColorTeam();
                if (!team.equals(temp)) {
                    //last piece isn't an opposite color, too long of a move - must attack
                    return 1;
                }
            }
        }

        return 2;
    }