src/main/java/com/webcheckers/model/Game.java
/**
     * Checks if a move is valid
     * @param move
     * @return true if move is valid, false otherwise
     * @throws Exception
     */
Checks if a move is valid
@param move
@return true if move is valid, false otherwise
@throws Exception
Checks if a move is valid @param move @return true if move is valid false otherwise @throws Exception
public boolean isMoveValid(Move move) throws Exception {
        Position start = move.getStart();
        Position end = move.getEnd();
        if (start.getRow() > 7 || start.getCell() > 7 || start.getRow() < 0 || start.getCell() < 0) {
            throw new Exception("Index request out of bounds");
        } 
        Space startSpace = boardView.getSpace(start.getRow(), start.getCell());
        Space endSpace = boardView.getSpace(end.getRow(), end.getCell());
        Piece startPiece = startSpace.getPiece();
        Piece endPiece = endSpace.getPiece();
        if (startSpace.getColor() == Space.Color.LIGHT || endSpace.getColor() == Space.Color.LIGHT) {
            throw new Exception("Pieces only on black squares.");
        }
        else if (startPiece == null) {
            throw new Exception("No piece on start square.");
        }
        else if (endPiece != null) {
            throw new Exception("Already a piece present on end square.");
        }
        if (turn.getNum() == 1 && this.turn.getCapturedLen() == 0){
            throw new Exception("Invalid Move.");
        }
        if (Math.abs(start.getRow() - end.getRow()) == 1) {
            return isValidNormalMoveSingle(move);
        }
        else {
            boolean b = isValidJump(move);
            if (!b){
                throw new Exception("Not a Valid Move.");
            } else {
                setTurnAttr(move.getEnd().getRow(), move.getEnd().getCell());
            }
            return true;
        }
    }
public boolean isMoveValid ( Move move ) throws Exception { Position start = move . getStart ( ) ; Position end = move . getEnd ( ) ; if ( start . getRow ( ) > 7 || start . getCell ( ) > 7 || start . getRow ( ) < 0 || start . getCell ( ) < 0 ) { throw new Exception ( "Index request out of bounds" ) ; } Space startSpace = boardView . getSpace ( start . getRow ( ) , start . getCell ( ) ) ; Space endSpace = boardView . getSpace ( end . getRow ( ) , end . getCell ( ) ) ; Piece startPiece = startSpace . getPiece ( ) ; Piece endPiece = endSpace . getPiece ( ) ; if ( startSpace . getColor ( ) == Space . Color . LIGHT || endSpace . getColor ( ) == Space . Color . LIGHT ) { throw new Exception ( "Pieces only on black squares." ) ; } else if ( startPiece == null ) { throw new Exception ( "No piece on start square." ) ; } else if ( endPiece != null ) { throw new Exception ( "Already a piece present on end square." ) ; } if ( turn . getNum ( ) == 1 && this . turn . getCapturedLen ( ) == 0 ) { throw new Exception ( "Invalid Move." ) ; } if ( Math . abs ( start . getRow ( ) - end . getRow ( ) ) == 1 ) { return isValidNormalMoveSingle ( move ) ; } else { boolean b = isValidJump ( move ) ; if ( ! b ) { throw new Exception ( "Not a Valid Move." ) ; } else { setTurnAttr ( move . getEnd ( ) . getRow ( ) , move . getEnd ( ) . getCell ( ) ) ; } return true ; } }
Checks if a move is valid
 @param move
 @return true if move is valid, false otherwise
 @throws Exception
Checks if a move is valid @param move @return true if move is valid false otherwise @throws Exception
// handles king as well as normal jump moves