forked from sin365/AxibugEmuOnline
16 lines
327 B
C#
16 lines
327 B
C#
namespace StoicGoose.Common.Utilities
|
|
{
|
|
public static class BitHandling
|
|
{
|
|
public static void ChangeBit(ref byte value, int bit, bool state)
|
|
{
|
|
if (state)
|
|
value |= (byte)(1 << bit);
|
|
else
|
|
value &= (byte)~(1 << bit);
|
|
}
|
|
|
|
public static bool IsBitSet(byte value, int bit) => (value & (1 << bit)) != 0;
|
|
}
|
|
}
|