コード例 #1
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);
        }
コード例 #2
0
    public static void SetScorePrecision(ref ulong cachedPositionData, ScorePrecision scorePrecision)
    {
        var value = (ulong)scorePrecision;

        // Clear
        cachedPositionData &= _scorePrecisionUnmask;
        // Set
        cachedPositionData |= (value << _scorePrecisionShift) & _scorePrecisionMask;
        // Validate cached position.
        Debug.Assert(ScorePrecision(cachedPositionData) == scorePrecision);
    }