public bool IsMoveLegal(Move move) { if (((1ul << move.From) & Occupancy[ColorToMove]) == 0) { return(false); } var fromPiece = PieceTable[move.From]; switch (fromPiece) { case Piece.Pawn: return(PawnOperator.IsMoveLegal(this, move)); case Piece.Knight: return(KnightOperator.IsMoveLegal(this, move)); case Piece.Bishop: return(BishopOperator.IsMoveLegal(this, move)); case Piece.Rook: return(RookOperator.IsMoveLegal(this, move)); case Piece.Queen: return(QueenOperator.IsMoveLegal(this, move)); case Piece.King: return(KingOperator.IsMoveLegal(this, move)); } return(false); }
public int GetQuietMoves(Span <Move> moves, int offset, ulong evasionMask) { var movesCount = PawnOperator.GetQuietMoves(this, moves, offset, evasionMask); movesCount = KnightOperator.GetQuietMoves(this, moves, movesCount, evasionMask); movesCount = BishopOperator.GetQuietMoves(this, moves, movesCount, evasionMask); movesCount = RookOperator.GetQuietMoves(this, moves, movesCount, evasionMask); movesCount = QueenOperator.GetQuietMoves(this, moves, movesCount, evasionMask); movesCount = KingOperator.GetQuietMoves(this, moves, movesCount); return(movesCount); }
public int GetAvailableCaptureMoves(Span <Move> moves) { var movesCount = PawnOperator.GetAvailableCaptureMoves(this, moves, 0); movesCount = KnightOperator.GetAvailableCaptureMoves(this, moves, movesCount); movesCount = BishopOperator.GetAvailableCaptureMoves(this, moves, movesCount); movesCount = RookOperator.GetAvailableCaptureMoves(this, moves, movesCount); movesCount = QueenOperator.GetAvailableCaptureMoves(this, moves, movesCount); movesCount = KingOperator.GetAvailableCaptureMoves(this, moves, movesCount); return(movesCount); }
public int GetLoudMoves(Span <Move> moves, int offset) { var movesCount = PawnOperator.GetLoudMoves(this, moves, offset); movesCount = KnightOperator.GetLoudMoves(this, moves, movesCount); movesCount = BishopOperator.GetLoudMoves(this, moves, movesCount); movesCount = RookOperator.GetLoudMoves(this, moves, movesCount); movesCount = QueenOperator.GetLoudMoves(this, moves, movesCount); movesCount = KingOperator.GetLoudMoves(this, moves, movesCount); return(movesCount); }