Class NetcodeBitArrayExtensions
For Unity.
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public static class NetcodeBitArrayExtensions
Methods
FindLastSetBitExt(ref UnsafeBitArray)
Finds the index of the last true bit in the BitArray, and returns said bit index.
Declaration
public static int FindLastSetBitExt(this ref UnsafeBitArray bitArray)
Parameters
Type | Name | Description |
---|---|---|
Unsafe |
bitArray | The bitArray to query. |
Returns
Type | Description |
---|---|
int | -1 if no true bits found. |
ShiftLeftExt(ref UnsafeBitArray, int)
Shifts the entire bit array left (in other words: upwards away from 0, towards Unity.
Declaration
public static void ShiftLeftExt(this ref UnsafeBitArray bitArray, int shiftBits)
Parameters
Type | Name | Description |
---|---|---|
Unsafe |
bitArray | Instance to apply the operation on. |
int | shiftBits | How far should all the bits be shifted (in number of bits i.e. bit indexes)? |
ShiftRightExt(ref UnsafeBitArray, int)
Shifts the entire bit array right (in other words: downwards towards 0, away from Unity.
Declaration
public static void ShiftRightExt(this ref UnsafeBitArray bitArray, int shiftBits)
Parameters
Type | Name | Description |
---|---|---|
Unsafe |
bitArray | Instance to apply the operation on. |
int | shiftBits | How far should all the bits be shifted (in number of bits i.e. bit indexes)? |
ToDecimalFixedStringExt(ref UnsafeBitArray, int)
Logs a human-readable format for this bit array.
Declaration
public static FixedString4096Bytes ToDecimalFixedStringExt(this ref UnsafeBitArray bitArray, int maxFixedStringLength = 4093)
Parameters
Type | Name | Description |
---|---|---|
Unsafe |
bitArray | Instance to apply the operation on. |
int | maxFixedStringLength | Denotes the max fixed string length, if you want a concatenated string. |
Returns
Type | Description |
---|---|
Fixed |
Example: |