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); }
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); }
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); }
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(); }
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(); }
/// <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); } }
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); } } }