Esempio n. 1
0
        private static bool IsPawnInStartingPosition(ushort squareIndex, Color color)
        {
            var bv             = MovingPieceService.GetBoardValueOfIndex(squareIndex);
            var secondRankMask = MovingPieceService.GetPawnStartRankMask(color);

            return((bv & secondRankMask) != 0);
        }
Esempio n. 2
0
        private static ulong GetPawnShift(ushort squareIndex, Color color)
        {
            var startingRank  = MovingPieceService.GetPawnStartRankMask(color);
            var squareValue   = MovingPieceService.GetBoardValueOfIndex(squareIndex);
            var shift1XMethod = GetShift(color);
            var shift2XMethod = GetDoubleShift(color);

            return(((startingRank & squareValue) != 0 ? shift2XMethod(squareValue) : 0) | shift1XMethod(squareValue));
        }