public static T GetRandomElementFromList <T>(List <T> theList) { T local2; if (!ReferenceEquals(theList, null)) { local2 = theList[CachedRandom.Next(theList.Count)]; } else { local2 = default(T); } return(local2); }
public static T GetRandomElementFromArray <T>(T[] theArray) { T local2; if (theArray != null) { local2 = theArray[CachedRandom.Next(theArray.Length)]; } else { local2 = default(T); } return(local2); }
public static bool RandomBool() => (CachedRandom.Next(0, 2) == 0);