Beispiel #1
0
 /// <summary>
 /// Returns a random positive integer between the specified inclusive start
 /// value and the exclusive end value.
 /// </summary>
 public static int GetRandomRange(long seed, long x, long y, long z, int start, int end, long modifier)
 {
     unchecked
     {
         int a = AlgorithmUtility.GetRandomInt(seed, x, y, z, modifier);
         if (a < 0)
         {
             a += int.MaxValue;
         }
         return(a % (end - start) + start);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Returns a random integer over the range of valid integers based
 /// on the provided X and Y position, and the specified modifier.
 /// </summary>
 public int GetRandomInt(long x, long y, long z, long modifier = 0)
 {
     return(AlgorithmUtility.GetRandomInt(this.Seed, x, y, z, modifier));
 }