Class MaskUtil
Utility for bits masking.
public static class MaskUtil
- Inheritance
-
MaskUtil
- Inherited Members
Methods
GetMaskedValue<T>(T, T, bool)
Get converted src which all bits from mask is committing or not.
If isCommitting is true, return src OR mask;
otherwise , return src AND (~mask).
public static T GetMaskedValue<T>(this T src, T mask, bool isCommitting) where T : struct
Parameters
srcTsrc
maskTmask
isCommittingboolis committing or cancelling
Returns
- T
Converted value
Type Parameters
Tnumber type
SetMask<T>(ref T, T, bool)
Set src converted by which all bits from mask is committing or not.
If isCommitting is true, return src OR mask;
otherwise , return src AND (~mask).
public static void SetMask<T>(this ref T src, T mask, bool isCommitting) where T : struct
Parameters
srcTsrc
maskTmask
isCommittingboolis committing or cancelling
Type Parameters
Tnumber type