Class Arithmetic
Arithmetic helper class
Inherited Members
Namespace: Unity.Netcode
Assembly: Unity.Netcode.Runtime.dll
Syntax
public static class Arithmetic
Methods
VarIntSize(ulong)
Gets the output size in bytes after VarInting a unsigned integer
Declaration
public static int VarIntSize(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | The unsigned integer whose length to get |
Returns
Type | Description |
---|---|
int | The amount of bytes |
ZigZagDecode(ulong)
Decides a ZigZag encoded integer back to a signed integer
Declaration
public static long ZigZagDecode(ulong value)
Parameters
Type | Name | Description |
---|---|---|
ulong | value | The unsigned integer |
Returns
Type | Description |
---|---|
long | The signed version of the integer |
ZigZagEncode(long)
ZigZag encodes a signed integer and maps it to a unsigned integer
Declaration
public static ulong ZigZagEncode(long value)
Parameters
Type | Name | Description |
---|---|---|
long | value | The signed integer to encode |
Returns
Type | Description |
---|---|
ulong | A ZigZag encoded version of the integer |