Exemple #1
0
 public static void SetBestMoveFrom(ref ulong Data, int BestMoveFrom)
 {
     // Clear
     Data &= _bestMoveFromUnmask;
     // Set
     Data |= ((ulong)BestMoveFrom << _bestMoveFromShift) & _bestMoveFromMask;
     // Validate cached position.
     Debug.Assert(CachedPositionData.BestMoveFrom(Data) == BestMoveFrom);
 }
Exemple #2
0
 public static void SetToHorizon(ref ulong Data, int ToHorizon)
 {
     // Clear
     Data &= _toHorizonUnmask;
     // Set
     Data |= ((ulong)ToHorizon << _toHorizonShift) & _toHorizonMask;
     // Validate cached position.
     Debug.Assert(CachedPositionData.ToHorizon(Data) == ToHorizon);
 }
Exemple #3
0
 public static void SetLastAccessed(ref ulong Data, byte LastAccessed)
 {
     // Clear
     Data &= _lastAccessedUnmask;
     // Set
     Data |= LastAccessed & _lastAccessedMask;
     // Validate cached position.
     Debug.Assert(CachedPositionData.LastAccessed(Data) == LastAccessed);
 }
Exemple #4
0
 public static void SetBestMovePromotedPiece(ref ulong Data, int BestMovePromotedPiece)
 {
     // Clear
     Data &= _bestMovePromotedPieceUnmask;
     // Set
     Data |= ((ulong)BestMovePromotedPiece << _bestMovePromotedPieceShift) & _bestMovePromotedPieceMask;
     // Validate cached position.
     Debug.Assert(CachedPositionData.BestMovePromotedPiece(Data) == BestMovePromotedPiece);
 }
Exemple #5
0
        public static void SetScorePrecision(ref ulong Data, ScorePrecision ScorePrecision)
        {
            var scorePrecision = (ulong)ScorePrecision;

            // Clear
            Data &= _scorePrecisionUnmask;
            // Set
            Data |= (scorePrecision << _scorePrecisionShift) & _scorePrecisionMask;
            // Validate cached position.
            Debug.Assert(CachedPositionData.ScorePrecision(Data) == ScorePrecision);
        }
Exemple #6
0
        public static void SetScore(ref ulong Data, int Score)
        {
            // Ensure cached score is a positive number.
            var score = Score + _scorePadding;

            // Clear
            Data &= _scoreUnmask;
            // Set
            Data |= ((ulong)score << _scoreShift) & _scoreMask;
            // Validate cached position.
            Debug.Assert(CachedPositionData.Score(Data) == Score);
        }