Exemplo n.º 1
0
        public static SeedRandom GetSeeder(SeederType type)
        {
            switch (type)
            {
            case SeederType.Build: return(Builder.BuildSeedRandom);

            case SeederType.Session: return(Builder.SessionSeedRandom);

            case SeederType.HostID: return(Builder.HostIDSeedRandom);
            }

            return(Builder.SessionSeedRandom);
        }
Exemplo n.º 2
0
        public static void Shuffle <T>(T[] array, SeederType type = SeederType.Session, string debugTag = "NO_TAG")
        {
            var seeder = GetSeeder(type);

            int i = array.Length;

            while (i > 1)
            {
                int num = seeder.Range(0, i--);
                T   t   = array[i];
                array[i]   = array[num];
                array[num] = t;
            }
        }
Exemplo n.º 3
0
 public static T PickFromArray <T>(T[] items, SeederType type = SeederType.Session, string debugTag = "NO_TAG")
 {
     if (items == null)
     {
         return(default);
Exemplo n.º 4
0
 public static int Range(int min, int max, SeederType type = SeederType.Session, string debugTag = "NO_TAG")
 {
     return(GetSeeder(type).Range(min, max, debugTag));
 }
Exemplo n.º 5
0
 public static float Value(SeederType type = SeederType.Session, string debugTag = "NO_TAG")
 {
     return(GetSeeder(type).Value(debugTag));
 }