public static T Pick <T>(this System.Random self, List <T> list)
 {
     if (list.Count == 0)
     {
         return(default(T));
     }
     return(list[self.RangeExclusive(0, list.Count)]);
 }
 public static T Pick <T>(this System.Random self, T[] array)
 {
     if (array.Length == 0)
     {
         return(default(T));
     }
     return(array[self.RangeExclusive(0, array.Length)]);
 }
 public static void Shuffle <T> (this System.Random self, ref T[] array)
 {
     for (int i = array.Length - 1; i > 0; --i)
     {
         int j    = self.RangeExclusive(0, i);
         T   swap = array[i];
         array[i] = array[j];
         array[j] = swap;
     }
 }
 public static int RangeExclusive(int min, int max)
 {
     return(SharedRandom.RangeExclusive(min, max));
 }