Esempio n. 1
0
        public void GetPieceTest()
        {
            const EPieces expected      = EPieces.BlackKnight;
            var           ps            = new PieceSquare(expected, ESquare.none);
            var           actual        = ps.Piece;
            var           expectedPiece = new Piece(expected);

            Assert.Equal(expectedPiece, actual);
        }
Esempio n. 2
0
        public void GetSquareTest()
        {
            const ESquare expected       = ESquare.a5;
            var           ps             = new PieceSquare(EPieces.NoPiece, expected);
            var           actual         = ps.Square;
            var           expectedSquare = new Square(expected);

            Assert.Equal(expectedSquare, actual);
        }
Esempio n. 3
0
        public void GetSquareTest()
        {
            const Squares expected       = Squares.a5;
            var           ps             = new PieceSquare(Piece.EmptyPiece, expected);
            var           actual         = ps.Square;
            var           expectedSquare = new Square(expected);

            Assert.Equal(expectedSquare, actual);
        }
Esempio n. 4
0
 public void Initialize(int maxDepth)
 {
     _killerMoves = new IPieceSquare[maxDepth + 1, 2];
     for (var depth = 0; depth <= maxDepth; depth++)
     {
         _killerMoves[depth, 0] = new PieceSquare(EPieces.NoPiece, ESquare.none);
         _killerMoves[depth, 1] = new PieceSquare(EPieces.NoPiece, ESquare.none);
     }
     Reset();
 }
Esempio n. 5
0
 public void Initialize(int maxDepth)
 {
     _maxDepth    = maxDepth;
     _killerMoves = new IPieceSquare[maxDepth + 1, 2];
     for (var depth = 0; depth <= maxDepth; depth++)
     {
         _killerMoves[depth, 0] = new PieceSquare(Piece.EmptyPiece, Square.None);
         _killerMoves[depth, 1] = new PieceSquare(Piece.EmptyPiece, Square.None);
     }
     Reset();
 }
Esempio n. 6
0
 /// <summary>
 /// 持ち駒の数を増やします。
 /// </summary>
 private void SetPiece(BWType bwType, PieceSquare ps)
 {
     // 駒位置が"00"の場合は持ち駒となります。
     if (ps.Square.File != 0)
     {
         this.board[ps.Square] = new BoardPiece(ps.Piece, bwType);
     }
     else
     {
         this.board.IncCapturedPieceCount(ps.Piece.PieceType, bwType);
     }
 }
Esempio n. 7
0
 public void GetPieceAndSquareTest()
 {
     for (var pc = EPieces.NoPiece; pc < EPieces.PieceNb; ++pc)
     {
         var expectedPiece = new Piece(pc);
         foreach (var sq in BitBoards.AllSquares)
         {
             var expectedSquare = new Square(sq);
             var ps             = new PieceSquare(expectedPiece, expectedSquare);
             Assert.Equal(expectedPiece, ps.Piece);
             Assert.Equal(expectedSquare, sq);
         }
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 持ち駒の数を増やします。
 /// </summary>
 private void SetPiece(BWType bwType, PieceSquare ps)
 {
     // 駒位置が"00"の場合は持ち駒となります。
     if (ps.Square.File != 0)
     {
         this.board[ps.Square] = new BoardPiece(ps.Piece, bwType);
     }
     else
     {
         this.board.IncCapturedPieceCount(ps.Piece.PieceType, bwType);
     }
 }