Ejemplo n.º 1
0
        /*
         * 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);
        }
Ejemplo n.º 2
0
 /*
  * 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.RookMove(gb, fromSquare, toSquare));
 }