Show / Hide Table of Contents

# Class Utils

##### Inheritance

object
Utils

###### Namespace: LiteEntitySystem.Internal

###### Assembly: LiteEntitySystem.dll

##### Syntax

    public static class Utils

### Fields

#### Encoding

##### Declaration

    public static readonly ThreadLocal<UTF8Encoding> Encoding

##### Field Value

Type | Description
--- | ---
ThreadLocal<UTF8Encoding> |

### Methods

#### FastEquals<T>(ref T, byte*)

##### Declaration

    public static bool FastEquals<T>(ref T a, byte* x2) where T : unmanaged

##### Parameters

Type | Name | Description
--- | --- | ---
T | a |
byte* | x2 |

##### Returns

Type | Description
--- | ---
bool |

##### Type Parameters

Name | Description
--- | ---
T |

#### FastEquals<T>(ref T, ref T)

##### Declaration

    public static bool FastEquals<T>(ref T a, ref T b) where T : unmanaged

##### Parameters

Type | Name | Description
--- | --- | ---
T | a |
T | b |

##### Returns

Type | Description
--- | ---
bool |

##### Type Parameters

Name | Description
--- | ---
T |

#### GetBaseTypes(Type, Type, bool)

##### Declaration

    public static Stack<Type> GetBaseTypes(Type ofType, Type until, bool includeSelf)

##### Parameters

Type | Name | Description
--- | --- | ---
Type | ofType |
Type | until |
bool | includeSelf |

##### Returns

Type | Description
--- | ---
Stack<Type> |

#### GetFieldOffset(FieldInfo)

##### Declaration

    public static int GetFieldOffset(FieldInfo fieldInfo)

##### Parameters

Type | Name | Description
--- | --- | ---
FieldInfo | fieldInfo |

##### Returns

Type | Description
--- | ---
int |

#### IsBitSet(byte*, int)

##### Declaration

    public static bool IsBitSet(byte* byteArray, int bitNumber)

##### Parameters

Type | Name | Description
--- | --- | ---
byte* | byteArray |
int | bitNumber |

##### Returns

Type | Description
--- | ---
bool |

#### IsBitSet(byte[], int, int)

##### Declaration

    public static bool IsBitSet(byte[] byteArray, int offset, int bitNumber)

##### Parameters

Type | Name | Description
--- | --- | ---
byte[] | byteArray |
int | offset |
int | bitNumber |

##### Returns

Type | Description
--- | ---
bool |

#### Lerp(double, double, float)

##### Declaration

    public static double Lerp(double a, double b, float t)

##### Parameters

Type | Name | Description
--- | --- | ---
double | a |
double | b |
float | t |

##### Returns

Type | Description
--- | ---
double |

#### Lerp(int, int, float)

##### Declaration

    public static int Lerp(int a, int b, float t)

##### Parameters

Type | Name | Description
--- | --- | ---
int | a |
int | b |
float | t |

##### Returns

Type | Description
--- | ---
int |

#### Lerp(long, long, float)

##### Declaration

    public static long Lerp(long a, long b, float t)

##### Parameters

Type | Name | Description
--- | --- | ---
long | a |
long | b |
float | t |

##### Returns

Type | Description
--- | ---
long |

#### Lerp(float, float, float)

##### Declaration

    public static float Lerp(float a, float b, float t)

##### Parameters

Type | Name | Description
--- | --- | ---
float | a |
float | b |
float | t |

##### Returns

Type | Description
--- | ---
float |

#### LerpSequence(ushort, ushort, float)

##### Declaration

    public static ushort LerpSequence(ushort seq1, ushort seq2, float t)

##### Parameters

Type | Name | Description
--- | --- | ---
ushort | seq1 |
ushort | seq2 |
float | t |

##### Returns

Type | Description
--- | ---
ushort |

#### ResizeIfFull<T>(ref T[], int)

##### Declaration

    public static void ResizeIfFull<T>(ref T[] arr, int count)

##### Parameters

Type | Name | Description
--- | --- | ---
T[] | arr |
int | count |

##### Type Parameters

Name | Description
--- | ---
T |

#### ResizeOrCreate<T>(ref T[], int)

##### Declaration

    public static void ResizeOrCreate<T>(ref T[] arr, int count)

##### Parameters

Type | Name | Description
--- | --- | ---
T[] | arr |
int | count |

##### Type Parameters

Name | Description
--- | ---
T |

#### SequenceDiff(ushort, ushort)

##### Declaration

    public static int SequenceDiff(ushort newer, ushort older)

##### Parameters

Type | Name | Description
--- | --- | ---
ushort | newer |
ushort | older |

##### Returns

Type | Description
--- | ---
int |