Class Arrays
Inheritance
System.Object
Arrays
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class Arrays
Methods
AddOrdered<T>(List<T>, T)
Adds an item to a collection, ordering it's position based on itemOrder. Lower values are inserted near the beginning of the collection.
Declaration
public static void AddOrdered<T>(this List<T> collection, T item)
where T : IOrderable
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | collection | |
T | item |
Type Parameters
Name | Description |
---|---|
T |
AddUnique<T>(List<T>, T)
Adds an entry to a list if it does not exist already.
Declaration
public static bool AddUnique<T>(this List<T> list, T value)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | list | |
T | value |
Returns
Type | Description |
---|---|
System.Boolean | True if being added. |
Type Parameters
Name | Description |
---|---|
T |
FastIndexRemove<T>(List<T>, Int32)
Removes an index from a list through re-ordering. This breaks the order of the list for a faster remove.
Declaration
public static void FastIndexRemove<T>(this List<T> list, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | list | |
System.Int32 | index |
Type Parameters
Name | Description |
---|---|
T |
FastReferenceRemove<T>(List<T>, Object)
Removes an object from a list through re-ordering. This breaks the order of the list for a faster remove.
Declaration
public static bool FastReferenceRemove<T>(this List<T> list, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | list | |
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T |
Shuffle<T>(T[])
Shuffles an array.
Declaration
public static void Shuffle<T>(this T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array |
Type Parameters
Name | Description |
---|---|
T |
Shuffle<T>(List<T>)
Shuffles a list.
Declaration
public static void Shuffle<T>(this List<T> lst)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | lst |
Type Parameters
Name | Description |
---|---|
T |
ToString<T>(IEnumerable<T>, String)
Cast each item in the collection ToString and returns all values.
Declaration
public static string ToString<T>(this IEnumerable<T> collection, string delimeter = ", ")
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | collection | |
System.String | delimeter |
Returns
Type | Description |
---|---|
System.String |
Type Parameters
Name | Description |
---|---|
T |