Click or drag to resize

CollectionExtensions Class

This class provides useful extension methods for collections, mostly IEnumerable.
Inheritance Hierarchy
SystemObject
  Gamelogic.Extensions.AlgorithmsCollectionExtensions

Namespace:  Gamelogic.Extensions.Algorithms
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(1, 0, 0)]
public static class CollectionExtensions

The CollectionExtensions type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAddRangeT
Add all elements of other to the given source.
Public methodStatic memberAreSequencesEqualT
Checks whether the sequences are equal.
Public methodStatic memberBinarySearchTCollection, TElement(ICollectionTCollection, TElement, FuncTCollection, TElement)
Find an element in a collection by binary searching. This requires the collection to be sorted on the values returned by getSubElement This will compare some derived property of the elements in the collection, rather than the elements themselves.
Public methodStatic memberBinarySearchTCollection, TElement(ICollectionTCollection, TElement, FuncTCollection, TElement, IComparerTElement)
Find an element in a collection by binary searching. This requires the collection to be sorted on the values returned by getSubElement This will compare some derived property of the elements in the collection, rather than the elements themselves.
Public methodStatic memberBinarySearchTCollection, TElement(ICollectionTCollection, TElement, FuncTCollection, TElement, Int32, Int32)
Find an element in a collection by binary searching. This requires the collection to be sorted on the values returned by getSubElement This will compare some derived property of the elements in the collection, rather than the elements themselves.
Public methodStatic memberBinarySearchTCollection, TElement(ICollectionTCollection, TElement, FuncTCollection, TElement, Int32, Int32, IComparerTElement)
Find an element in a collection by binary searching. This requires the collection to be sorted on the values returned by getSubElement This will compare some derived property of the elements in the collection, rather than the elements themselves.
Public methodStatic memberButFirstT
Returns an enumerable of all elements of the given list but the first, keeping them in order.
Public methodStatic memberButLastT
Returns an enumerable of all elements in the given list but the last, keeping them in order.
Public methodStatic memberFilterByTypeT, TFilter
Returns all elements of the source which are of FilterType.
Public methodStatic memberIsEmptyT
Returns whether this source is empty.
Public methodStatic memberListToStringT
Returns a pretty string representation of the given list. The resulting string looks something like [a, b, c].
Public methodStatic memberMaxByT(IEnumerableT, FuncT, IComparable)
Finds the maximum element in the source as scored by the given function.
Public methodStatic memberMaxByTSource, TKey(IEnumerableTSource, FuncTSource, TKey)
Finds the minimum element in the source as scored by its projection.
Public methodStatic memberMaxByTSource, TKey(IEnumerableTSource, FuncTSource, TKey, IComparerTKey)
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
Public methodStatic memberMinByTSource, TKey(IEnumerableTSource, FuncTSource, TKey)
Finds the minimum element in the source as scored by its projection.
Public methodStatic memberMinByTSource, TKey(IEnumerableTSource, FuncTSource, TKey, IComparerTKey)
Finds the minimum element in the source as scored by the given function applied to a projection on the elements.
Public methodStatic memberRandomItemT(IEnumerableT)
Returns a random element from a source.
Public methodStatic memberRandomItemT(IEnumerableT, IRandom)
Returns a random element from a source.
Public methodStatic memberRemoveAllButT
Removes all the elements in the list that does not satisfy the predicate.
Public methodStatic memberRotateLeftT
Returns a enumerable with elements in order, but the first element is moved to the end.
Public methodStatic memberRotateRightT
Returns a enumerable with elements in order, but the last element is moved to the front.
Public methodStatic memberSampleRandomT(IEnumerableT, Int32)
Returns a random sample from a source.
Public methodStatic memberSampleRandomT(IEnumerableT, Int32, IRandom)
Returns a random sample from a source.
Public methodStatic memberShuffleT(IListT)
Shuffles a list.
Public methodStatic memberShuffleT(IListT, IRandom)
Shuffles a list.
Public methodStatic memberTakeHalfT
Returns the first half of elements from a source.
Public methodStatic memberTakeLastT
Returns the last n elements from a source.
Top
See Also