Ejemplo n.º 1
0
        public static ulong GenerateMovesForPieceBitboard(int piece, int[] board)
        {
            PieceType pt = Util.GetPieceType(piece);

            switch (pt)
            {
            case PieceType.Pawn:
                return(PawnMoveGenerator.PossiblePositionsBitboard(piece, board));

            case PieceType.Night:
                return(KnightMoveGenerator.PossiblePositionsBitboard(piece, board));

            case PieceType.Bishop:
                return(BishopMoveGenerator.PossiblePositionsBitboard(piece, board));

            case PieceType.Rook:
                return(RookMoveGenerator.PossiblePositionsBitboard(piece, board));

            case PieceType.Queen:
                return(QueenMoveGenerator.PossiblePositionsBitboard(piece, board));

            case PieceType.King:
                return(KingMoveGenerator.PossiblePositionsBitboard(piece, board));

            default:
                break;
            }
            return(0);
        }
Ejemplo n.º 2
0
        public static List <int> PossiblePositions(int piece, int[] board)
        {
            List <int> result = BishopMoveGenerator.PossiblePositions(piece, board);

            result.AddRange(RookMoveGenerator.PossiblePositions(piece, board));
            return(result);
        }
Ejemplo n.º 3
0
        public static List <Move> GenerateMovesForPiece(int piece, int[] board)
        {
            PieceType   pt     = Util.GetPieceType(piece);
            List <int>  temp   = new List <int>();
            List <Move> result = new List <Move>();

            switch (pt)
            {
            case PieceType.Pawn:
                temp = PawnMoveGenerator.PossiblePositions(piece, board);
                break;

            case PieceType.Night:
                temp = KnightMoveGenerator.PossiblePositions(piece, board);
                break;

            case PieceType.Bishop:
                temp = BishopMoveGenerator.PossiblePositions(piece, board);
                break;

            case PieceType.Rook:
                temp = RookMoveGenerator.PossiblePositions(piece, board);
                break;

            case PieceType.Queen:
                temp = QueenMoveGenerator.PossiblePositions(piece, board);
                break;

            case PieceType.King:
                temp = KingMoveGenerator.PossiblePositions(piece, board);
                break;

            default:
                break;
            }

            foreach (int m in temp)
            {
                result.Add(new Move(piece, m));
            }
            return(result);
        }
Ejemplo n.º 4
0
 public static ulong PseudomoveBitboard(int piece)
 {
     return(BishopMoveGenerator.PseudomoveBitboard(piece) | RookMoveGenerator.PseudomoveBitboard(piece));
 }
Ejemplo n.º 5
0
 public static ulong PossiblePositionsBitboard(int piece, int[] board)
 {
     return(BishopMoveGenerator.PossiblePositionsBitboard(piece, board) | RookMoveGenerator.PossiblePositionsBitboard(piece, board));
 }