My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Static Public Member Functions | List of all members
UniExtensions.CollectionExtensionMethods Class Reference

Static Public Member Functions

static void Shuffle< T > (this IList< T > list)
 Shuffle the specified list. More...
 
static T GetRandom< T > (this IList< T > list)
 Get a random element from the list. More...
 
static T PopRandom< T > (this IList< T > list)
 Remove and return a random element from the list. More...
 
static T Pop< T > (this IList< T > list, int index)
 Remove and return a element in the list by index. Out of range indices are wrapped into range. More...
 
static T Get< T > (this IList< T > list, int index)
 Return an element from a list by index. Out of range indices are wrapped into range. More...
 
static TValue Pop< TKey, TValue > (this IDictionary< TKey, TValue > dict, TKey key)
 Remove and return a value from a dictionary. More...
 
static void Map< T > (this IList< T > list, System.Action< T > fn)
 
static void Map< T > (this T[] list, System.Action< T > fn)
 
static void Apply< T > (this IList< T > list, System.Func< T, T > fn)
 
static void Apply< T > (this T[] list, System.Func< T, T > fn)
 

Member Function Documentation

static void UniExtensions.CollectionExtensionMethods.Apply< T > ( this IList< T >  list,
System.Func< T, T >  fn 
)
inlinestatic
static void UniExtensions.CollectionExtensionMethods.Apply< T > ( this T[]  list,
System.Func< T, T >  fn 
)
inlinestatic
static T UniExtensions.CollectionExtensionMethods.Get< T > ( this IList< T >  list,
int  index 
)
inlinestatic

Return an element from a list by index. Out of range indices are wrapped into range.

Returns
A T
static T UniExtensions.CollectionExtensionMethods.GetRandom< T > ( this IList< T >  list)
inlinestatic

Get a random element from the list.

Returns
A T
static void UniExtensions.CollectionExtensionMethods.Map< T > ( this IList< T >  list,
System.Action< T >  fn 
)
inlinestatic
static void UniExtensions.CollectionExtensionMethods.Map< T > ( this T[]  list,
System.Action< T >  fn 
)
inlinestatic
static T UniExtensions.CollectionExtensionMethods.Pop< T > ( this IList< T >  list,
int  index 
)
inlinestatic

Remove and return a element in the list by index. Out of range indices are wrapped into range.

Returns
A T
static TValue UniExtensions.CollectionExtensionMethods.Pop< TKey, TValue > ( this IDictionary< TKey, TValue >  dict,
TKey  key 
)
inlinestatic

Remove and return a value from a dictionary.

Parameters
dictDict.
keyKey.
Template Parameters
TKeyThe 1st type parameter.
TValueThe 2nd type parameter.
static T UniExtensions.CollectionExtensionMethods.PopRandom< T > ( this IList< T >  list)
inlinestatic

Remove and return a random element from the list.

Returns
A T
static void UniExtensions.CollectionExtensionMethods.Shuffle< T > ( this IList< T >  list)
inlinestatic

Shuffle the specified list.

Parameters
listList.
Template Parameters
TThe 1st type parameter.

The documentation for this class was generated from the following file: