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