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 RelativeSquareWhiteTest() { const ESquare expected = ESquare.c3; var s = new Square(ERank.Rank3, EFile.FileC); var actual = s.Relative(PlayerExtensions.White); Assert.Equal(expected, actual); }
public void RelativeSquareBlackTest() { const ESquare expected = ESquare.h8; var s = new Square(ERank.Rank1, EFile.FileH); var actual = s.Relative(PlayerExtensions.Black); Assert.Equal(expected, actual); }
public void AlignedSimplePositiveTest() { const bool expected = true; const ESquare sq1 = ESquare.a1; const ESquare sq2 = ESquare.a2; const ESquare sq3 = ESquare.a3; var actual = BitBoards.Aligned(sq1, sq2, sq3); Assert.Equal(expected, actual); }
public static BitBoard BitBoardSquare(this ESquare sq) => BitBoards.BbSquares[(int)sq];