public static T PopRandom <T>(this List <T> list) { var idx = LocalRandom.Range(0, list.Count); var item = list[idx]; list.RemoveAt(idx); return(item); }
public static T PickRandom <T>(this T[] array) => array[LocalRandom.Range(0, array.Length)];
public static T PickRandom <T>(this List <T> list) => list[LocalRandom.Range(0, list.Count)];