mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 21:53:49 +08:00
New Project Window
This commit is contained in:
@@ -194,4 +194,28 @@ namespace CodeWalker
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static class BitUtil
|
||||
{
|
||||
public static bool IsBitSet(uint value, int bit)
|
||||
{
|
||||
return (((value >> bit) & 1) > 0);
|
||||
}
|
||||
public static uint SetBit(uint value, int bit)
|
||||
{
|
||||
return (value | (1u << bit));
|
||||
}
|
||||
public static uint ClearBit(uint value, int bit)
|
||||
{
|
||||
return (value & (~(1u << bit)));
|
||||
}
|
||||
public static uint UpdateBit(uint value, int bit, bool flag)
|
||||
{
|
||||
if (flag) return SetBit(value, bit);
|
||||
else return ClearBit(value, bit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user