Esempio n. 1
0
        public static void Suffle <T> (this T[] array, EiRandom random, int amount)
        {
            int count = array.Length;
            T   tempValue;

            for (int i = 0; i < amount; i++)
            {
                var index1 = random._Range(count);
                var index2 = random._Range(count);
                tempValue      = array [index1];
                array [index1] = array [index2];
                array [index2] = tempValue;
            }
        }
Esempio n. 2
0
 public static T RandomElement <T> (this T[] array)
 {
     return(EiRandom.Element(array));
 }
Esempio n. 3
0
 public EiRandomizedQueue(IEnumerable <T> items)
 {
     random = new EiRandom(EiRandom.Range(0, 1000000));
     content.AddRange(items);
 }
Esempio n. 4
0
 public EiRandomizedQueue()
 {
     random = new EiRandom(EiRandom.Range(0, 1000000));
 }
Esempio n. 5
0
 public static float Randomness(this float value, float amount)
 {
     return(value + EiRandom.Range(-amount, amount));
 }
Esempio n. 6
0
 public static int Randomness(this int value, int amount)
 {
     return(value + EiRandom.Range(-amount, amount));
 }
Esempio n. 7
0
 public static double Randomness(this double value, double amount)
 {
     return(value + EiRandom.Range(-amount, amount));
 }
Esempio n. 8
0
 public float GetRandomValue(EiRandom random)
 {
     return(random._Range(minValue, maxValue));
 }
Esempio n. 9
0
 public static T RandomElement <T> (this IList <T> list, EiRandom random)
 {
     return(random._Element(list));
 }
Esempio n. 10
0
 public static T RandomElement <T> (this IList <T> list)
 {
     return(EiRandom.Element(list));
 }
Esempio n. 11
0
 public static T RandomElement <T> (this T[] array, EiRandom random)
 {
     return(random._Element(array));
 }