/* * Since a Queen can move like either a Rook or a Bishop, reuses their ValidMove * code in the MoveValidator */ public bool IsValidMove(GameBoard gb, Square fromSquare, Square toSquare) { bool rookValid = MoveValidator.RookMove(gb, fromSquare, toSquare); bool bishopValid = MoveValidator.BishopMove(gb, fromSquare, toSquare); if (rookValid || bishopValid) { return(true); } return(false); }
/* * This method is in the MoveValidator class so the Queen class can reuse this code as well */ public bool IsValidMove(GameBoard gb, Square fromSquare, Square toSquare) { return(MoveValidator.BishopMove(gb, fromSquare, toSquare)); }