Ejemplo n.º 1
0
 public PawnMovesGenerator(BitBoard board, AttacksGenerator generator)
     : base(board, generator)
 {
     this.movesReferences = new Move[4][][][][];
     this.movesReferences[(int)PawnTarget.SinglePush] = PawnBitBoardHelper.QuietMoves;
     this.movesReferences[(int)PawnTarget.LeftAttack] = PawnBitBoardHelper.AttacksLeftMoves;
     this.movesReferences[(int)PawnTarget.RightAttack] = PawnBitBoardHelper.AttacksRightMoves;
     this.movesReferences[(int)PawnTarget.DoublePush] = PawnBitBoardHelper.DoublePushes;
 }
Ejemplo n.º 2
0
 public static MovesGenerator CreateGenerator(Figure figureType, BitBoard bb, AttacksGenerator ag)
 {
     switch (figureType)
     {
     case Figure.Pawn:
         return new PawnMovesGenerator(bb, ag);
     case Figure.Knight:
     case Figure.Bishop:
     case Figure.Rook:
     case Figure.Queen:
         return new MovesGenerator(bb, ag);
     case Figure.King:
         return new KingMovesGenerator(bb, ag);
     default:
         return null;
     }
 }
Ejemplo n.º 3
0
 public MovesGenerator(BitBoard bitboard, AttacksGenerator attacksgenerator)
 {
     this.board = bitboard;
     this.generator = attacksgenerator;
 }
Ejemplo n.º 4
0
 public KingMovesGenerator(BitBoard bitboard, AttacksGenerator attacksgenerator)
     : base(bitboard, attacksgenerator)
 {
     this.kingBoard = (KingBitBoard)bitboard;
 }