Chess.Data.Piece.Queen.IsLegalMove C# (CSharp) Méthode

IsLegalMove() public méthode

public IsLegalMove ( Square board, Move move, IEnumerable pastMoves = null ) : bool
board Chess.Data.Entities.Square
move Chess.Data.Entities.Move
pastMoves IEnumerable
Résultat bool
        public override bool IsLegalMove(Square[][] board, Move move, IEnumerable<Move> pastMoves = null)
        {
            ValidateNotAttackingSameTeam(board, move);

            if (!HasLegalMovementModifiers(move))
                throw new Exception("You may move diagonal, vertical, or horizontal with a queen.");
            if (HasCollision(board, move))
                throw new Exception("There is a piece between your queen and your destination!");

            return true;
        }