CollectionExtensions Class |
Namespace: Gamelogic.Extensions.Algorithms
[VersionAttribute(1, 0, 0)] public static class CollectionExtensions
The CollectionExtensions type exposes the following members.
Name | Description | |
---|---|---|
AddRangeT |
Add all elements of other to the given source.
| |
AreSequencesEqualT |
Checks whether the sequences are equal.
| |
BinarySearchTCollection, 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.
| |
BinarySearchTCollection, 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.
| |
BinarySearchTCollection, 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.
| |
BinarySearchTCollection, 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.
| |
ButFirstT |
Returns an enumerable of all elements of the given list but the first,
keeping them in order.
| |
ButLastT |
Returns an enumerable of all elements in the given
list but the last, keeping them in order.
| |
FilterByTypeT, TFilter |
Returns all elements of the source which are of FilterType.
| |
IsEmptyT |
Returns whether this source is empty.
| |
ListToStringT |
Returns a pretty string representation of the given list. The resulting string looks something like
[a, b, c].
| |
MaxByT(IEnumerableT, FuncT, IComparable) |
Finds the maximum element in the source as scored by the given function.
| |
MaxByTSource, TKey(IEnumerableTSource, FuncTSource, TKey) |
Finds the minimum element in the source as scored by its projection.
| |
MaxByTSource, 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.
| |
MinByTSource, TKey(IEnumerableTSource, FuncTSource, TKey) |
Finds the minimum element in the source as scored by its projection.
| |
MinByTSource, 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.
| |
RandomItemT(IEnumerableT) |
Returns a random element from a source.
| |
RandomItemT(IEnumerableT, IRandom) |
Returns a random element from a source.
| |
RemoveAllButT |
Removes all the elements in the list that does not satisfy the predicate.
| |
RotateLeftT |
Returns a enumerable with elements in order, but the first element is moved to the end.
| |
RotateRightT |
Returns a enumerable with elements in order, but the last element is moved to the front.
| |
SampleRandomT(IEnumerableT, Int32) |
Returns a random sample from a source.
| |
SampleRandomT(IEnumerableT, Int32, IRandom) |
Returns a random sample from a source.
| |
ShuffleT(IListT) |
Shuffles a list.
| |
ShuffleT(IListT, IRandom) |
Shuffles a list.
| |
TakeHalfT |
Returns the first half of elements from a source.
| |
TakeLastT |
Returns the last n elements from a source.
|