Implemented the isLegalMove for the Rook Class